-
Notifications
You must be signed in to change notification settings - Fork 741
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Initial addition * Updated snapshot * Updated snapshot * Updated tests. * Updated tests. * Updated snapshot * removed extra directory creation * Added plugin to only compare bam reads, not header * Added plugin to only compare bam reads, not header * Added plugin to only compare bam reads, not header * Output filename now also contains index id so as to not to repeat filenames * Updated snapshot * Updated snapshot * Added paired end test * Added paired end test * Updated tests to deal with bams changing order of reads each time * Updated tests to deal with bams changing order of reads each time * Updated tests to deal with bams changing order of reads each time * Updated tests to deal with bams changing order of reads each time * Updated container used * Added number of lines test for review * Added number of lines test for review * Updated nft-bam plugin * Updated container * Updated counting of reads * Updated counting of reads * removed * updated snapshot * Updated test and snapshot * Updated test and snapshot * fixed versions issue * fixed versions issue * fixed versions issue * fixed versions issue * fixed versions issue * fixed versions issue * Updated test * Updated test * Updated snapshot * Updated tag * Updated tests * Updated tests * Improved descriptions --------- Co-authored-by: James A. Fellows Yates <jfy133@gmail.com> Co-authored-by: Igor Trujnara <53370556+itrujnara@users.noreply.github.com>
- Loading branch information
1 parent
af27a50
commit 367a163
Showing
9 changed files
with
333 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json | ||
channels: | ||
- conda-forge | ||
- bioconda | ||
dependencies: | ||
- "bioconda::coptr=1.1.4" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
process COPTR_MAP { | ||
tag "$meta.id" | ||
label 'process_low' | ||
|
||
conda "${moduleDir}/environment.yml" | ||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? | ||
'https://depot.galaxyproject.org/singularity/coptr:1.1.4--pyhdfd78af_3': | ||
'biocontainers/coptr:1.1.4--pyhdfd78af_3' }" | ||
|
||
input: | ||
tuple val(meta), path(fasta, stageAs: "fastafolder/*") | ||
tuple val(meta2), path(index) | ||
|
||
output: | ||
tuple val(meta), path("*.bam"), emit: bam | ||
path "versions.yml" , emit: versions | ||
|
||
when: | ||
task.ext.when == null || task.ext.when | ||
|
||
script: | ||
def args = task.ext.args ?: '' | ||
def prefix = task.ext.prefix ?: "${meta.id}" | ||
def prefix2 = task.ext.prefix ?: "${meta2.id}" | ||
|
||
def paired_end = "" | ||
if ( ! meta.single_end ) { | ||
paired_end = "--paired" | ||
} | ||
""" | ||
INDEX=`find -L ./ -name "*.rev.1.bt2" | sed "s/\\.rev.1.bt2\$//"` | ||
[ -z "\$INDEX" ] && INDEX=`find -L ./ -name "*.rev.1.bt2l" | sed "s/\\.rev.1.bt2l\$//"` | ||
[ -z "\$INDEX" ] && echo "Bowtie2 index files not found" 1>&2 && exit 1 | ||
coptr \ | ||
map \ | ||
$args $paired_end \ | ||
--threads $task.cpus \ | ||
\$INDEX \ | ||
fastafolder \ | ||
. | ||
mv ${prefix}.bam ${prefix}_${prefix2}.bam | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
coptr: \$(coptr |& sed -E '11!d ; s/CoPTR.*?\\(v(.*?)\\).*/\\1/') | ||
END_VERSIONS | ||
""" | ||
|
||
stub: | ||
def args = task.ext.args ?: '' | ||
def prefix = task.ext.prefix ?: "${meta.id}" | ||
""" | ||
touch ${prefix}.bam | ||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
coptr: \$(coptr |& sed -E '11!d ; s/CoPTR.*?\\(v(.*?)\\).*/\\1/') | ||
END_VERSIONS | ||
""" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
--- | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json | ||
name: "coptr_map" | ||
description: Maps the reads to the reference database | ||
keywords: | ||
- coptr | ||
- mapping | ||
- ptr | ||
tools: | ||
- "coptr": | ||
description: "Accurate and robust inference of microbial growth dynamics from | ||
metagenomic sequencing reads." | ||
homepage: "https://github.com/tyjo/coptr" | ||
documentation: "https://coptr.readthedocs.io/" | ||
tool_dev_url: "https://github.com/tyjo/coptr" | ||
doi: "10.1101/gr.275533.121" | ||
licence: ["GPL v3"] | ||
identifier: biotools:coptr | ||
|
||
input: | ||
- - meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. `[ id:'sample1', single_end:false ]` | ||
- fasta: | ||
type: file | ||
description: fastq file with reads | ||
pattern: "*.{.fastq,.fq,.fastq.gz,fq.gz}" | ||
ontologies: | ||
- edam: "http://edamontology.org/format_1929" | ||
- - meta2: | ||
type: map | ||
description: | | ||
Groovy Map containing index genome id and path | ||
e.g. [ id:'test', 'bowtie2' ] | ||
- index: | ||
type: file | ||
description: Directory with Bowtie2 genome index files | ||
pattern: "*.ebwt" | ||
|
||
output: | ||
- bam: | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. `[ id:'sample1', single_end:false ]` | ||
- "*.bam": | ||
type: file | ||
description: Alignment (BAM) file of reads mapped to the reference database | ||
pattern: "*.{bam}" | ||
ontologies: | ||
- edam: "http://edamontology.org/format_2572" | ||
- versions: | ||
- "versions.yml": | ||
type: file | ||
description: File containing software versions | ||
pattern: "versions.yml" | ||
authors: | ||
- "@ramirobarrantes" | ||
maintainers: | ||
- "@ramirobarrantes" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
nextflow_process { | ||
|
||
name "Test Process COPTR_MAP" | ||
script "../main.nf" | ||
process "COPTR_MAP" | ||
|
||
tag "modules" | ||
tag "modules_nfcore" | ||
tag "coptr" | ||
tag "coptr/index" | ||
tag "coptr/map" | ||
|
||
setup { | ||
run("COPTR_INDEX") { | ||
script "../../index/main.nf" | ||
process { | ||
""" | ||
input[0] = [ | ||
[id:'test_0'], | ||
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) | ||
] | ||
""" | ||
} | ||
} | ||
} | ||
|
||
test("sarscov2 - single end test") { | ||
|
||
when { | ||
process { | ||
""" | ||
input[0] = [ | ||
[ id:'test_1', single_end: true ], | ||
file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/fastq/test_1.fastq.gz", checkIfExists: true) | ||
] | ||
input[1] = COPTR_INDEX.out.index_dir | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot( | ||
process.out.bam.collect{bam(it[1]).getReads(10)}, | ||
process.out.bam.collect{bam(it[1]).getStatistics(include:["readCount"])}, | ||
process.out.versions | ||
).match() } | ||
) | ||
} | ||
} | ||
|
||
test("sarscov2 - paired end") { | ||
|
||
when { | ||
process { | ||
""" | ||
input[0] = [ | ||
[ id:'test', single_end: false ], | ||
[ | ||
file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/fastq/test_1.fastq.gz", checkIfExists: true), | ||
file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/fastq/test_2.fastq.gz", checkIfExists: true) | ||
] | ||
] | ||
input[1] = COPTR_INDEX.out.index_dir | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot( | ||
process.out.bam.collect{bam(it[1]).getStatistics(include:["readCount"])}, | ||
process.out.versions | ||
).match() } | ||
) | ||
} | ||
} | ||
|
||
|
||
test("sarscov2 - single end - stub") { | ||
|
||
options "-stub" | ||
|
||
when { | ||
process { | ||
""" | ||
input[0] = [ | ||
[ id:'test', single_end: true ], | ||
file(params.modules_testdata_base_path + "genomics/sarscov2/illumina/fastq/test_1.fastq.gz", checkIfExists: true) | ||
] | ||
input[1] = COPTR_INDEX.out.index_dir | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() } | ||
) | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.