-
Notifications
You must be signed in to change notification settings - Fork 741
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 coptr module #6935
Merged
Merged
Add coptr module #6935
Changes from all commits
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
dad8548
Initial addition
ramirobarrantes 77c71db
Updated snapshot
ramirobarrantes 0416062
Updated snapshot
ramirobarrantes 9579e60
Updated tests.
ramirobarrantes bcec266
Updated tests.
ramirobarrantes d117ef5
Updated snapshot
ramirobarrantes 03e33ec
removed extra directory creation
ramirobarrantes 0a502b6
Added plugin to only compare bam reads, not header
ramirobarrantes b5da004
Added plugin to only compare bam reads, not header
ramirobarrantes 3a7c330
Added plugin to only compare bam reads, not header
ramirobarrantes 78546ff
Output filename now also contains index id so as to not to repeat fil…
ramirobarrantes 41b1ba3
Updated snapshot
ramirobarrantes 014d1d2
Updated snapshot
ramirobarrantes e3c26af
Added paired end test
ramirobarrantes 786ca40
Added paired end test
ramirobarrantes ad56b3b
Updated tests to deal with bams changing order of reads each time
ramirobarrantes 7d37343
Updated tests to deal with bams changing order of reads each time
ramirobarrantes 01022eb
Updated tests to deal with bams changing order of reads each time
ramirobarrantes eb8364b
Updated tests to deal with bams changing order of reads each time
ramirobarrantes 14457c3
Merge branch 'master' into coptr_map2
jfy133 98faf7a
Updated container used
ramirobarrantes 15f0771
Added number of lines test for review
ramirobarrantes b3f5757
Added number of lines test for review
ramirobarrantes 1becbd0
Updated nft-bam plugin
ramirobarrantes 5f11a65
Updated container
ramirobarrantes 0990246
Updated counting of reads
ramirobarrantes 08e3e90
Updated counting of reads
ramirobarrantes 56825bb
removed
ramirobarrantes b5413b5
updated snapshot
ramirobarrantes 861c997
Updated test and snapshot
ramirobarrantes d36a0dc
Updated test and snapshot
ramirobarrantes d36035e
fixed versions issue
ramirobarrantes 3098168
fixed versions issue
ramirobarrantes 163041c
fixed versions issue
ramirobarrantes a453a1d
fixed versions issue
ramirobarrantes e6da7da
fixed versions issue
ramirobarrantes c52eff1
fixed versions issue
ramirobarrantes 2704cc4
Updated test
ramirobarrantes 463c469
Updated test
ramirobarrantes 4ff3bbc
Updated snapshot
ramirobarrantes f2b04cc
Updated tag
ramirobarrantes ef7c169
Updated tests
ramirobarrantes 1b963eb
Updated tests
ramirobarrantes 7511481
Merge branch 'master' into coptr_map2
itrujnara d5f55e8
Improved descriptions
ramirobarrantes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 ?: '' | ||
ramirobarrantes marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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)}, | ||
ramirobarrantes marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
What is the reason to remove this test?
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.
I changed something and the test broke, but I was going to address this in a separate PR as it's a different module
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.
OK, no problem. There might be some issues with tests as they are currently updating the CI workflow to use shards.