Skip to content

Commit ae4a7d4

Browse files
committed
pass update prep metrics and payload modules
1 parent d6b55f3 commit ae4a7d4

File tree

4 files changed

+12
-13
lines changed

4 files changed

+12
-13
lines changed

modules.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
]
4242
},
4343
"prep/metrics": {
44-
"branch": "main",
45-
"git_sha": "c041bcd0e203622a9ebebd720897d162a9ba95d7",
44+
"branch": "update_payload_2",
45+
"git_sha": "840aac9dffe16e09013b263b6982777d72860192",
4646
"installed_by": [
4747
"modules"
4848
]

modules/icgc-argo-workflows/prep/metrics/main.nf

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ process PREP_METRICS {
2121

2222
script:
2323
def workflow_name = workflow.Manifest.name
24-
25-
24+
25+
2626
"""
2727
case '$workflow_name' in
2828
'Pre Alignment QC')

modules/icgc-argo-workflows/prep/metrics/resources/usr/bin/dnaaln.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import csv
2828

2929
ga4gh_wgs_qc_metrics = [
30+
3031
'insert_size_std_deviation',
3132
'mad_autosome_coverage',
3233
'mean_autosome_coverage',
@@ -79,7 +80,7 @@ def get_mqc_stats(multiqc, sampleId):
7980
for f in sorted(glob(multiqc+'/*.txt')):
8081
for tool_metrics in tool_fieldmap.keys():
8182
if f.endswith(tool_metrics+'.txt'):
82-
with open(f, 'r') as fn:
83+
with open(f, 'r') as fn:
8384
mqc_stats[tool_metrics] = []
8485
reader = csv.DictReader(fn, delimiter="\t")
8586
for row in reader:
@@ -105,7 +106,7 @@ def get_mqc_stats(multiqc, sampleId):
105106
mqc_stats['metrics'].update({
106107
fn: new_value
107108
})
108-
109+
109110
return mqc_stats
110111

111112
def main():
@@ -119,7 +120,7 @@ def main():
119120
parser.add_argument("-q", "--qc_files", dest="qc_files", required=True, type=str, nargs="+", help="qc files")
120121

121122
args = parser.parse_args()
122-
123+
123124
# get tool_specific & aggregated metrics from multiqc
124125
mqc_stats = {}
125126
if args.multiqc:
@@ -132,7 +133,7 @@ def main():
132133
file_type = 'gatk_contamination'
133134
if file_type in mqc_stats: continue
134135
mqc_stats[file_type] = []
135-
with open(fn, 'r') as f:
136+
with open(fn, 'r') as f:
136137
reader = csv.DictReader(f, delimiter="\t")
137138
for row in reader:
138139
mqc_stats[file_type].append(row)
@@ -155,7 +156,7 @@ def main():
155156
}
156157
for k,v in mqc_stats_updated.get('metrics', None).items():
157158
if not k in ga4gh_wgs_qc_metrics: continue
158-
ga4gh_qc_dict['wgs_qc_metrics'].update({k: v})
159+
ga4gh_qc_dict['wgs_qc_metrics'].update({k: v})
159160

160161
if ga4gh_qc_dict['wgs_qc_metrics']:
161162
with open("%s.dnaaln.metrics.json" % (args.sampleId), 'w') as f:

modules/icgc-argo-workflows/prep/metrics/resources/usr/bin/rnaaln.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
'hisat2': {
3131
'paired_total' : 'paired_total',
3232
'unpaired_total' : 'unpaired_total'
33-
# 'overall_alignment_rate' : 'overall_alignment_rate' # collected from samtools stats
3433
},
3534
'star' : {
3635
'total_reads' : 'total_reads',
@@ -39,7 +38,6 @@
3938
'avg_mapped_read_length' : 'avg_mapped_read_length',
4039
'num_splices' : 'num_splices',
4140
'num_annotated_splices' : 'num_annotated_splices',
42-
# 'mismatch_rate' : 'mismatch_rate', # collected from samtools
4341
'pct_multimapped' : 'multimapped_percent'
4442
},
4543
'picard_RnaSeqMetrics': {
@@ -81,7 +79,7 @@ def get_mqc_stats(multiqc, sampleId):
8179
for f in sorted(glob(multiqc+'/*.txt')):
8280
for tool_metrics in tool_fieldmap.keys():
8381
if f.endswith(tool_metrics+'.txt'):
84-
with open(f, 'r') as fn:
82+
with open(f, 'r') as fn:
8583
mqc_stats[tool_metrics] = []
8684
reader = csv.DictReader(fn, delimiter="\t")
8785
for row in reader:
@@ -94,7 +92,7 @@ def get_mqc_stats(multiqc, sampleId):
9492

9593
# convert the fraction to percentage for given fields
9694
for fn in fra2pct_fields:
97-
if not mqc_stats['metrics'].get(fn):
95+
if not mqc_stats['metrics'].get(fn):
9896
print(f"Field '{fn}' not found in mqc_stats['metrics'] dictionary")
9997
continue
10098
new_value = round(float(mqc_stats['metrics'][fn]) * 100, 2)

0 commit comments

Comments
 (0)