diff --git a/src/RNAseq_sen1D.nf b/src/RNAseq_sen1D.nf index 3b79021d9820c22173d1352013776b3d0d41d080..fd47a2d4683100c872cf8c786f50ec5c1eea37cc 100644 --- a/src/RNAseq_sen1D.nf +++ b/src/RNAseq_sen1D.nf @@ -166,7 +166,7 @@ ${reads[0]} ${reads[1]} } /* -* Bowtie2 : +* Bowtie1 : * Imputs : fastq files * Imputs : fasta files * Output : bam files @@ -195,9 +195,9 @@ process index_fasta { script: """ -bowtie2-build --threads ${task.cpus} ${fasta} ${fasta.baseName}.index &> ${fasta.baseName}_bowtie2_report.txt +bowtie-build --threads ${task.cpus} -f ${fasta} ${fasta.baseName}.index &> ${fasta.baseName}_bowtie_report.txt -if grep -q "Error" ${fasta.baseName}_bowtie2_report.txt; then +if grep -q "Error" ${fasta.baseName}_bowtie_report.txt; then exit 1 fi """ @@ -210,7 +210,7 @@ fi process mapping_fastq { tag "$pair_id" cpus 4 - publishDir "results/mapping/bams/", mode: 'copy' + publishDir "results/mapping_bowtie1/bams/", mode: 'copy' input: set pair_id, file(reads) from fastq_files_align @@ -218,22 +218,24 @@ process mapping_fastq { output: set pair_id, "*.bam" into bam_files - file "*_bowtie2_report.txt" into mapping_fastq_report + file "*_bowtie1_report.txt" into mapping_fastq_report script: index_id = index[0] for (index_file in index) { - if (index_file =~ /.*\.1\.bt2/ && !(index_file =~ /.*\.rev\.1\.bt2/) ) { - index_id = ( index_file =~ /(.*)\.1\.bt2/)[0][1] + if (index_file =~ /.*\.1\.ebwt/) { + index_id = ( index_file =~ /(.*)\.1\.ebwt/)[0][1] } } """ - bowtie2 --very-sensitive -p ${task.cpus} -x ${index_id} \ - -1 ${reads[0]} -2 ${reads[1]} 2> \ - ${pair_id}_bowtie2_report.txt | \ - samtools view -Sb - > ${pair_id}.bam - -if grep -q "Error" ${pair_id}_bowtie2_report.txt; then +# -v specify the max number of missmatch, -k the number of match reported per +# reads +bowtie --best -v 3 -k 1 --sam -p ${task.cpus} ${index_id} \ +-1 ${reads[0]} -2 ${reads[1]} 2> \ +${pair_id}_bowtie_report.txt | \ +samtools view -Sb - > ${pair_id}.bam + +if grep -q "Error" ${pair_id}_bowtie_report.txt; then exit 1 fi """