Skip to content
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

Iqtree version bump and output fix #5618

Merged
merged 19 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/nf-core/iqtree/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ channels:
- bioconda
- defaults
dependencies:
- bioconda::iqtree=2.3.0
- bioconda::iqtree=2.3.4
112 changes: 91 additions & 21 deletions modules/nf-core/iqtree/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,87 @@ process IQTREE {

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/iqtree:2.3.0--h21ec9f0_0' :
'biocontainers/iqtree:2.3.0--h21ec9f0_0' }"
'https://depot.galaxyproject.org/singularity/iqtree:2.3.4--h21ec9f0_0' :
'biocontainers/iqtree:2.3.4--h21ec9f0_0' }"

input:
tuple val(meta), path(alignment)
val constant_sites
tuple val(meta), path(alignment), path(tree)
path(tree_te)
path(lmclust)
path(mdef)
path(partitions_equal)
path(partitions_proportional)
path(partitions_unlinked)
path(guide_tree)
path(sitefreq_in)
path(constraint_tree)
path(trees_z)
path(suptree)
path(trees_rf)

output:
tuple val(meta), path("*.treefile") , emit: phylogeny
tuple val(meta), path("*.iqtree") , emit: report
tuple val(meta), path("*.mldist") , emit: mldist, optional: true
tuple val(meta), path("*.ufboot") , emit: bootstrap, optional: true
tuple val(meta), path("*.log") , emit: log
path "versions.yml" , emit: versions
tuple val(meta), path("*.treefile") , emit: phylogeny , optional: true
tuple val(meta), path("*.iqtree") , emit: report , optional: true
tuple val(meta), path("*.mldist") , emit: mldist , optional: true
tuple val(meta), path("*.lmap.svg") , emit: lmap_svg , optional: true
tuple val(meta), path("*.lmap.eps") , emit: lmap_eps , optional: true
tuple val(meta), path("*.lmap.quartetlh"), emit: lmap_quartetlh, optional: true
tuple val(meta), path("*.sitefreq") , emit: sitefreq_out , optional: true
tuple val(meta), path("*.ufboot") , emit: bootstrap , optional: true
tuple val(meta), path("*.state") , emit: state , optional: true
tuple val(meta), path("*.contree") , emit: contree , optional: true
tuple val(meta), path("*.nex") , emit: nex , optional: true
tuple val(meta), path("*.splits") , emit: splits , optional: true
tuple val(meta), path("*.suptree") , emit: suptree , optional: true
tuple val(meta), path("*.alninfo") , emit: alninfo , optional: true
tuple val(meta), path("*.partlh") , emit: partlh , optional: true
tuple val(meta), path("*.siteprob") , emit: siteprob , optional: true
tuple val(meta), path("*.sitelh") , emit: sitelh , optional: true
tuple val(meta), path("*.treels") , emit: treels , optional: true
tuple val(meta), path("*.rate ") , emit: rate , optional: true
tuple val(meta), path("*.mlrate") , emit: mlrate , optional: true
tuple val(meta), path("GTRPMIX.nex") , emit: exch_matrix , optional: true
tuple val(meta), path("*.log") , emit: log
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: ''
def fconst_args = constant_sites ? "-fconst $constant_sites" : ''
def memory = task.memory.toString().replaceAll(' ', '')
def prefix = task.ext.prefix ?: meta.id
def args = task.ext.args ?: ''
def alignment_arg = alignment ? "-s $alignment" : ''
def tree_arg = tree ? "-t $tree" : ''
def tree_te_arg = tree_te ? "-te $tree_te" : ''
def lmclust_arg = lmclust ? "-lmclust $lmclust" : ''
def mdef_arg = mdef ? "-mdef $mdef" : ''
def partitions_equal_arg = partitions_equal ? "-q $partitions_equal" : ''
def partitions_proportional_arg = partitions_proportional ? "-spp $partitions_proportional" : ''
def partitions_unlinked_arg = partitions_unlinked ? "-sp $partitions_unlinked" : ''
def guide_tree_arg = guide_tree ? "-ft $guide_tree" : ''
def sitefreq_in_arg = sitefreq_in ? "-fs $sitefreq_in" : ''
def constraint_tree_arg = constraint_tree ? "-g $constraint_tree" : ''
def trees_z_arg = trees_z ? "-z $trees_z" : ''
def suptree_arg = suptree ? "-sup $suptree" : ''
def trees_rf_arg = trees_rf ? "-rf $trees_rf" : ''
def prefix = task.ext.prefix ?: meta.id
def memory = task.memory.toString().replaceAll(' ', '')
"""
iqtree \\
$fconst_args \\
$args \\
-s $alignment \\
$alignment_arg \\
$tree_arg \\
$tree_te_arg \\
$lmclust_arg \\
$mdef_arg \\
$partitions_equal_arg \\
$partitions_proportional_arg \\
$partitions_unlinked_arg \\
$guide_tree_arg \\
$sitefreq_in_arg \\
$constraint_tree_arg \\
$trees_z_arg \\
$suptree_arg \\
$trees_rf\\
-pre $prefix \\
-nt AUTO \\
-ntmax $task.cpus \\
Expand All @@ -46,11 +99,28 @@ process IQTREE {
stub:
def prefix = task.ext.prefix ?: meta.id
"""
touch ${prefix}.treefile
touch ${prefix}.iqtree
touch ${prefix}.mldist
touch ${prefix}.ufboot
touch ${prefix}.log
touch "${prefix}.treefile"
touch "${prefix}.iqtree"
touch "${prefix}.mldist"
touch "${prefix}.lmap.svg"
touch "${prefix}.lmap.eps"
touch "${prefix}.lmap.quartetlh"
touch "${prefix}.sitefreq"
touch "${prefix}.ufboot"
touch "${prefix}.state"
touch "${prefix}.contree"
touch "${prefix}.nex"
touch "${prefix}.splits"
touch "${prefix}.suptree"
touch "${prefix}.alninfo"
touch "${prefix}.partlh"
touch "${prefix}.siteprob"
touch "${prefix}.sitelh"
touch "${prefix}.treels"
touch "${prefix}.rate"
touch "${prefix}.mlrate"
touch "GTRPMIX.nex"
touch "${prefix}.log"

cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand Down
200 changes: 177 additions & 23 deletions modules/nf-core/iqtree/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,47 +16,201 @@ input:
- meta:
type: map
description: |
Groovy map containing sample information
e.g. [ id: 'test' ]
Groovy map containing sample information for the
alignment/tree file, e.g. [ id: 'test' ]
- alignment:
type: file
description: A FASTA format multiple sequence alignment file
pattern: "*.{fasta,fas,fa,mfa}"
- constant_sites:
type: string
description: Number of constant sites to add,
see iqtree documentation for details
(http://www.iqtree.org/doc/Command-Reference)
output:
- versions:
description: Input alignment file in PHYLIP,
FASTA, NEXUS, CLUSTAL or MSF format (-s)
pattern: "*.{fasta,fas,fa,mfa,phy,aln,nex,nexus,msf}"
- tree:
type: file
description: File containing software versions
pattern: "versions.yml"
description: "File containing one or multiple phylogenetic trees (-t):
- Single tree used e.g. as starting tree for tree search
- Set of trees used e.g. for distance computation, consensus tree construction"
pattern: "*.{tre,tree,treefile,newick,nwk,nex,nexus}"
- tree_te:
type: file
description: "File containing single phylogenetic tree (-te)
Use cases:
- fixed user tree to skip tree search
- ancestral sequence reconstruction"
pattern: "*.{tre,tree,treefile,newick,nwk,nex,nexus}"
- lmclust:
type: file
description: NEXUS file containing taxon clusters
for quartet mapping analysis (-lmclust)
pattern: "*.nex{us}"
- mdef:
type: file
description: NEXUS model file defining new models (-mdef)
pattern: "*.nex{us}"
- partitions_equal:
type: file
description: Partition file for edge-equal partition
model, all partitions share same set of branch lengths (-q)
pattern: "*.{nex,nexus,tre,tree,treefile}"
- partitions_proportional:
type: file
description: Partition file for edge-equal partition
model, all partitions share same set of branch lengths (-spp)
pattern: "*.{nex,nexus,tre,tree,treefile}"
- partitions_unlinked:
type: file
description: Partition file for edge-equal partition
model, all partitions share same set of branch lengths (-sp)
pattern: "*.{nex,nexus,tre,tree,treefile}"
- guide_tree:
type: file
description: File containing guide tree for inference of
site frequency profiles (-ft)
pattern: "*.{nex,nexus,tre,tree,treefile}"
- sitefreq_in:
type: file
description: Site frequency file (-fs)
pattern: "*.sitefreq"
- constraint_tree:
type: file
description: File containing opological constraint tree in
NEWICK format. The constraint tree can be a multifurcating
tree and need not to include all taxa. (-g)
pattern: "*.{nwk,newick}"
- trees_z:
type: file
description: File containing a set of trees for which
log-likelihoods should be computed (-z)
- suptree:
type: file
description: File containing input “target” tree, support
values are extracted from trees passed via -t, and mapped
onto the target tree (-sup)
- trees_rf:
type: file
description: "File containing a second tree set (-rf). Used
for computing the distance to the primary tree set (`tree`)"
pattern: "*.{tre,tree,treefile,newick,nwk,nex,nexus}"
output:
- phylogeny:
type: file
description: A phylogeny in Newick format
pattern: "*.{treefile}"
- bootstrap:
type: file
description: |
A file containing all bootstrap trees,
only generated if bootstrap is on
and the -wbt flag is passed in ext.args
pattern: "*.{ufboot}"
- report:
type: file
description: |
Main report file containing computational
results as well as a textual visualisation
of the final tree.
results as well as a textual visualization
of the final tree
pattern: "*.{iqtree}"
- mldist:
type: file
description: |
File containing the pairwise maximum
likelihood distances as a matrix.
likelihood distances as a matrix
pattern: "*.{mldist}"
- lmap_svg:
type: file
description: |
File containing likelihood mapping analysis
results in .svg format (-lmap/-lmclust)
pattern: "*.lmap.svg"
- lmap_eps:
type: file
description: |
File containing likelihood mapping analysis
results in .eps format (-lmap/-lmclust)
pattern: "*.lmap.eps"
- lmap_quartetlh:
type: file
description: |
File containing quartet log-likelihoods (-wql)
pattern: "*.lmap.quartetlh"
- sitefreq_out:
type: file
description: |
File containing site frequency profiles (-ft)
pattern: "*.sitefreq"
- bootstrap:
type: file
description: |
File containing all bootstrap trees (-wbt/-wbtl)
pattern: "*.ufboot"
- state:
type: file
description: |
File containing ancestral sequences for all
nodes of the tree by empirical Bayesian method (-asr)
pattern: "*.{state}"
- contree:
type: file
description: |
File containing consensus tree (-con/-bb)
pattern: "*.{contree}"
- nex:
type: file
description: |
File containing consensus network (-net/-bb)
pattern: "*.{nex}"
- splits:
type: file
description: |
File containing consensus network in star-dot format (-wsplits)
pattern: "*.{splits}"
- suptree:
type: file
description: |
File containing tree with assigned support
values based on supplied "target" tree (-sup)
pattern: "*.{suptree}"
- alninfo:
type: file
description: |
File containing alignment site statistics (-alninfo)
pattern: "*.{alninfo}"
- partlh:
type: file
description: |
File containing partition log-likelihoods (-wpl)
pattern: "*.{partlh}"
- siteprob:
type: file
description: |
File containing site posterior probabilities (-wspr/-wspm/-wspmr)
pattern: "*.{siteprob}"
- sitelh:
type: file
description: |
File containing site log-likelihoods (-wsl/-wslr/-wslm/-wslmr)
pattern: "*.{sitelh}"
- treels:
type: file
description: |
File containing all locally optimal trees (-wt)
pattern: "*.{treels}"
- rate:
type: file
description: |
File containing inferred site-specific
evolutionary rates (-wsr)
pattern: "*.{rate}"
- mlrate:
type: file
description: |
File containing site-specific subtitution
rates determined by maximum likelihood (--mlrate)
pattern: "*.{mlrate}"
- exch_matrix:
type: file
description: File containing the exchangeability
matrix obtained from the optimization (--link-exchange-rates)
pattern: "GTRPMIX.nex"
- log:
type: file
description: Log file of entire run
pattern: "*.{log}"
- versions:
type: file
description: File containing software versions
pattern: "versions.yml"
authors:
- "@avantonder"
- "@aunderwo"
Expand Down
5 changes: 5 additions & 0 deletions modules/nf-core/iqtree/tests/iqtree_bootstrap.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
process {
withName: "IQTREE" {
ext.args = "-bb 1000 -wbt -wsplits -m LG"
}
}
5 changes: 5 additions & 0 deletions modules/nf-core/iqtree/tests/iqtree_optional.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
process {
withName: "IQTREE" {
ext.args = "-m C10 -asr -alninfo -wpl -wspr -wsl -wsr --mlrate -lmap 150 -wql --mlrate"
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
process {
withName: "IQTREE" {
ext.args = "-bb 1000 -wbt"
ext.args = "-m LG -wt"
}
}
Loading
Loading