-
Notifications
You must be signed in to change notification settings - Fork 753
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
New module: fastme #4920
Merged
Merged
New module: fastme #4920
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
ba1fad7
Added main, started creating tests
itrujnara 55a6f6c
Fixed tests
itrujnara 8b65441
Fixed tests again
itrujnara d118d79
Fixed tests, completed meta.yml
itrujnara ed04c7e
Minor lint issue fix
itrujnara 7ca9e7f
Merge branch 'master' into fastme
lrauschning 6f9cc8a
Fix typo
lrauschning 6ab02c8
Renamed initial tree argument, added optional outputs and the associa…
itrujnara e4f8f91
Removed a space in meta.yml
itrujnara 4408b0f
Merge branch 'master' into fastme
itrujnara b04a0cf
Added optional outputs to stub, changed bootstrap test
itrujnara 0d2db60
Merge branch 'fastme' of https://github.com/itrujnara/modules into fa…
itrujnara 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: "fastme" | ||
channels: | ||
- conda-forge | ||
- bioconda | ||
- defaults | ||
dependencies: | ||
- "bioconda::fastme=2.1.6.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,63 @@ | ||
process FASTME { | ||
tag "$infile" | ||
label 'process_medium' | ||
|
||
conda "${moduleDir}/environment.yml" | ||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? | ||
'https://depot.galaxyproject.org/singularity/fastme:2.1.6.1--hec16e2b_1': | ||
'biocontainers/fastme:2.1.6.1--hec16e2b_1' }" | ||
|
||
input: | ||
path infile | ||
path initial_tree | ||
|
||
output: | ||
path "*.nwk" , emit: nwk | ||
path "*_stat.txt" , emit: stats | ||
path "versions.yml" , emit: versions | ||
path "*.matrix.phy" , emit: matrix , optional: true | ||
path "*.bootstrap" , emit: bootstrap , optional: true | ||
|
||
when: | ||
task.ext.when == null || task.ext.when | ||
|
||
script: | ||
def args = task.ext.args ?: '' | ||
def prefix = task.ext.prefix ?: infile | ||
def initarg = initial_tree ? "-u $initial_tree" : '' | ||
def matarg = task.ext.args =~ "-O" ? "-O ${prefix}.matrix.phy" : '' | ||
def bootarg = task.ext.args =~ "-B" ? "-B ${prefix}.bootstrap" : '' | ||
""" | ||
fastme \\ | ||
$args \\ | ||
-i $infile \\ | ||
$initarg \\ | ||
-o ${prefix}.nwk \\ | ||
$matarg \\ | ||
$bootarg \\ | ||
-T $task.cpus | ||
|
||
|
||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
fastme: \$(fastme --version |& sed '1!d ; s/FastME //') | ||
END_VERSIONS | ||
""" | ||
|
||
stub: | ||
def args = task.ext.args ?: '' | ||
def prefix = task.ext.prefix ?: infile | ||
def mat = task.ext.args =~ "-O" ? "touch ${prefix}.matrix.phy" : '' | ||
def boot = task.ext.args =~ "-B" ? "touch ${prefix}.bootstrap" : '' | ||
""" | ||
touch ${prefix}.nwk | ||
touch ${prefix}_stat.txt | ||
$mat | ||
$boot | ||
|
||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
fastme: \$(fastme --version |& sed '1!d ; s/FastME //') | ||
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,56 @@ | ||
--- | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json | ||
name: "fastme" | ||
description: "Distance-based phylogeny with FastME" | ||
keywords: | ||
- phylogenetics | ||
- newick | ||
- minimum_evolution | ||
- distance-based | ||
tools: | ||
- "fastme": | ||
description: "A comprehensive, accurate and fast distance-based phylogeny inference program." | ||
homepage: "http://www.atgc-montpellier.fr/fastme" | ||
documentation: "http://www.atgc-montpellier.fr/fastme/usersguide.php" | ||
tool_dev_url: "https://gite.lirmm.fr/atgc/FastME/" | ||
doi: "10.1093/molbev/msv150" | ||
licence: ["GPL v3"] | ||
args_id: "$args" | ||
|
||
input: | ||
- infile: | ||
type: file | ||
description: MSA or distance matrix in Phylip format | ||
pattern: "*" | ||
# note: I have omitted any specific extension as it is not standardized for those file types | ||
- topo: | ||
type: file | ||
description: Initial tree topology in Newick format | ||
pattern: "*.{nwk,dnd}" | ||
|
||
output: | ||
- versions: | ||
type: file | ||
description: File containing software versions | ||
pattern: "versions.yml" | ||
- nwk: | ||
type: file | ||
description: Final phylogeny in Newick format | ||
pattern: "*.nwk" | ||
- stats: | ||
type: file | ||
description: A text file with the statistics of the phylogeny | ||
pattern: "*_stat.txt" | ||
- matrix: | ||
type: file | ||
description: Optional; the distance matrix in Phylip matrix format; it is generated if the -O option is passed in ext.args, although the provided file name will be overwritten | ||
pattern: "*.matrix.phy" | ||
- bootstrap: | ||
type: file | ||
description: A file containing all bootstrap trees in Newick format; it is generated if the -B option is passed in ext.args (and bootstrap is used), although the provided file name will be overwritten | ||
pattern: "*.bootstrap" | ||
Comment on lines
+44
to
+51
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. Nice! |
||
|
||
authors: | ||
- "@itrujnara" | ||
maintainers: | ||
- "@itrujnara" |
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,8 @@ | ||
process { | ||
withName: "TCOFFEE_SEQREFORMAT" { | ||
ext.args = { "-output phylip_aln" } | ||
} | ||
withName: "FASTME" { | ||
ext.args = { "-p LG -q" } | ||
} | ||
} |
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,128 @@ | ||
nextflow_process { | ||
|
||
name "Test Process FASTME" | ||
script "../main.nf" | ||
process "FASTME" | ||
|
||
tag "modules" | ||
tag "modules_nfcore" | ||
tag "fastme" | ||
tag "tcoffee/seqreformat" | ||
tag "famsa/guidetree" | ||
|
||
test("setoxin - phylip - basic") { | ||
|
||
config "./main.config" | ||
|
||
setup { | ||
run("TCOFFEE_SEQREFORMAT") { | ||
script "../../tcoffee/seqreformat/main.nf" | ||
process { | ||
""" | ||
input[0] = [ [ id: "test" ], | ||
file("https://raw.githubusercontent.com/nf-core/test-datasets/multiplesequencealign/testdata/setoxin.ref", checkIfExists: true) | ||
] | ||
""" | ||
} | ||
} | ||
} | ||
|
||
when { | ||
process { | ||
""" | ||
input[0] = TCOFFEE_SEQREFORMAT.out.formatted_file.collect{ meta, aln -> aln } | ||
input[1] = [] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() } | ||
) | ||
} | ||
} | ||
|
||
test("setoxin - phylip - with_tree") { | ||
|
||
config "./main.config" | ||
|
||
setup { | ||
run("TCOFFEE_SEQREFORMAT") { | ||
script "../../tcoffee/seqreformat/main.nf" | ||
process { | ||
""" | ||
input[0] = [ [ id: "test" ], | ||
file("https://raw.githubusercontent.com/nf-core/test-datasets/multiplesequencealign/testdata/setoxin.ref", checkIfExists: true) | ||
] | ||
""" | ||
} | ||
} | ||
run("FAMSA_GUIDETREE") { | ||
script "../../famsa/guidetree/main.nf" | ||
process { | ||
""" | ||
input[0] = [ [ id: "test" ], | ||
file("https://raw.githubusercontent.com/nf-core/test-datasets/multiplesequencealign/testdata/setoxin.ref", checkIfExists: true) | ||
] | ||
|
||
""" | ||
} | ||
} | ||
} | ||
|
||
when { | ||
process { | ||
""" | ||
input[0] = TCOFFEE_SEQREFORMAT.out.formatted_file.collect{ meta, aln -> aln } | ||
input[1] = FAMSA_GUIDETREE.out.tree.collect{ meta, tree -> tree } | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() } | ||
) | ||
} | ||
|
||
} | ||
|
||
test("setoxin - phylip - bootstrap") { | ||
|
||
config "./optionals.config" | ||
|
||
setup { | ||
run("TCOFFEE_SEQREFORMAT") { | ||
script "../../tcoffee/seqreformat/main.nf" | ||
process { | ||
""" | ||
input[0] = [ [ id: "test" ], | ||
file("https://raw.githubusercontent.com/nf-core/test-datasets/multiplesequencealign/testdata/setoxin.ref", checkIfExists: true) | ||
] | ||
""" | ||
} | ||
} | ||
} | ||
|
||
when { | ||
process { | ||
""" | ||
input[0] = TCOFFEE_SEQREFORMAT.out.formatted_file.collect{ meta, aln -> aln } | ||
input[1] = [] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert process.out.nwk }, | ||
{ assert process.out.matrix }, | ||
{ assert process.out.bootstrap } | ||
) | ||
} | ||
} | ||
} |
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,8 @@ | ||
process { | ||
withName: "TCOFFEE_SEQREFORMAT" { | ||
ext.args = { "-output phylip_aln" } | ||
} | ||
withName: "FASTME" { | ||
ext.args = { "-p LG -q -b 10 -O -B" } | ||
} | ||
} |
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 @@ | ||
fastme: | ||
- "modules/nf-core/fastme/**" |
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.
I think it would be good to add optional output channels at least for the more commonly used optional outputs, in particular the bootstrap supports.