mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-11-10 20:23:10 +00:00
bowtie bam output
This commit is contained in:
parent
0d7c8276b7
commit
f35850bf14
3 changed files with 20 additions and 18 deletions
|
@ -11,15 +11,15 @@ process BOWTIE_ALIGN {
|
||||||
mode: params.publish_dir_mode,
|
mode: params.publish_dir_mode,
|
||||||
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
|
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:meta.id) }
|
||||||
|
|
||||||
conda (params.enable_conda ? "bioconda::bowtie=1.3.0" : null)
|
conda (params.enable_conda ? "bioconda::bowtie=1.3.0 bioconda::samtools=1.10" : null)
|
||||||
container "quay.io/biocontainers/bowtie:1.3.0--py38hed8969a_1"
|
container "quay.io/biocontainers/mulled-v2-ffbf83a6b0ab6ec567a336cf349b80637135bca3:9e14e16c284d6860574cf5b624bbc44c793cb024-0"
|
||||||
|
|
||||||
input:
|
input:
|
||||||
tuple val(meta), path(reads)
|
tuple val(meta), path(reads)
|
||||||
path index
|
path index
|
||||||
|
|
||||||
output:
|
output:
|
||||||
tuple val(meta), path("*.sam"), emit: sam
|
tuple val(meta), path("*.bam"), emit: bam
|
||||||
tuple val(meta), path("*.out"), emit: log
|
tuple val(meta), path("*.out"), emit: log
|
||||||
path "bowtie.version.txt", emit: version
|
path "bowtie.version.txt", emit: version
|
||||||
|
|
||||||
|
@ -27,15 +27,19 @@ process BOWTIE_ALIGN {
|
||||||
def software = getSoftwareName(task.process)
|
def software = getSoftwareName(task.process)
|
||||||
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
|
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
|
||||||
def unaligned = params.save_unaligned ? "--un ${prefix}.unmapped" : ''
|
def unaligned = params.save_unaligned ? "--un ${prefix}.unmapped" : ''
|
||||||
|
def endedness = meta.single_end ? "$reads" : "-1 ${reads[0]} -2 ${reads[1]}"
|
||||||
"""
|
"""
|
||||||
INDEX=`find -L ./ -name "*.3.ebwt" | sed 's/.3.ebwt//'`
|
INDEX=`find -L ./ -name "*.3.ebwt" | sed 's/.3.ebwt//'`
|
||||||
bowtie \\
|
bowtie \\
|
||||||
--threads $task.cpus \\
|
--threads $task.cpus \\
|
||||||
$options.args \\
|
--sam \\
|
||||||
\$INDEX \\
|
-x \$INDEX \\
|
||||||
-q ${reads} \\
|
-q \\
|
||||||
$unaligned \\
|
$unaligned \\
|
||||||
> ${prefix}.sam 2> ${prefix}.out
|
$options.args \\
|
||||||
|
$endedness \\
|
||||||
|
2> ${prefix}.out \\
|
||||||
|
| samtools view $options.args2 -@ $task.cpus -bS -o ${prefix}.bam -
|
||||||
|
|
||||||
bowtie --version | head -n 1 | cut -d" " -f3 > ${software}.version.txt
|
bowtie --version | head -n 1 | cut -d" " -f3 > ${software}.version.txt
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -5,8 +5,6 @@ nextflow.enable.dsl = 2
|
||||||
include { BOWTIE_INDEX } from '../../../software/bowtie/index/main.nf' addParams( options: [:] )
|
include { BOWTIE_INDEX } from '../../../software/bowtie/index/main.nf' addParams( options: [:] )
|
||||||
include { BOWTIE_ALIGN } from '../../../software/bowtie/align/main.nf' addParams( options: [:] )
|
include { BOWTIE_ALIGN } from '../../../software/bowtie/align/main.nf' addParams( options: [:] )
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
workflow test_bowtie_index {
|
workflow test_bowtie_index {
|
||||||
fasta = file("${launchDir}/tests/data/fasta/E_coli/NC_010473.fa", checkIfExists: true)
|
fasta = file("${launchDir}/tests/data/fasta/E_coli/NC_010473.fa", checkIfExists: true)
|
||||||
BOWTIE_INDEX ( fasta )
|
BOWTIE_INDEX ( fasta )
|
||||||
|
@ -19,7 +17,7 @@ workflow test_bowtie_alignment_single_end {
|
||||||
|
|
||||||
def input = []
|
def input = []
|
||||||
input = [ [ id:'test', single_end:true ], // meta map
|
input = [ [ id:'test', single_end:true ], // meta map
|
||||||
[ file("${launchDir}/tests/data/fastq/dna/Ecoli_DNA_R1.fastq.gz", checkIfExists: true) ] ]
|
[ file("${launchDir}/tests/data/fastq/rna/test_R1.fastq.gz", checkIfExists: true) ] ]
|
||||||
BOWTIE_ALIGN ( input, BOWTIE_INDEX.out.index )
|
BOWTIE_ALIGN ( input, BOWTIE_INDEX.out.index )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,8 +27,8 @@ workflow test_bowtie_alignment_paired_end {
|
||||||
|
|
||||||
def input = []
|
def input = []
|
||||||
input = [ [ id:'test', single_end:false ], // meta map
|
input = [ [ id:'test', single_end:false ], // meta map
|
||||||
[ file("${launchDir}/tests/data/fastq/dna/Ecoli_DNA_R1.fastq.gz", checkIfExists: true),
|
[ file("${launchDir}/tests/data/fastq/rna/test_R1.fastq.gz", checkIfExists: true),
|
||||||
file("${launchDir}/tests/data/fastq/dna/Ecoli_DNA_R2.fastq.gz", checkIfExists: true) ] ]
|
file("${launchDir}/tests/data/fastq/rna/test_R2.fastq.gz", checkIfExists: true) ] ]
|
||||||
BOWTIE_ALIGN ( input, BOWTIE_INDEX.out.index )
|
BOWTIE_ALIGN ( input, BOWTIE_INDEX.out.index )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,9 +36,9 @@
|
||||||
- path: output/bowtie/bowtie/NC_010473.index.rev.2.ebwt
|
- path: output/bowtie/bowtie/NC_010473.index.rev.2.ebwt
|
||||||
md5sum: f3c398bba5158f4039334a932d79c051
|
md5sum: f3c398bba5158f4039334a932d79c051
|
||||||
- path: output/bowtie/test.out
|
- path: output/bowtie/test.out
|
||||||
md5sum: 6edce9d0d8ad7f5ce837a5be7e0d7fbe
|
md5sum: a81cb18024616415a6cec3108a36fccd
|
||||||
- path: output/bowtie/test.sam
|
- path: output/bowtie/test.bam
|
||||||
md5sum: acdb36ea915ac2ac71b69a0b704d9d8a
|
md5sum: 8179c68a819accbc9137dc881736106f
|
||||||
|
|
||||||
|
|
||||||
- name: Run bowtie index and align paired_end
|
- name: Run bowtie index and align paired_end
|
||||||
|
@ -60,7 +60,7 @@
|
||||||
- path: output/bowtie/bowtie/NC_010473.index.rev.2.ebwt
|
- path: output/bowtie/bowtie/NC_010473.index.rev.2.ebwt
|
||||||
md5sum: f3c398bba5158f4039334a932d79c051
|
md5sum: f3c398bba5158f4039334a932d79c051
|
||||||
- path: output/bowtie/test.out
|
- path: output/bowtie/test.out
|
||||||
md5sum: 6edce9d0d8ad7f5ce837a5be7e0d7fbe
|
md5sum: a23e9a2a76e949aeb3693bcfae41a615
|
||||||
- path: output/bowtie/test.sam
|
- path: output/bowtie/test.bam
|
||||||
md5sum: d41d8cd98f00b204e9800998ecf8427e
|
md5sum: 9ce5aebf37128f4bb1d24e9548e22009
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue