Skip to content

Commit

Permalink
Merge pull request #1537 from nh13/bugfix/dragen-sample-name-extraction
Browse files Browse the repository at this point in the history
[bugfix] Fix sample and phenotype extraction for DRAGEN
  • Loading branch information
ewels committed Oct 11, 2021
2 parents 196ad64 + f1c09e9 commit f9b5171
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion multiqc/modules/dragen/coverage_hist.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def parse_fine_hist(f):
data[depth] = cnt
cum_data[depth] = cum_pct

m = re.search(r"(.*).(\S*)_fine_hist_?(\S*)?.csv", f["fn"])
m = re.search(r"(.*)\.(\S*)_fine_hist_?(\S*)?.csv", f["fn"])
sample, phenotype = m.group(1), m.group(2)
f["s_name"] = sample
return {phenotype: (data, cum_data, depth_1pc)}
2 changes: 1 addition & 1 deletion multiqc/modules/dragen/coverage_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ def parse_coverage_metrics(f):
if percentage is not None:
data[metric + " pct"] = percentage

m = re.search(r"(.*).(\S*)_coverage_metrics_?(\S*)?.csv", f["fn"])
m = re.search(r"(.*)\.(\S*)_coverage_metrics_?(\S*)?.csv", f["fn"])
sample, phenotype = m.group(1), m.group(2)
f["s_name"] = sample
return {phenotype: data}
2 changes: 1 addition & 1 deletion multiqc/modules/dragen/coverage_per_contig.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def chrom_order(chrom):
sorted(other_contig_perchrom_data.items(), key=lambda key_val: chrom_order(key_val[0]))
)

m = re.search(r"(.*).(\S*)_contig_mean_cov_?(\S*)?.csv", f["fn"])
m = re.search(r"(.*)\.(\S*)_contig_mean_cov_?(\S*)?.csv", f["fn"])
sample, phenotype = m.group(1), m.group(2)
f["s_name"] = sample
return {phenotype: [main_contig_perchrom_data, other_contig_perchrom_data]}
2 changes: 1 addition & 1 deletion multiqc/modules/dragen/fragment_length.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def parse_fragment_length_hist_file(f):
39317,1
"""

f["s_name"] = re.search(r"(.*).fragment_length_hist.csv", f["fn"]).group(1)
f["s_name"] = re.search(r"(.*)\.fragment_length_hist.csv", f["fn"]).group(1)

data_by_rg = defaultdict(dict)

Expand Down
2 changes: 1 addition & 1 deletion multiqc/modules/dragen/mapping_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ def parse_mapping_metrics_file(f):
We are reporting summary metrics in the general stats table, and per-read-group in a separate table.
"""

f["s_name"] = re.search(r"(.*).mapping_metrics.csv", f["fn"]).group(1)
f["s_name"] = re.search(r"(.*)\.mapping_metrics.csv", f["fn"]).group(1)

data_by_readgroup = defaultdict(dict)
data_by_phenotype = defaultdict(dict)
Expand Down
2 changes: 1 addition & 1 deletion multiqc/modules/dragen/ploidy_estimation_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def parse_ploidy_estimation_metrics_file(f):
PLOIDY ESTIMATION,,Ploidy estimation,X0
"""

f["s_name"] = re.search(r"(.*).ploidy_estimation_metrics.csv", f["fn"]).group(1)
f["s_name"] = re.search(r"(.*)\.ploidy_estimation_metrics.csv", f["fn"]).group(1)

data = defaultdict(dict)

Expand Down
2 changes: 1 addition & 1 deletion multiqc/modules/dragen/vc_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ def parse_vc_metrics_file(f):
VARIANT CALLER POSTFILTER,T_SRR7890936_50pc,Percent Autosome Callability,NA
"""

f["s_name"] = re.search(r"(.*).vc_metrics.csv", f["fn"]).group(1)
f["s_name"] = re.search(r"(.*)\.vc_metrics.csv", f["fn"]).group(1)

summary_data = dict()
prefilter_data = dict()
Expand Down

0 comments on commit f9b5171

Please sign in to comment.