@@ -2,39 +2,54 @@ process STAR_ALIGN {
22 tag " $meta . id "
33 label ' process_high'
44
5- // Note: 2.7X indices incompatible with AWS iGenomes.
6- conda (params. enable_conda ? " bioconda::star=2.6.1d" : null )
5+ conda (params. enable_conda ? conda_str : null )
76 container " ${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
8- ' https://depot.galaxyproject.org/singularity/star:2.6.1d--0' :
9- ' quay.io/biocontainers/star:2.6.1d--0' } "
7+ " https://depot.galaxyproject.org/singularity/${container_id}" :
8+ " quay.io/biocontainers/${container_id}" } "
109
1110 input:
1211 tuple val(meta), path(reads)
13- path index
14- path gtf
12+ path index
13+ path gtf
14+ val star_ignore_sjdbgtf
15+ val seq_platform
16+ val seq_center
17+ val is_aws_igenome
1518
1619 output:
1720 tuple val(meta), path(' *d.out.bam' ) , emit: bam
1821 tuple val(meta), path(' *Log.final.out' ) , emit: log_final
1922 tuple val(meta), path(' *Log.out' ) , emit: log_out
2023 tuple val(meta), path(' *Log.progress.out' ), emit: log_progress
21- path " versions.yml" , emit: versions
24+ path " versions.yml" , emit: versions
2225
2326 tuple val(meta), path(' *sortedByCoord.out.bam' ) , optional:true , emit: bam_sorted
2427 tuple val(meta), path(' *toTranscriptome.out.bam' ), optional:true , emit: bam_transcript
2528 tuple val(meta), path(' *Aligned.unsort.out.bam' ) , optional:true , emit: bam_unsorted
2629 tuple val(meta), path(' *fastq.gz' ) , optional:true , emit: fastq
2730 tuple val(meta), path(' *.tab' ) , optional:true , emit: tab
31+ tuple val(meta), path(' *.out.junction' ) , optional:true , emit: junction
32+ tuple val(meta), path(' *.out.sam' ) , optional:true , emit: sam
2833
2934 when:
3035 task. ext. when == null || task. ext. when
3136
3237 script:
3338 def args = task. ext. args ?: ' '
3439 def prefix = task. ext. prefix ?: " ${ meta.id} "
35- def ignore_gtf = params. star_ignore_sjdbgtf ? ' ' : " --sjdbGTFfile $gtf "
36- def seq_center = params. seq_center ? " --outSAMattrRGline ID:$prefix 'CN:$params . seq_center ' 'SM:$prefix '" : " --outSAMattrRGline ID:$prefix 'SM:$prefix '"
37- def out_sam_type = (args. contains(' --outSAMtype' )) ? ' ' : ' --outSAMtype BAM Unsorted'
40+
41+ // Note: 2.7X indices incompatible with AWS iGenomes so use older STAR version
42+ conda_str = " bioconda::star=2.7.9a bioconda::samtools=1.13 conda-forge::gawk=5.1.0"
43+ container_id = ' mulled-v2-1fa26d1ce03c295fe2fdcf85831a92fbcbd7e8c2:a7908dfb0485a80ca94e4d17b0ac991532e4e989-0'
44+ if (is_aws_igenome) {
45+ conda_str = " bioconda::star=2.6.1d bioconda::samtools=1.10 conda-forge::gawk=5.1.0"
46+ container_id = ' mulled-v2-1fa26d1ce03c295fe2fdcf85831a92fbcbd7e8c2:59cdd445419f14abac76b31dd0d71217994cbcc9-0'
47+ }
48+
49+ def ignore_gtf = star_ignore_sjdbgtf ? ' ' : " --sjdbGTFfile $gtf "
50+ def seq_platform = seq_platform ? " 'PL:$seq_platform '" : " "
51+ def seq_center = seq_center ? " --outSAMattrRGline ID:$prefix 'CN:$seq_center ' 'SM:$prefix ' $seq_platform " : " --outSAMattrRGline ID:$prefix 'SM:$prefix ' $seq_platform "
52+ def out_sam_type = (args. contains(' --outSAMtype' )) ? ' ' : ' --outSAMtype BAM Unsorted'
3853 def mv_unsorted_bam = (args. contains(' --outSAMtype BAM Unsorted SortedByCoordinate' )) ? " mv ${ prefix} .Aligned.out.bam ${ prefix} .Aligned.unsort.out.bam" : ' '
3954 """
4055 STAR \\
@@ -61,6 +76,8 @@ process STAR_ALIGN {
6176 cat <<-END_VERSIONS > versions.yml
6277 "${ task.process} ":
6378 star: \$ (STAR --version | sed -e "s/STAR_//g")
79+ samtools: \$ (echo \$ (samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$ //')
80+ gawk: \$ (echo \$ (gawk --version 2>&1) | sed 's/^.*GNU Awk //; s/, .*\$ //')
6481 END_VERSIONS
6582 """
6683}
0 commit comments