-
Notifications
You must be signed in to change notification settings - Fork 752
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Added parallel version of ltrharvest #4968
Merged
Merged
Changes from all commits
Commits
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json | ||
name: "ltrharvest" | ||
channels: | ||
- conda-forge | ||
- bioconda | ||
- defaults | ||
dependencies: | ||
- "bioconda::ltr_harvest_parallel=1.1" |
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,56 @@ | ||
process LTRHARVEST { | ||
tag "$meta.id" | ||
label 'process_medium' | ||
|
||
conda "${moduleDir}/environment.yml" | ||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? | ||
'https://depot.galaxyproject.org/singularity/ltr_harvest_parallel:1.1--hdfd78af_0': | ||
'biocontainers/ltr_harvest_parallel:1.1--hdfd78af_0' }" | ||
|
||
input: | ||
tuple val(meta), path(fasta) | ||
|
||
output: | ||
tuple val(meta), path("*.gff3") , emit: gff3 | ||
tuple val(meta), path("*.scn") , emit: scn | ||
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}" | ||
""" | ||
LTR_HARVEST_parallel \\ | ||
-seq $fasta \\ | ||
$args \\ | ||
-threads $task.cpus | ||
|
||
mv "${fasta}.harvest.combine.gff3" \\ | ||
"${prefix}.gff3" | ||
|
||
mv "${fasta}.harvest.combine.scn" \\ | ||
"${prefix}.scn" | ||
|
||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
LTR_HARVEST_parallel: \$(LTR_HARVEST_parallel -h | sed -n '/Version/s/Version: //p') | ||
genometools: \$(gt --version | sed '1!d ; s/gt (GenomeTools) //') | ||
END_VERSIONS | ||
""" | ||
|
||
stub: | ||
def args = task.ext.args ?: '' | ||
def prefix = task.ext.prefix ?: "${meta.id}" | ||
""" | ||
touch "${prefix}.gff3" | ||
touch "${prefix}.scn" | ||
|
||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
LTR_HARVEST_parallel: \$(LTR_HARVEST_parallel -h | sed -n '/Version/s/Version: //p') | ||
genometools: \$(gt --version | sed '1!d ; s/gt (GenomeTools) //') | ||
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,59 @@ | ||
--- | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json | ||
name: "ltrharvest" | ||
description: | | ||
Predicts LTR retrotransposons using the parallel version of GenomeTools gt-ltrharvest | ||
utility included in the EDTA toolchain | ||
keywords: | ||
- genomics | ||
- genome | ||
- annotation | ||
- repeat | ||
- transposons | ||
- retrotransposons | ||
tools: | ||
- "LTR_HARVEST_parallel": | ||
description: A Perl wrapper for LTR_harvest | ||
homepage: "https://github.com/oushujun/EDTA/tree/v2.2.0/bin/LTR_HARVEST_parallel" | ||
documentation: "https://github.com/oushujun/EDTA/tree/v2.2.0/bin/LTR_HARVEST_parallel" | ||
tool_dev_url: "https://github.com/oushujun/EDTA/tree/v2.2.0/bin/LTR_HARVEST_parallel" | ||
licence: ["MIT"] | ||
- "gt": | ||
description: "The GenomeTools genome analysis system" | ||
homepage: "https://genometools.org/index.html" | ||
documentation: "https://genometools.org/documentation.html" | ||
tool_dev_url: "https://github.com/genometools/genometools" | ||
doi: "10.1109/TCBB.2013.68" | ||
licence: ["ISC"] | ||
input: | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. `[ id:'sample1' ]` | ||
- fasta: | ||
type: file | ||
description: Input genome fasta | ||
pattern: "*.{fsa,fa,fasta}" | ||
output: | ||
- meta: | ||
type: map | ||
description: | | ||
Groovy Map containing sample information | ||
e.g. `[ id:'sample1' ]` | ||
- versions: | ||
type: file | ||
description: File containing software versions | ||
pattern: "versions.yml" | ||
- gff3: | ||
type: file | ||
description: Predicted LTR candidates in gff3 format | ||
pattern: "*.gff3" | ||
- scn: | ||
type: file | ||
description: Predicted LTR candidates in scn format | ||
pattern: "*.scn" | ||
authors: | ||
- "@GallVp" | ||
maintainers: | ||
- "@GallVp" |
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,60 @@ | ||
nextflow_process { | ||
|
||
name "Test Process LTRHARVEST" | ||
script "../main.nf" | ||
process "LTRHARVEST" | ||
|
||
tag "modules" | ||
tag "modules_nfcore" | ||
tag "ltrharvest" | ||
|
||
test("homo_sapiens-genome_21_fasta") { | ||
|
||
when { | ||
process { | ||
""" | ||
input[0] = [ | ||
[ id:'test' ], | ||
file(params.test_data['homo_sapiens']['genome']['genome_21_fasta'], checkIfExists: true) | ||
] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out.gff3).match("gff3") }, | ||
{ assert path(process.out.scn[0][1]).text.contains("46510803 46520182 9380 46510803 46510940 138 46520042 46520182 141 86.52 0 chr21") }, | ||
{ assert snapshot(path(process.out.versions[0]).text).match("script_versions") } | ||
) | ||
} | ||
|
||
} | ||
|
||
test("homo_sapiens-genome_fasta-stub") { | ||
|
||
options '-stub' | ||
|
||
when { | ||
process { | ||
""" | ||
input[0] = [ | ||
[ id:'test' ], | ||
file(params.test_data['homo_sapiens']['genome']['genome_fasta'], checkIfExists: true) | ||
] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() }, | ||
{ assert snapshot(path(process.out.versions[0]).text).match("stub_versions") } | ||
) | ||
} | ||
|
||
} | ||
|
||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,2 @@ | ||
ltrharvest: | ||
- "modules/nf-core/ltrharvest/**" |
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.
the
stub_versions
andscript_versions
snapshots look the same. I think you can share those snapshots between test cases (.match("versions")
) since the script and stub blocks use the exact same logicThere 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.
it would also be ok to remove this check entirely or loosen it a bit to just check for existence, so you don't need to update the snapshots for minor version bumps... but its fine if you want to be conservative here
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.
Hi @ahvigil
Thank you for the feedback. It is not possible anymore to use the same snapshot name. nf-test doesn't allow that anymore.
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.
ugh thats too bad but it seems you're right: askimed/nf-test#188
however, there is an open issue to provide an opt in for cases like this where it might be useful to remove repetition: askimed/nf-test#197. Hope they can implement something like that!