-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add bwa #103
Add bwa #103
Changes from all commits
b534001
2c68395
881595e
98c624a
2dc0498
742c430
0030396
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ Author: [email protected] | |
|
||
// Parameters sanity checking | ||
|
||
Set valid_params = ['max_cores', 'cores', 'max_memory', 'memory', 'profile', 'help', 'input', 'input_type', 'list', 'host', 'own', 'control', 'keep', 'rm_rrna', 'bbduk', 'bbduk_kmer', 'bbduk_qin', 'reads_rna', 'min_clip', 'dcs_strict', 'output', 'multiqc_dir', 'nf_runinfo_dir', 'databases', 'cleanup_work_dir','condaCacheDir', 'singularityCacheDir', 'singularityCacheDir', 'cloudProcess', 'conda-cache-dir', 'singularity-cache-dir', 'cloud-process', 'publish_dir_mode', 'no_intermediate', 'skip_qc'] // don't ask me why there is also 'conda-cache-dir', 'singularity-cache-dir', 'cloud-process' | ||
Set valid_params = ['max_cores', 'cores', 'max_memory', 'memory', 'profile', 'help', 'input', 'input_type', 'list', 'host', 'own', 'control', 'keep', 'rm_rrna', 'bwa', 'bbduk', 'bbduk_kmer', 'bbduk_qin', 'reads_rna', 'min_clip', 'dcs_strict', 'output', 'multiqc_dir', 'nf_runinfo_dir', 'databases', 'cleanup_work_dir','condaCacheDir', 'singularityCacheDir', 'singularityCacheDir', 'cloudProcess', 'conda-cache-dir', 'singularity-cache-dir', 'cloud-process', 'publish_dir_mode', 'no_intermediate', 'skip_qc'] // don't ask me why there is also 'conda-cache-dir', 'singularity-cache-dir', 'cloud-process' | ||
def parameter_diff = params.keySet() - valid_params | ||
if (parameter_diff.size() != 0){ | ||
exit 1, "ERROR: Parameter(s) $parameter_diff is/are not valid in the pipeline!\n" | ||
|
@@ -271,6 +271,7 @@ def helpMSG() { | |
Reads are assigned to a combined index for decontamination and keeping. The use of this parameter can prevent | ||
false positive hits and the accidental removal of reads due to (poor quality) mappings. | ||
${c_green}--rm_rrna ${c_reset} Clean your data from rRNA [default: $params.rm_rrna] | ||
${c_green}--bwa${c_reset} Add this flag to use BAW MEM instead of minimap2 for decontamination of short reads [default: $params.bwa] | ||
${c_green}--bbduk${c_reset} Add this flag to use bbduk instead of minimap2 for decontamination of short reads [default: $params.bbduk] | ||
${c_green}--bbduk_kmer${c_reset} Set kmer for bbduk [default: $params.bbduk_kmer] | ||
${c_green}--bbduk_qin${c_reset} Set quality ASCII encoding for bbduk [default: $params.bbduk_qin; options are: 64, 33, auto] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
process { | ||
withLabel: smallTask { container = 'nanozoo/samtools:1.14--d8fb865' } | ||
withLabel: minimap2 { container = 'nanozoo/minimap2:2.26--d9ef6b6' } | ||
withLabel: bbmap { container = 'nanozoo/bbmap:38.79--8e915d7' } | ||
withLabel: multiqc { container = 'nanozoo/multiqc:1.9--aba729b' } | ||
withLabel: fastqc { container = 'nanozoo/fastqc:0.11.9--f61b8b4' } | ||
withLabel: nanoplot { container = 'nanozoo/nanoplot:1.32.0--1ae6f5d' } | ||
withLabel: quast { container = 'nanozoo/quast:5.0.2--e7f0cfe' } | ||
withLabel: bed_samtools { container = 'nanozoo/bed_samtools:2.30.0--cc7d1b9' } | ||
withLabel: seqkit { container = 'nanozoo/seqkit:2.6.1--022e008' } | ||
withLabel: smallTask { container = 'nanozoo/samtools:1.14--d8fb865' } | ||
withLabel: minimap2 { container = 'nanozoo/minimap2:2.26--d9ef6b6' } | ||
withLabel: bwa { container = 'nanozoo/bwa:0.7.18--0eff897' } | ||
withLabel: bbmap { container = 'nanozoo/bbmap:38.79--8e915d7' } | ||
withLabel: multiqc { container = 'nanozoo/multiqc:1.9--aba729b' } | ||
withLabel: fastqc { container = 'nanozoo/fastqc:0.11.9--f61b8b4' } | ||
withLabel: nanoplot { container = 'nanozoo/nanoplot:1.32.0--1ae6f5d' } | ||
withLabel: quast { container = 'nanozoo/quast:5.0.2--e7f0cfe' } | ||
withLabel: bed_samtools { container = 'nanozoo/bed_samtools:2.30.0--cc7d1b9' } | ||
withLabel: seqkit { container = 'nanozoo/seqkit:2.6.1--022e008' } | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
process { | ||
withLabel: minimap2 { cpus = 24; memory = 24.GB } | ||
withLabel: bbmap { cpus = 24; memory = 24.GB } | ||
withLabel: minimap2 { cpus = 24; memory = 24.GB } | ||
withLabel: bwa { cpus = {24 * task.attempt}; memory = {24.GB * task.attempt } ; maxRetries = 3 ; errorStrategy = { task.exitStatus in 130..140 ? 'retry' : 'terminate' } } | ||
withLabel: bbmap { cpus = 24; memory = 24.GB } | ||
withLabel: smallTask { cpus = 1; memory = 2.GB } | ||
withLabel: pysam { cpus = 2; memory = 4.GB } | ||
withLabel: fastqc { cpus = {2 * task.attempt}; memory = {4.GB * task.attempt } ; maxRetries = 3 ; errorStrategy = { task.exitStatus in 130..140 ? 'retry' : 'terminate' } } | ||
withLabel: multiqc { cpus = 4; memory = 4.GB } | ||
withLabel: nanoplot{ cpus = 8; memory = 8.GB } | ||
withLabel: quast{ cpus = 8; memory = 8.GB } | ||
withLabel: pysam { cpus = 2; memory = 4.GB } | ||
withLabel: fastqc { cpus = {2 * task.attempt}; memory = {4.GB * task.attempt } ; maxRetries = 3 ; errorStrategy = { task.exitStatus in 130..140 ? 'retry' : 'terminate' } } | ||
withLabel: multiqc { cpus = 4; memory = 4.GB } | ||
withLabel: nanoplot { cpus = 8; memory = 8.GB } | ||
withLabel: quast { cpus = 8; memory = 8.GB } | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
name: bwa | ||
channels: | ||
- bioconda | ||
- conda-forge | ||
dependencies: | ||
- bwa=0.7.18 | ||
- samtools=1.20 | ||
- htslib=1.20 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
process bwa_index { | ||
label 'bwa' | ||
|
||
input: | ||
path(fasta) | ||
|
||
output: | ||
path(bwa) , emit: index | ||
|
||
script: | ||
""" | ||
mkdir bwa | ||
bwa \\ | ||
index \\ | ||
-p bwa/db \\ | ||
$fasta | ||
""" | ||
|
||
stub: | ||
""" | ||
mkdir bwa | ||
|
||
touch bwa/db.{amb,ann,bwt,pac,sa} | ||
""" | ||
} | ||
|
||
process bwa { | ||
label 'bwa' | ||
|
||
input: | ||
tuple val(name), path(input) | ||
path(db_index) | ||
path(db) | ||
|
||
|
||
output: | ||
tuple val(name), val('raw'), path("${name}.bam"), emit: bam // input just for naming | ||
|
||
script: | ||
""" | ||
INDEX=`find -L ./ -name "*.amb" | sed 's/\\.amb\$//'` | ||
bwa mem \\ | ||
-t $task.cpus \\ | ||
\$INDEX \\ | ||
$input \\ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, for single-end, it would be one fastq file; for paired-end, |
||
| samtools view -bhS -@ $task.cpus > ${name}.bam | ||
""" | ||
stub: | ||
""" | ||
touch ${name}.bam | ||
""" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ nextflow_pipeline { | |
script "../../clean.nf" | ||
|
||
test("Stub") { | ||
tag "minimap2" | ||
options "-stub-run" | ||
|
||
when { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ nextflow_pipeline { | |
script "../../clean.nf" | ||
|
||
test("Stub") { | ||
tag "minimap2" | ||
options "-stub-run" | ||
|
||
when { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't the index passed in as a parameter (db_index)? If you only want to strip off the
.amb
you can use something like:(not tested)
see https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_02
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The BWA processes are copied from nf-core 😇
The index process outputs a folder called
bwa
, and with this line, you find the folder. Maybeamb
is BWA specific? 🤔