Skip to content

Commit

Permalink
add bowtie1
Browse files Browse the repository at this point in the history
  • Loading branch information
Juke34 committed Jan 16, 2025
1 parent c7343c3 commit fe015d7
Show file tree
Hide file tree
Showing 8 changed files with 109 additions and 10 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ You can choose to run one or several aligner in parallel.
| Tool | Single End (short reads) | Paired end (short reads) | Pacbio | ONT |
| --- | --- | --- | --- | --- |
| bbmap ||| ⚠️ | ⚠️ |
| bowtie ||| ⚠️ | ⚠️ |
| bowtie2 ||| ⚠️ | ⚠️ |
| bwaaln || ✅ R1 and R2 independently aligned then merged with bwa sampe |||
| bwamem ||| ⚠️ | ⚠️ |
Expand Down Expand Up @@ -72,6 +73,7 @@ It is then translated to the correct option in the following aligners:
| --- | --- | --- | --- |
| bbmap | xs=fr / xs=ss / xs=us | ISF ISR / OSF OSR / U | strand information |
| bbmap | - / rcs=f / | ISF ISR IU / OSF OSR OU MSF MSR MU | read orientation |
| bowtie | --fr / --rf / --ff | ISF ISR IU / OSF OSR OU / MSF MSR MU| read orientation |
| bowtie2 | --fr / --rf / --ff | ISF ISR IU / OSF OSR OU / MSF MSR MU| read orientation |
| bwaaln | 🚫 | 🚫 | 🚫 |
| bwamem | 🚫 | 🚫 | 🚫 |
Expand Down Expand Up @@ -104,8 +106,9 @@ If the `skip_libray_usage` paramater is set, the information about the library t
If you provide an annotation file the pipeline will pass automatically the file to the following aligner:

| Tool | accept |
| --- | --- |
| bbmap | 🚫 |
| --- | --- |
| bbmap | 🚫 |
| bowtie | 🚫 |
| bowtie2 | 🚫 |
| bwaaln | 🚫 |
| bwamem | 🚫 |
Expand Down
32 changes: 28 additions & 4 deletions aline.nf
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ params.annotation = ""
params.trimming_fastp = false

// Aligner params
align_tools = [ 'bbmap', 'bowtie2', 'bwaaln', 'bwamem', 'bwasw', 'graphmap2', 'hisat2', 'kallisto', 'minimap2', 'novoalign', 'nucmer', 'ngmlr', 'star', 'subread', 'sublong', 'tophat2' ]
align_tools = [ 'bbmap', 'bowtie', 'bowtie2', 'bwaaln', 'bwamem', 'bwasw', 'graphmap2', 'hisat2', 'kallisto', 'minimap2', 'novoalign', 'nucmer', 'ngmlr', 'star', 'subread', 'sublong', 'tophat2' ]
params.aligner = ''
params.bbmap_options = ''
params.bowtie_options = ''
params.bowtie2_options = ''
params.bwaaln_options = ''
params.bwamem_options = ''
Expand Down Expand Up @@ -358,12 +359,13 @@ log.info printAlignerOptions(aligner_list, annotation_file, params.star_index_op
//*************************************************
include {read_length; set_tuple_withUserReadLength} from "$baseDir/modules/bash.nf"
include {bbmap_index; bbmap} from "$baseDir/modules/bbmap.nf"
include {bowtie_index; bowtie} from "$baseDir/modules/bowtie.nf"
include {bowtie2_index; bowtie2} from "$baseDir/modules/bowtie2.nf"
include {bwa_index; bwaaln; bwamem; bwasw} from "$baseDir/modules/bwa.nf"
include {seqkit_convert} from "$baseDir/modules/seqkit.nf"
include {graphmap2_index; graphmap2} from "$baseDir/modules/graphmap2.nf"
include {fastp} from "$baseDir/modules/fastp.nf"
include {fastqc as fastqc_raw; fastqc as fastqc_fastp; fastqc as fastqc_ali_bbmap; fastqc as fastqc_ali_bowtie2 ;
include {fastqc as fastqc_raw; fastqc as fastqc_fastp; fastqc as fastqc_ali_bbmap; fastqc as fastqc_ali_bowtie ; fastqc as fastqc_ali_bowtie2 ;
fastqc as fastqc_ali_bwaaln; fastqc as fastqc_ali_bwamem; fastqc as fastqc_ali_bwasw; fastqc as fastqc_ali_graphmap2 ;
fastqc as fastqc_ali_hisat2; fastqc as fastqc_ali_kallisto; fastqc as fastqc_ali_minimap2; fastqc as fastqc_ali_ngmlr;
fastqc as fastqc_ali_novoalign ; fastqc as fastqc_ali_nucmer; fastqc as fastqc_ali_star; fastqc as fastqc_ali_subread ;
Expand All @@ -376,11 +378,11 @@ include {ngmlr} from "$baseDir/modules/ngmlr.nf"
include {nucmer} from "$baseDir/modules/mummer4.nf"
include {novoalign_index; novoalign} from "$baseDir/modules/novoalign.nf"
include {salmon_index; salmon_guess_lib; set_tuple_withUserLib} from "$baseDir/modules/salmon.nf"
include {samtools_sam2bam_nucmer; samtools_sam2bam as samtools_sam2bam_bowtie2; samtools_sam2bam as samtools_sam2bam_bwaaln;
include {samtools_sam2bam_nucmer; samtools_sam2bam as samtools_sam2bam_bowtie; samtools_sam2bam as samtools_sam2bam_bowtie2; samtools_sam2bam as samtools_sam2bam_bwaaln;
samtools_sam2bam as samtools_sam2bam_bwamem; samtools_sam2bam as samtools_sam2bam_bwasw; samtools_sam2bam as samtools_sam2bam_graphmap2;
samtools_sam2bam as samtools_sam2bam_hisat2; samtools_sam2bam as samtools_sam2bam_minimap2;
samtools_sam2bam as samtools_sam2bam_ngmlr; samtools_sam2bam as samtools_sam2bam_novoalign } from "$baseDir/modules/samtools.nf"
include {samtools_sort as samtools_sort_bbmap; samtools_sort as samtools_sort_bowtie2; samtools_sort as samtools_sort_bwaaln;
include {samtools_sort as samtools_sort_bbmap; samtools_sort as samtools_sort_bowtie; samtools_sort as samtools_sort_bowtie2; samtools_sort as samtools_sort_bwaaln;
samtools_sort as samtools_sort_bwamem; samtools_sort as samtools_sort_bwasw; samtools_sort as samtools_sort_graphmap2;
samtools_sort as samtools_sort_hisat2; samtools_sort as samtools_sort_minimap2; samtools_sort as samtools_sort_ngmlr;
samtools_sort as samtools_sort_novoalign; samtools_sort as samtools_sort_nucmer; samtools_sort as samtools_sort_tophat2;
Expand Down Expand Up @@ -614,6 +616,22 @@ workflow align {
}
}

// ------------------- BOWTIE -----------------
if ( "bowtie" in aligner_list ){ // &&
bowtie_index(genome.collect(), "alignment/bowtie/indicies") // index
bowtie(reads, genome.collect(), bowtie_index.out.collect(), "alignment/bowtie") // align
logs.concat(bowtie.out.bowtie_summary).set{logs} // save log
// convert sam to bam
samtools_sam2bam_bowtie(bowtie.out.tuple_sample_sam)
// sort
samtools_sort_bowtie(samtools_sam2bam_bowtie.out.tuple_sample_bam, "alignment/bowtie")
// stat on aligned reads
if(params.fastqc){
fastqc_ali_bowtie(samtools_sort_bowtie.out.tuple_sample_sortedbam, "fastqc/bowtie", "bowtie")
logs.concat(fastqc_ali_bowtie.out).set{logs} // save log
}
}

// ------------------- BOWTIE2 -----------------
if ( "bowtie2" in aligner_list ){ // &&
bowtie2_index(genome.collect(), "alignment/bowtie2/indicies") // index
Expand Down Expand Up @@ -911,6 +929,7 @@ def helpMSG() {
Aligner specific options
--bbmap_options additional options for bbmap
--bowtie_options additional options for bowtie
--bowtie2_options additional options for bowtie2
--bwaaln_options additional options for bwaaln
--bwamem_options additional options for bwamem
Expand Down Expand Up @@ -943,6 +962,11 @@ def printAlignerOptions(aligner_list, annotation_file, star_index_options) {
bbmap_tool : ${bbmap_tool}
bbmap_options : ${params.bbmap_options}
"""}
if ("bowtie" in aligner_list){
sentence += """
bowtie parameters
bowtie_options : ${params.bowtie_options}
"""}
if ("bowtie2" in aligner_list){
sentence += """
bowtie2 parameters
Expand Down
3 changes: 3 additions & 0 deletions config/softwares.config
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ process {
withLabel: 'bbmap' {
container = 'quay.io/biocontainers/bbmap:39.08--h92535d8_0'
}
withLabel: 'bowtie' {
container = 'quay.io/biocontainers/bowtie:1.3.1--py39h9046dc2_10'
}
withLabel: 'bowtie2' {
container = 'quay.io/biocontainers/bowtie2:2.5.1--py38he00c5e5_2'
}
Expand Down
69 changes: 69 additions & 0 deletions modules/bowtie.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
process bowtie_index {
label 'bowtie'
tag "$genome_fasta"
publishDir "${params.outdir}/${outpath}", mode: 'copy'

input:
path(genome_fasta)
val outpath

output:
path('*.ebwt')

script:

"""
bowtie-build --threads ${task.cpus} $genome_fasta ${genome_fasta.baseName}
"""
}

process bowtie {
label 'bowtie'
tag "$sample"
publishDir "${params.outdir}/${outpath}", pattern: "*bowtie.log", mode: 'copy'

input:
tuple val(sample), path(reads), val(library), val(read_length)
path genome
path index_files
val outpath

output:
tuple val(sample), path ("*.sam"), emit: tuple_sample_sam
path "*bowtie.log", emit: bowtie_summary

script:

def read_orientation=""
if (! params.bowtie_options.contains("--fr ") &&
! params.bowtie_options.contains("--rf ") &&
! params.bowtie_options.contains("--ff ") &&
params.read_type == "short_paired" &&
! params.skip_libray_usage){
if (library.contains("I") ){
read_orientation = "--fr"
} else if (library.contains("O") ){
read_orientation = "--rf"
} else if (library.contains("M") ){
read_orientation = "--ff"
}
}

if (params.read_type == "short_paired"){
"""
bowtie ${params.bowtie_options} ${read_orientation}\\
-p ${task.cpus} \\
-x ${genome.baseName} \\
-S ${reads[0].baseName.replace('.fastq','')}_bowtie.sam \\
-1 ${reads[0]} -2 ${reads[1]} 2> ${reads[0].baseName.replace('.fastq','')}_bowtie.log
"""
} else {
"""
bowtie ${params.bowtie_options} ${read_orientation}\\
-p ${task.cpus} \\
-x ${genome.baseName} \\
-S ${reads} > ${reads.baseName.replace('.fastq','')}_bowtie.sam 2> ${reads.baseName}_bowtie.log
"""
}

}
2 changes: 1 addition & 1 deletion profiles/test_illumina_paired.config
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
params {
reads = "$baseDir/test/illumina/"
genome = "$baseDir/test/yeast.fa"
aligner = 'bbmap,bowtie2,bwaaln,bwamem,bwasw,graphmap2,hisat2,minimap2,nucmer,star,subread,tophat2'
aligner = 'bbmap,bowtie,bowtie2,bwaaln,bwamem,bwasw,graphmap2,hisat2,minimap2,nucmer,star,subread,tophat2'
star_options = "--genomeSAindexNbases 9" // the default 14 is too large for the genome size=1351857
multiqc_config = "$baseDir/config/multiqc_conf.yml"
}
2 changes: 1 addition & 1 deletion profiles/test_illumina_single.config
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ params {
reads = "$baseDir/test/illumina/"
genome = "$baseDir/test/yeast.fa"
params.read_type = "short_single"
aligner = 'bbmap,bowtie2,bwaaln,bwamem,bwasw,graphmap2,hisat2,kallisto,minimap2,ngmlr,nucmer,star,subread,sublong,tophat2'
aligner = 'bbmap,bowtie,bowtie2,bwaaln,bwamem,bwasw,graphmap2,hisat2,kallisto,minimap2,ngmlr,nucmer,star,subread,sublong,tophat2'
trimming_fastp = true
star_options = "--genomeSAindexNbases 9" // the default 14 is too large for the genome size=1351857
multiqc_config = "$baseDir/config/multiqc_conf.yml"
Expand Down
2 changes: 1 addition & 1 deletion profiles/test_ont.config
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ params {
reads = "$baseDir/test/nanopore"
genome = "$baseDir/test/yeast.fa"
read_type = "ont"
aligner = 'bwaaln,bwamem,bwasw,graphmap2,hisat2,kallisto,minimap2,ngmlr,nucmer,star,subread,sublong'
aligner = 'bbmap,bowtie,bowtie2,bwaaln,bwamem,bwasw,graphmap2,hisat2,kallisto,minimap2,ngmlr,nucmer,star,subread,sublong'
library_type = 'U'
star_options = '--outFilterMismatchNmax 100 --seedSearchLmax 30 --seedSearchStartLmax 30 --seedPerReadNmax 100000 --seedPerWindowNmax 100 --alignTranscriptsPerReadNmax 100000 --alignTranscriptsPerWindowNmax 10000'
multiqc_config = "$baseDir/config/multiqc_conf.yml"
Expand Down
2 changes: 1 addition & 1 deletion profiles/test_pacbio.config
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ params {
reads = "$baseDir/test/pacbio/"
genome = "$baseDir/test/yeast.fa"
read_type = "pacbio"
aligner = 'bwaaln,bwamem,bwasw,graphmap2,hisat2,kallisto,minimap2,ngmlr,nucmer,star,subread,sublong'
aligner = 'bbmap,bowtie,bowtie2,bwaaln,bwamem,bwasw,graphmap2,hisat2,kallisto,minimap2,ngmlr,nucmer,star,subread,sublong'
star_options = '--outFilterMismatchNmax 100 --seedSearchLmax 30 --seedSearchStartLmax 30 --seedPerReadNmax 100000 --seedPerWindowNmax 100 --alignTranscriptsPerReadNmax 100000 --alignTranscriptsPerWindowNmax 10000'
star_index_options = '--genomeSAindexNbases 9'
multiqc_config = "$baseDir/config/multiqc_conf.yml"
Expand Down

0 comments on commit fe015d7

Please sign in to comment.