From 3c9acec9a8895687d23c51207718b6580f11eaa3 Mon Sep 17 00:00:00 2001 From: Richard de Borja Date: Tue, 13 Feb 2024 18:24:58 -0500 Subject: [PATCH 1/2] if metadata ct has all NA values, change to 0 --- workflow/scripts/plot/plot_qc_sequencing.R | 3 +++ 1 file changed, 3 insertions(+) diff --git a/workflow/scripts/plot/plot_qc_sequencing.R b/workflow/scripts/plot/plot_qc_sequencing.R index dd99e10..79d4d94 100644 --- a/workflow/scripts/plot/plot_qc_sequencing.R +++ b/workflow/scripts/plot/plot_qc_sequencing.R @@ -122,6 +122,9 @@ if(!interactive()) { if(args$metadata != "") { metadata.raw <- read.table(args$metadata, header=T, sep="\t") + if(all(is.na(metadata.raw$ct))) { + metadata.raw$ct <- 0 + } # clean metadata of unknown Cts metadata = subset(metadata.raw, ct != "unknown") From 3028cc610830c13e0db1a1bce464e0feeb382fdf Mon Sep 17 00:00:00 2001 From: Richard de Borja Date: Tue, 13 Feb 2024 18:26:46 -0500 Subject: [PATCH 2/2] added N as a possible base in pileup --- workflow/scripts/format_pileup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflow/scripts/format_pileup.py b/workflow/scripts/format_pileup.py index 94c3f19..c84cde4 100644 --- a/workflow/scripts/format_pileup.py +++ b/workflow/scripts/format_pileup.py @@ -12,7 +12,7 @@ print("\t".join(["contig", "position", "depth", "ref_base", "count_A", "count_C", "count_G", "count_T", "count_del", "alt_frequency"])) for pc in samfile.pileup(ignore_orphans=False): - freqs = {'A': 0, 'T': 0, 'G': 0, 'C': 0, '-': 0, 'R': 0 } + freqs = {'A': 0, 'T': 0, 'G': 0, 'C': 0, '-': 0, 'R': 0, 'N': 0 } for pr in pc.pileups: if pr.is_del: freqs['-'] += 1