Skip to content
Snippets Groups Projects
Commit ff033f30 authored by Xavier Grand's avatar Xavier Grand
Browse files

add STAR and HTseq to RNAseq_XGR.nf

parent 2b2b50b9
No related branches found
No related tags found
No related merge requests found
......@@ -151,6 +151,7 @@ workflow {
Channel
.fromPath( idx_genome )
.ifEmpty { error "Cannot find idexed genome reference files" }
.map{it -> [(it.baseName =~ /([^\.]*)/)[0][1], it]}
.set { genome_indexed_input }
mapping_withindex(genome_indexed_input, fastp.out.fastq)
}
......
......@@ -181,6 +181,59 @@ STAR --runThreadN ${task.cpus} \
--outSAMstrandField intronMotif \
--chimOutType WithinBAM
mv ${reads_id}.Aligned.sortedByCoord.out.bam ${reads_id}.bam
"""
}
process mapping_withindex {
container = "${container_url}"
label "big_mem_multi_cpus"
if (params.star_mapping_fastq_out != "") {
publishDir "results/${params.star_mapping_fastq_out}", mode: 'copy'
}
input:
tuple val(index_id), path(index)
tuple val(reads_id), path(reads)
output:
path "*.Log.final.out", emit: report
tuple val(reads_id), path("*.bam"), emit: bam
script:
if (reads_id instanceof List){
file_prefix = reads_id[0]
} else {
file_prefix = reads_id
}
if (reads.size() == 2)
"""
STAR --runThreadN ${task.cpus} \
--genomeDir index/ \
--readFilesCommand zcat \
--readFilesIn ${reads[0]} ${reads[1]} \
--outFileNamePrefix ${reads_id}. \
--alignIntronMax 10000 \
--outSAMtype BAM SortedByCoordinate \
--outSAMstrandField intronMotif
mv ${reads_id}.Aligned.sortedByCoord.out.bam ${reads_id}.bam
"""
else
"""
mkdir -p index
mv ${index} index/
STAR --runThreadN ${task.cpus} \
--genomeDir index/ \
--readFilesCommand zcat \
--readFilesIn ${reads} \
--outFileNamePrefix ${reads_id}. \
--alignIntronMax 10000 \
--outSAMtype BAM SortedByCoordinate \
--outSAMstrandField intronMotif
mv ${reads_id}.Aligned.sortedByCoord.out.bam ${reads_id}.bam
"""
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment