@@ -3,101 +3,56 @@ process {
33 // STAR alignment configuration
44 // Conditionals for when these processes run are handled in the workflow
55
6- withName : ' .*:ALIGN_STAR:STAR_ALIGN' {
6+ withName : ' .*:ALIGN_STAR:STAR_ALIGN|.*:ALIGN_STAR:STAR_ALIGN_IGENOMES|.*:ALIGN_STAR:SENTIEON_STAR_ALIGN|.*:ALIGN_STAR:PARABRICKS_RNA_FQ2BAM ' {
77 ext. args = {
8- def quantifier = params. aligner == ' star_rsem' ? ' rsem' : ' salmon'
8+ def isPbrun = task. process. contains(' PARABRICKS' )
9+ def isBaseStarAlign = task. process. endsWith(' :STAR_ALIGN' )
10+ def args = []
911
10- // Common args
11- def args = [
12- ' --quantMode TranscriptomeSAM' ,
13- ' --outSAMtype BAM Unsorted' ,
14- ' --outSAMattributes NH HI AS NM MD' ,
15- ' --readFilesCommand zcat'
16- ]
17-
18- // Add quantifier-specific args
19- if (quantifier == ' rsem' ) {
20- args + = [
21- ' --outSAMunmapped Within' ,
22- ' --outFilterType BySJout' ,
23- ' --outFilterMultimapNmax 20' ,
24- ' --outFilterMismatchNmax 999' ,
25- ' --outFilterMismatchNoverLmax 0.04' ,
26- ' --alignIntronMin 20' ,
27- ' --alignIntronMax 1000000' ,
28- ' --alignMatesGapMax 1000000' ,
29- ' --alignSJoverhangMin 8' ,
30- ' --alignSJDBoverhangMin 1' ,
31- ' --sjdbScore 1'
32- ]
33- } else {
34- args + = [
35- ' --twopassMode Basic' ,
36- ' --runRNGseed 0' ,
37- ' --outFilterMultimapNmax 20' ,
38- ' --alignSJDBoverhangMin 1' ,
39- ' --outSAMstrandField intronMotif' ,
40- ' --quantTranscriptomeSAMoutput BanSingleEnd'
41- ]
42- }
43-
44- if (params. save_unaligned || params. contaminant_screening) {
45- args + = [' --outReadsUnmapped Fastx' ]
46- }
47-
48- // For prokaryotic data, use CDS features and disable spliced alignment
49- if (params. prokaryotic) {
50- args + = [' --sjdbGTFfeatureExon CDS' , ' --alignIntronMax 1' ]
51- }
52-
53- if (params. extra_star_align_args) {
54- args + = [params. extra_star_align_args]
55- }
56-
57- args. join(' ' )
58- }
59- }
12+ // Native STAR processes need explicit STAR args; pbrun handles these internally
13+ if (! isPbrun) {
14+ def quantifier = params. aligner == ' star_rsem' ? ' rsem' : ' salmon'
6015
61- withName : ' .*:ALIGN_STAR:STAR_ALIGN_IGENOMES|.*:ALIGN_STAR:SENTIEON_STAR_ALIGN' {
62- ext. args = {
63- def quantifier = params. aligner == ' star_rsem' ? ' rsem' : ' salmon'
64-
65- // Common args
66- def args = [
67- ' --quantMode TranscriptomeSAM' ,
68- ' --outSAMtype BAM Unsorted' ,
69- ' --outSAMattributes NH HI AS NM MD' ,
70- ' --readFilesCommand zcat'
71- ]
72-
73- // Add quantifier-specific args
74- if (quantifier == ' rsem' ) {
16+ // Common args
7517 args + = [
76- ' --outSAMunmapped Within' ,
77- ' --outFilterType BySJout' ,
78- ' --outFilterMultimapNmax 20' ,
79- ' --outFilterMismatchNmax 999' ,
80- ' --outFilterMismatchNoverLmax 0.04' ,
81- ' --alignIntronMin 20' ,
82- ' --alignIntronMax 1000000' ,
83- ' --alignMatesGapMax 1000000' ,
84- ' --alignSJoverhangMin 8' ,
85- ' --alignSJDBoverhangMin 1' ,
86- ' --sjdbScore 1'
18+ ' --quantMode TranscriptomeSAM' ,
19+ ' --outSAMtype BAM Unsorted' ,
20+ ' --outSAMattributes NH HI AS NM MD' ,
21+ ' --readFilesCommand zcat'
8722 ]
88- } else {
89- args + = [
90- ' --twopassMode Basic' ,
91- ' --runRNGseed 0' ,
92- ' --outFilterMultimapNmax 20' ,
93- ' --alignSJDBoverhangMin 1' ,
94- ' --outSAMstrandField intronMotif' ,
95- ' --quantTranscriptomeBan Singleend'
96- ]
97- }
9823
99- if (params. save_unaligned || params. contaminant_screening) {
100- args + = [' --outReadsUnmapped Fastx' ]
24+ // Add quantifier-specific args
25+ if (quantifier == ' rsem' ) {
26+ args + = [
27+ ' --outSAMunmapped Within' ,
28+ ' --outFilterType BySJout' ,
29+ ' --outFilterMultimapNmax 20' ,
30+ ' --outFilterMismatchNmax 999' ,
31+ ' --outFilterMismatchNoverLmax 0.04' ,
32+ ' --alignIntronMin 20' ,
33+ ' --alignIntronMax 1000000' ,
34+ ' --alignMatesGapMax 1000000' ,
35+ ' --alignSJoverhangMin 8' ,
36+ ' --alignSJDBoverhangMin 1' ,
37+ ' --sjdbScore 1'
38+ ]
39+ } else {
40+ args + = [
41+ ' --twopassMode Basic' ,
42+ ' --runRNGseed 0' ,
43+ ' --outFilterMultimapNmax 20' ,
44+ ' --alignSJDBoverhangMin 1' ,
45+ ' --outSAMstrandField intronMotif'
46+ ]
47+ // STAR_ALIGN uses newer flag name; IGENOMES/SENTIEON use older STAR version flag
48+ args + = isBaseStarAlign
49+ ? [' --quantTranscriptomeSAMoutput BanSingleEnd' ]
50+ : [' --quantTranscriptomeBan Singleend' ]
51+ }
52+
53+ if (params. save_unaligned || params. contaminant_screening) {
54+ args + = [' --outReadsUnmapped Fastx' ]
55+ }
10156 }
10257
10358 // For prokaryotic data, use CDS features and disable spliced alignment
@@ -111,9 +66,7 @@ process {
11166
11267 args. join(' ' )
11368 }
114- }
11569
116- withName : ' .*:ALIGN_STAR:STAR_ALIGN|.*:ALIGN_STAR:STAR_ALIGN_IGENOMES|.*:ALIGN_STAR:SENTIEON_STAR_ALIGN' {
11770 publishDir = [
11871 [
11972 path : { " ${ params.outdir} /${ params.aligner} /log" },
0 commit comments