Skip to content

Commit 6ca6dee

Browse files
authored
Merge pull request #94 from icgc-argo/payload-gen-dna-alignment.0.3.2.0
tested successfully
2 parents 2b98104 + ffca201 commit 6ca6dee

2 files changed

Lines changed: 14 additions & 6 deletions

File tree

tools/payload-gen-dna-alignment/payload-gen-dna-alignment.nf

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,24 @@
2424
*/
2525

2626
nextflow.enable.dsl=2
27-
version = '0.3.1.0'
27+
version = '0.3.2.0'
2828

2929
params.files_to_upload = ""
3030
params.seq_experiment_analysis = ""
3131
params.read_group_ubam_analysis = ""
3232
params.wf_name = ""
3333
params.wf_version = ""
34-
params.container_version = ''
34+
params.container_version = ""
35+
params.cpus = 1
36+
params.mem = 1 // GB
37+
params.publish_dir = ""
3538

3639
process payloadGenDnaAlignment {
3740
container "quay.io/icgc-argo/payload-gen-dna-alignment:payload-gen-dna-alignment.${params.container_version ?: version}"
41+
publishDir "${params.publish_dir}/${task.process.replaceAll(':', '_')}", enabled: "${params.publish_dir ? true : ''}"
42+
43+
cpus params.cpus
44+
memory "${params.mem} GB"
3845

3946
input:
4047
path files_to_upload

tools/payload-gen-dna-alignment/payload-gen-dna-alignment.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def get_rg_count(aligned_file):
6363
return len(p.stdout.decode('utf-8').strip().split('\n'))
6464

6565

66-
def rename_file(f, payload, rg_count, sample_info):
66+
def rename_file(f, payload, rg_count, sample_info, date_str):
6767
experimental_strategy = payload['experiment']['experimental_strategy'].lower()
6868

6969
if f.endswith('.bam'):
@@ -82,7 +82,7 @@ def rename_file(f, payload, rg_count, sample_info):
8282
sample_info[0]['donor']['donorId'],
8383
sample_info[0]['sampleId'],
8484
experimental_strategy,
85-
date.today().strftime("%Y%m%d"),
85+
date_str,
8686
'aln',
8787
file_ext
8888
)
@@ -177,9 +177,10 @@ def main(args):
177177
rg_count = get_rg_count(aligned_file)
178178

179179
# get file of the payload
180+
date_str = date.today().strftime("%Y%m%d")
180181
for f in args.files_to_upload:
181-
renamed_file = rename_file(f, payload, rg_count, seq_experiment_analysis_dict['samples'])
182-
payload['files'].append(get_files_info(renamed_file))
182+
renamed_file = rename_file(f, payload, rg_count, seq_experiment_analysis_dict['samples'], date_str)
183+
payload['files'].append(get_files_info(renamed_file))
183184

184185
with open("%s.dna_alignment.payload.json" % str(uuid.uuid4()), 'w') as f:
185186
f.write(json.dumps(payload, indent=2))

0 commit comments

Comments
 (0)