Skip to content

Commit 01301fb

Browse files
authored
Merge pull request #21 from Juke34/improve-output-file-names
Improve output file names
2 parents 97057f6 + a430001 commit 01301fb

File tree

4 files changed

+14
-9
lines changed

4 files changed

+14
-9
lines changed

modules/jacusa2.nf

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ process jacusa2 {
88
tuple(path(genome), path(fastaindex))
99

1010
output:
11-
path("*.txt")
11+
path("*.site_edits_jacusa2.txt")
1212
path("*.filtered")
1313
// tuple(sample, path("filtered_output.txt", emit: tuple_sample_jacusa2_table))
1414

1515
script:
16+
base_name = bam.BaseName
17+
1618
"""
17-
java -Xmx${task.memory.toMega()}M -jar /usr/local/bin/JACUSA_v2.0.4.jar call-1 -a D -f V -p ${task.cpus} -r jacusa_out.txt -c 1 -s -R ${genome} ${bam}
19+
java -Xmx${task.memory.toMega()}M -jar /usr/local/bin/JACUSA_v2.0.4.jar call-1 -a D -f V -p ${task.cpus} -r ${base_name}.site_edits_jacusa2.txt -c 1 -s -R ${genome} ${bam}
1820
"""
1921
}

modules/pluviometer.nf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ process pluviometer {
99
val(tool_format)
1010

1111
output:
12-
tuple(val(meta), path("feature_edits.tsv"), emit: tuple_sample_feature_edits)
12+
tuple(val(meta), path("*.feature_edits.tsv"), emit: tuple_sample_feature_edits)
1313

1414

1515
script:
16+
base_name = site_edits.BaseName
1617
"""
1718
# cp ${workflow.projectDir}/bin/stats/*.py ./
1819
python ${workflow.projectDir}/bin/stats/pluviometer.py \
@@ -22,6 +23,6 @@ process pluviometer {
2223
--cov 1 \
2324
--edit_threshold ${params.edit_threshold} \
2425
--aggregation_mode ${params.aggregation_mode} \
25-
--output feature_edits.tsv
26+
--output ${base_name}.feature_edits.tsv
2627
"""
2728
}

modules/reditools2.nf

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
process reditools2 {
22
label "reditools2"
3-
publishDir("${params.outdir}/reditools", mode: "copy")
3+
publishDir("${params.outdir}/reditools2", mode: "copy")
44
tag "${meta.id}"
55

66
input:
@@ -9,7 +9,7 @@ process reditools2 {
99
val region
1010

1111
output:
12-
tuple(val(meta), path("edit_table.txt"), emit: tuple_sample_serial_table)
12+
tuple(val(meta), path("*site_edits_reditools2.txt"), emit: tuple_sample_serial_table)
1313

1414
script:
1515

@@ -29,8 +29,9 @@ process reditools2 {
2929
// the reditools error message
3030
strand_orientation = meta.libtype
3131
}
32+
base_name = bam.BaseName
3233

3334
"""
34-
reditools.py -f ${bam} -r ${genome} -s ${strand_orientation} -o edit_table.txt
35+
reditools.py -f ${bam} -r ${genome} -s ${strand_orientation} -o ${base_name}.site_edits_reditools2.txt
3536
"""
3637
}

modules/sapin.nf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ process sapin {
88
path(reference)
99

1010
output:
11-
path("restable.tsv")
11+
path("*.site_edits_sapin.tsv")
1212

1313
script:
14+
base_name = bam.BaseName
1415
"""
15-
sapin -a ${bam} -f ${reference} > restable.tsv
16+
sapin -a ${bam} -f ${reference} > ${base_name}.site_edits_sapin.tsv
1617
"""
1718
}

0 commit comments

Comments
 (0)