[med-svn] [Git][med-team/q2-phylogeny][upstream] New upstream version 2024.2.0
Andreas Tille (@tille)
gitlab at salsa.debian.org
Sun Feb 18 14:25:28 GMT 2024
Andreas Tille pushed to branch upstream at Debian Med / q2-phylogeny
Commits:
2af927ae by Andreas Tille at 2024-02-18T15:15:50+01:00
New upstream version 2024.2.0
- - - - -
8 changed files:
- .github/workflows/ci-dev.yaml
- README.md
- q2_phylogeny/_fasttree.py
- q2_phylogeny/_iqtree.py
- q2_phylogeny/_raxml.py
- q2_phylogeny/_version.py
- q2_phylogeny/plugin_setup.py
- q2_phylogeny/tests/test_iqtree.py
Changes:
=====================================
.github/workflows/ci-dev.yaml
=====================================
@@ -9,4 +9,4 @@ jobs:
ci:
uses: qiime2/distributions/.github/workflows/lib-ci-dev.yaml at dev
with:
- distro: core
\ No newline at end of file
+ distro: amplicon
\ No newline at end of file
=====================================
README.md
=====================================
@@ -1,5 +1,5 @@
# q2-phylogeny
-![](https://github.com/qiime2/q2-phylogeny/workflows/ci/badge.svg)
+![](https://github.com/qiime2/q2-phylogeny/workflows/ci-dev/badge.svg)
This is a QIIME 2 plugin. For details on QIIME 2, see https://qiime2.org.
\ No newline at end of file
=====================================
q2_phylogeny/_fasttree.py
=====================================
@@ -38,7 +38,7 @@ def fasttree(alignment: AlignedDNAFASTAFormat,
cmd = ['FastTree']
else:
env = os.environ.copy()
- if n_threads == 'auto':
+ if n_threads == 0:
env.pop('OMP_NUM_THREADS', 0)
else:
env.update({'OMP_NUM_THREADS': str(n_threads)})
=====================================
q2_phylogeny/_iqtree.py
=====================================
@@ -74,13 +74,15 @@ def _build_iqtree_command(
'-m', str(substitution_model),
'-pre', str(run_prefix)]
- if n_cores == 'auto' and n_cores_max:
- cmd += ['-nt', 'AUTO', '--threads-max', '%i' % n_cores_max]
- elif n_cores == 'auto' and n_cores_max is None:
+ if n_cores == 0:
cmd += ['-nt', 'AUTO']
else:
+ print('n cores', n_cores)
cmd += ['-nt', '%i' % n_cores]
+ if n_cores_max is not None and n_cores_max > 0:
+ cmd += ['--threads-max', '%i' % n_cores_max]
+
if seed:
cmd += ['-seed', '%i' % seed]
@@ -216,13 +218,14 @@ def _build_iqtree_ufbs_command(
'-m', str(substitution_model),
'-pre', str(run_prefix)]
- if n_cores == 'auto' and n_cores_max:
- cmd += ['-nt', 'AUTO', '--threads-max', '%i' % n_cores_max]
- elif n_cores == 'auto' and n_cores_max is None:
+ if n_cores == 0:
cmd += ['-nt', 'AUTO']
else:
cmd += ['-nt', '%i' % n_cores]
+ if n_cores_max is not None and n_cores_max > 0:
+ cmd += ['--threads-max', '%i' % n_cores_max]
+
if seed:
cmd += ['-seed', '%i' % seed]
=====================================
q2_phylogeny/_raxml.py
=====================================
@@ -14,6 +14,7 @@ from random import randint
from q2_types.feature_data import AlignedDNAFASTAFormat
from q2_types.tree import NewickFormat
+from qiime2.plugin import get_available_cores
_raxml_versions = {
'Standard': '',
@@ -35,6 +36,9 @@ def run_command(cmd, verbose=True):
def _set_raxml_version(raxml_version='Standard', n_threads=1):
+ if n_threads == 0:
+ n_threads = get_available_cores()
+
if n_threads == 1:
cmd = ['raxmlHPC' + _raxml_versions[raxml_version]]
return cmd
=====================================
q2_phylogeny/_version.py
=====================================
@@ -23,9 +23,9 @@ def get_keywords():
# setup.py/versioneer.py will grep for the variable names, so they must
# each be defined on a line of their own. _version.py will just call
# get_keywords().
- git_refnames = " (tag: 2023.9.0, Release-2023.9)"
- git_full = "3f6beeea0d4c1510daf772f75a05d6fc95a1f37a"
- git_date = "2023-10-03 22:01:55 +0000"
+ git_refnames = " (tag: 2024.2.0, Release-2024.2)"
+ git_full = "f0ffa35ea1132d9eb7a26bb23510521a020ec463"
+ git_date = "2024-02-16 21:58:36 +0000"
keywords = {"refnames": git_refnames, "full": git_full, "date": git_date}
return keywords
=====================================
q2_phylogeny/plugin_setup.py
=====================================
@@ -7,7 +7,7 @@
# ----------------------------------------------------------------------------
from qiime2.plugin import (Plugin, Citations, Int, Range, Str, Choices, Bool,
- Float, List, TypeMatch, Metadata)
+ Float, List, TypeMatch, Metadata, Threads)
from q2_types.tree import Phylogeny, Unrooted, Rooted
from q2_types.feature_data import FeatureData, AlignedSequence, Sequence
from q2_types.feature_table import (FeatureTable, Frequency,
@@ -104,7 +104,7 @@ plugin.methods.register_function(
plugin.methods.register_function(
function=q2_phylogeny.fasttree,
inputs={'alignment': FeatureData[AlignedSequence]},
- parameters={'n_threads': Int % Range(1, None) | Str % Choices(['auto'])},
+ parameters={'n_threads': Threads},
outputs=[('tree', Phylogeny[Unrooted])],
input_descriptions={
'alignment': ('Aligned sequences to be used for phylogenetic '
@@ -132,7 +132,7 @@ plugin.methods.register_function(
parameters={
'seed': Int,
'n_searches': Int % Range(1, None),
- 'n_threads': Int % Range(1, None),
+ 'n_threads': Threads,
'substitution_model': Str % Choices(_RAXML_MODEL_OPT),
'raxml_version': Str % Choices(_RAXML_VERSION_OPT)},
outputs=[('tree', Phylogeny[Unrooted])],
@@ -171,7 +171,7 @@ plugin.methods.register_function(
'seed': Int,
'rapid_bootstrap_seed': Int,
'bootstrap_replicates': Int % Range(10, None),
- 'n_threads': Int % Range(1, None),
+ 'n_threads': Threads,
'substitution_model': Str % Choices(_RAXML_MODEL_OPT),
'raxml_version': Str % Choices(_RAXML_VERSION_OPT)},
outputs=[('tree', Phylogeny[Unrooted])],
@@ -212,8 +212,8 @@ plugin.methods.register_function(
inputs={'alignment': FeatureData[AlignedSequence]},
parameters={
'seed': Int,
- 'n_cores': Int % Range(1, None) | Str % Choices(['auto']),
- 'n_cores_max': Int % Range(2, None),
+ 'n_cores': Threads,
+ 'n_cores_max': Threads,
'n_runs': Int % Range(1, None),
'substitution_model': Str % Choices(_IQTREE_DNA_MODELS),
'n_init_pars_trees': Int % Range(1, None),
@@ -297,8 +297,8 @@ plugin.methods.register_function(
inputs={'alignment': FeatureData[AlignedSequence]},
parameters={
'seed': Int,
- 'n_cores': Int % Range(1, None) | Str % Choices(['auto']),
- 'n_cores_max': Int % Range(2, None),
+ 'n_cores': Threads,
+ 'n_cores_max': Threads,
'n_runs': Int % Range(1, None),
'substitution_model': Str % Choices(_IQTREE_DNA_MODELS),
'n_init_pars_trees': Int % Range(1, None),
@@ -495,7 +495,7 @@ plugin.pipelines.register_function(
'sequences': FeatureData[Sequence],
},
parameters={
- 'n_threads': Int % Range(1, None) | Str % Choices(['auto']),
+ 'n_threads': Threads,
'mask_max_gap_frequency': Float % Range(0, 1, inclusive_end=True),
'mask_min_conservation': Float % Range(0, 1, inclusive_end=True),
'parttree': Bool,
@@ -568,7 +568,7 @@ plugin.pipelines.register_function(
'sequences': FeatureData[Sequence],
},
parameters={
- 'n_threads': Int % Range(1, None) | Str % Choices(['auto']),
+ 'n_threads': Threads,
'mask_max_gap_frequency': Float % Range(0, 1, inclusive_end=True),
'mask_min_conservation': Float % Range(0, 1, inclusive_end=True),
'seed': Int,
@@ -659,7 +659,7 @@ plugin.pipelines.register_function(
'sequences': FeatureData[Sequence],
},
parameters={
- 'n_threads': Int % Range(1, None) | Str % Choices(['auto']),
+ 'n_threads': Threads,
'mask_max_gap_frequency': Float % Range(0, 1, inclusive_end=True),
'mask_min_conservation': Float % Range(0, 1, inclusive_end=True),
'parttree': Bool,
=====================================
q2_phylogeny/tests/test_iqtree.py
=====================================
@@ -103,7 +103,7 @@ class IqtreeTests(TestPluginBase):
input_sequences = AlignedDNAFASTAFormat(input_fp, mode='r')
with redirected_stdio(stderr=os.devnull):
- obs = iqtree(input_sequences, n_cores='auto')
+ obs = iqtree(input_sequences, n_cores=0)
obs_tree = skbio.TreeNode.read(str(obs), convert_underscores=False)
# load the resulting tree and test that it has the right number of
@@ -122,7 +122,7 @@ class IqtreeTests(TestPluginBase):
input_sequences = AlignedDNAFASTAFormat(input_fp, mode='r')
with redirected_stdio(stderr=os.devnull):
- obs = iqtree(input_sequences, n_cores='auto', n_cores_max=2)
+ obs = iqtree(input_sequences, n_cores=0, n_cores_max=2)
obs_tree = skbio.TreeNode.read(str(obs), convert_underscores=False)
# load the resulting tree and test that it has the right number of
@@ -197,7 +197,7 @@ class IqtreeTests(TestPluginBase):
with redirected_stdio(stderr=os.devnull):
obs = _build_iqtree_command(input_sequences,
seed=1723,
- n_cores='auto',
+ n_cores=0,
n_cores_max=4,
n_runs=2,
substitution_model='MFP',
@@ -246,7 +246,7 @@ class IqtreeTests(TestPluginBase):
with redirected_stdio(stderr=os.devnull):
obs = _build_iqtree_ufbs_command(input_sequences,
seed=1723,
- n_cores='auto',
+ n_cores=0,
n_cores_max=6,
n_runs=5,
bootstrap_replicates=2000,
@@ -373,7 +373,7 @@ class IqtreeTests(TestPluginBase):
input_fp = self.get_data_path('aligned-dna-sequences-3.fasta')
input_sequences = AlignedDNAFASTAFormat(input_fp, mode='r')
with redirected_stdio(stderr=os.devnull):
- obs = iqtree_ultrafast_bootstrap(input_sequences, n_cores='auto')
+ obs = iqtree_ultrafast_bootstrap(input_sequences, n_cores=0)
obs_tree = skbio.TreeNode.read(str(obs))
# load the resulting tree and test that it has the right number of
# tips and the right tip ids
@@ -390,7 +390,7 @@ class IqtreeTests(TestPluginBase):
input_fp = self.get_data_path('aligned-dna-sequences-3.fasta')
input_sequences = AlignedDNAFASTAFormat(input_fp, mode='r')
with redirected_stdio(stderr=os.devnull):
- obs = iqtree_ultrafast_bootstrap(input_sequences, n_cores='auto',
+ obs = iqtree_ultrafast_bootstrap(input_sequences, n_cores=0,
n_cores_max=2)
obs_tree = skbio.TreeNode.read(str(obs))
# load the resulting tree and test that it has the right number of
View it on GitLab: https://salsa.debian.org/med-team/q2-phylogeny/-/commit/2af927ae33f09e9298bbb2ab0819a7a7025962d5
--
View it on GitLab: https://salsa.debian.org/med-team/q2-phylogeny/-/commit/2af927ae33f09e9298bbb2ab0819a7a7025962d5
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20240218/613cd3a7/attachment-0001.htm>
More information about the debian-med-commit
mailing list