@@ -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