Skip to content

Commit eddf4e5

Browse files
authored
Merge pull request #92 from icgc-argo/payload-gen-dna-seq-qc.0.5.1.0
Payload gen dna seq qc.0.5.1.0
2 parents 9029c23 + 0b0eca8 commit eddf4e5

7 files changed

Lines changed: 11 additions & 8 deletions

tests/data/C0HVY.2.6d3111fbcbc26c34bb97d76aa24d3eed.lane.bam.ubam_qc_metrics.tgz renamed to tests/data/C0HVY.2.b2e20ab4ae30dbcf1ee2319a2ce8bbb7.lane.bam.ubam_qc_metrics.tgz

File renamed without changes.

tests/data/D0RE2.1.156db267eead7aea8e05b574a01a325e.lane.bam.ubam_qc_metrics.tgz renamed to tests/data/D0RE2.1.604a62a7e9472e9e2818a536bfd08019.lane.bam.ubam_qc_metrics.tgz

File renamed without changes.

tests/data/D0RH0.2.db2e15cf9008af2ecda8743e7fd7060a.lane.bam.ubam_qc_metrics.tgz renamed to tests/data/D0RH0.2.da2fc67e6d0a0ff8b4e4dc1c5b7fd5eb.lane.bam.ubam_qc_metrics.tgz

File renamed without changes.

tools/payload-gen-dna-seq-qc/payload-gen-dna-seq-qc.nf

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
* Junjun Zhang <junjun.zhang@oicr.on.ca>
2323
*/
2424

25-
nextflow.preview.dsl=2
26-
version = '0.4.1.0'
25+
nextflow.enable.dsl=2
26+
version = '0.5.1.0'
2727

2828
params.seq_experiment_analysis = ""
2929
params.qc_files = []
@@ -32,12 +32,14 @@ params.wf_version = ""
3232
params.container_version = ""
3333
params.cpus = 1
3434
params.mem = 1 // GB
35+
params.publish_dir = ""
3536

3637

3738
process payloadGenDnaSeqQc {
3839
container "quay.io/icgc-argo/payload-gen-dna-seq-qc:payload-gen-dna-seq-qc.${params.container_version ?: version}"
3940
cpus params.cpus
4041
memory "${params.mem} GB"
42+
publishDir "${params.publish_dir}/${task.process.replaceAll(':', '_')}", enabled: "${params.publish_dir ? true : ''}"
4143

4244
input:
4345
path seq_experiment_analysis

tools/payload-gen-dna-seq-qc/payload-gen-dna-seq-qc.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,16 @@ def get_rg_id_from_ubam_qc(tar, metadata):
9494

9595
for rg in metadata.get("read_groups"):
9696
rg_id_in_bam = rg.get("read_group_id_in_bam") if rg.get("read_group_id_in_bam") else rg.get("submitter_read_group_id")
97-
md5sum_from_metadata = hashlib.md5(rg_id_in_bam.encode('utf-8')).hexdigest()
97+
seq_file_name = rg.get("file_r1")
98+
bam_name = seq_file_name if seq_file_name.endswith('.bam') else ''
99+
md5sum_from_metadata = hashlib.md5(("%s %s" % (bam_name, rg_id_in_bam)).encode('utf-8')).hexdigest()
98100
if md5sum_from_metadata == md5sum_from_filename:
99101
return rg.get("filename_friendly_rg_id")
100102

101103
# up to this point no match found, then something wrong
102104
sys.exit('Error: unable to match ubam qc metric tar "%s" to read group id' % tar_basename)
103105

106+
104107
def get_dupmetrics(file_to_upload):
105108
library = []
106109
with tarfile.open(file_to_upload, 'r') as tar:

tools/payload-gen-dna-seq-qc/tests/checker.nf

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@
2222
* Junjun Zhang <junjun.zhang@oicr.on.ca>
2323
*/
2424

25-
nextflow.preview.dsl=2
25+
nextflow.enable.dsl=2
2626

2727
params.seq_experiment_analysis = ""
2828
params.qc_files = [ ]
2929
params.wf_name = "dna-seq-alignment"
3030
params.wf_version = "0.5.0-dev"
3131
params.container_version = ""
3232

33-
include payloadGenDnaSeqQc from "../payload-gen-dna-seq-qc" params(params)
33+
include {payloadGenDnaSeqQc} from "../payload-gen-dna-seq-qc" params(params)
3434

3535
workflow {
3636
main:
@@ -40,7 +40,4 @@ workflow {
4040
params.wf_name,
4141
params.wf_version
4242
)
43-
publish:
44-
payloadGenDnaSeqQc.out.payload to: 'outdir', overwrite: true
45-
payloadGenDnaSeqQc.out.qc_files to: 'outdir', overwrite: true
4643
}

tools/payload-gen-dna-seq-qc/tests/test-3.nf.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"data/grch38-aligned.merged-multi-library.duplicates_metrics.tgz",
77
"data/SA610149.3.20200214.wgs.grch38.cram.oxog_metrics.tgz"
88
],
9+
"publish_dir": "output",
910
"cpus": 1,
1011
"mem": 0.5
1112
}

0 commit comments

Comments
 (0)