Skip to content

Commit 4467425

Browse files
authored
Merge pull request #26 from Juke34/jacusa
jacusa2: pass library type and print all sites (including unedited)
2 parents 14d6686 + b782c5c commit 4467425

File tree

1 file changed

+28
-4
lines changed

1 file changed

+28
-4
lines changed

modules/jacusa2.nf

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

1010
output:
11-
path("*.site_edits_jacusa2.txt")
11+
tuple(val(meta), path("*.site_edits_jacusa2.txt"), emit: tuple_sample_jacusa2_table)
1212
path("*.filtered")
13-
// tuple(sample, path("filtered_output.txt", emit: tuple_sample_jacusa2_table))
1413

1514
script:
1615
base_name = bam.BaseName
17-
16+
// Set the strand orientation parameter from the library type parameter
17+
// Terms explained in https://salmon.readthedocs.io/en/latest/library_type.html
18+
if (meta.libtype in ["ISR", "SR"]) {
19+
// First-strand oriented
20+
jacusa_strand_param = "FR_SECONDSTRAND"
21+
} else if (meta.libtype in ["ISF", "SF"]) {
22+
// Second-strand oriented
23+
jacusa_strand_param = "RF_FIRSTSTRAND"
24+
} else if (meta.libtype in ["IU", "U"]) {
25+
// Unstranded
26+
jacusa_strand_param = "UNSTRANDED"
27+
} else {
28+
// Unsupported: Pass the library type string so that it's reported in
29+
// the Jacusa2 error message
30+
jacusa_strand_param = meta.libtype
31+
}
1832
"""
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}
33+
java -Xmx${task.memory.toMega()}M -jar /usr/local/bin/JACUSA_v2.0.4.jar \
34+
call-1 \
35+
-A \
36+
-f V \
37+
-p ${task.cpus} \
38+
-r ${base_name}.site_edits_jacusa2.txt \
39+
-c 1 \
40+
-s \
41+
-R ${genome} \
42+
-P ${jacusa_strand_param} \
43+
${bam}
2044
"""
2145
}

0 commit comments

Comments
 (0)