From a0d7f858676deb3d35e477aba0b369e907ddbed4 Mon Sep 17 00:00:00 2001 From: Gavin Douglas Date: Thu, 18 Mar 2021 15:35:26 -0300 Subject: [PATCH 1/3] updated for latest version --- q2_picrust2/_custom_tree_pipeline.py | 2 ++ q2_picrust2/citations.bib | 13 ++++++++----- q2_picrust2/plugin_setup.py | 8 ++++---- setup.py | 2 +- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/q2_picrust2/_custom_tree_pipeline.py b/q2_picrust2/_custom_tree_pipeline.py index 99f3941..a6483e9 100644 --- a/q2_picrust2/_custom_tree_pipeline.py +++ b/q2_picrust2/_custom_tree_pipeline.py @@ -91,11 +91,13 @@ def custom_tree_pipeline(table: biom.Table, EC_metagenome_cmd = "metagenome_pipeline.py -i " + biom_infile + \ " -f " + hsp_out_EC + \ + " -p " + str(threads) + \ " -o " + EC_metagenome_out + \ " --max_nsti " + str(max_nsti) KO_metagenome_cmd = "metagenome_pipeline.py -i " + biom_infile + \ " -f " + hsp_out_KO + \ + " -p " + str(threads) + \ " -o " + KO_metagenome_out + \ " --max_nsti " + str(max_nsti) diff --git a/q2_picrust2/citations.bib b/q2_picrust2/citations.bib index d57b498..8214cdb 100644 --- a/q2_picrust2/citations.bib +++ b/q2_picrust2/citations.bib @@ -1,8 +1,11 @@ -@article{Douglas2019bioRxiv, - title={PICRUSt2: An improved and extensible approach for metagenome inference}, +@article{Douglas2020NatureBiotech, + title={PICRUSt2 for prediction of metagenome functions}, author={Douglas et al.}, - journal={bioRxiv}, - year={2019}, - doi={10.1101/672295} + journal={Nature Biotechnology}, + year={2020}, + volume={38}, + issue={6}, + pages={685-688}, + doi={10.1038/s41587-020-0548-6} } diff --git a/q2_picrust2/plugin_setup.py b/q2_picrust2/plugin_setup.py index 3056a81..0530946 100644 --- a/q2_picrust2/plugin_setup.py +++ b/q2_picrust2/plugin_setup.py @@ -11,14 +11,14 @@ plugin = Plugin( name='picrust2', - version="2019.10", + version="2021.2", website='https://github.com/gavinmdouglas/q2-picrust2', package='q2_picrust2', description=('This QIIME 2 plugin wraps the default 16S PICRUSt2 pipeline to run ' 'metagenome inference based on marker gene data. Currently ' 'only unstratified output is supported.'), short_description='Predicts gene families and pathways from 16S sequences.', - citations=[citations['Douglas2019bioRxiv']] + citations=[citations['Douglas2020NatureBiotech']] ) plugin.methods.register_function( @@ -83,7 +83,7 @@ description=("QIIME 2 plugin for default 16S PICRUSt2 pipeline"), - citations=[citations['Douglas2019bioRxiv']] + citations=[citations['Douglas2020NatureBiotech']] ) @@ -146,5 +146,5 @@ "used with the output of SEPP (q2-fragment-insertion) as a " + "starting point."), - citations=[citations['Douglas2019bioRxiv']] + citations=[citations['Douglas2020NatureBiotech']] ) diff --git a/setup.py b/setup.py index 301ba7c..890372b 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name="q2-picrust2", - version="2019.10", + version="2021.2", packages=find_packages(), package_data={'q2_picrust2': ['citations.bib']}, author="Gavin Douglas", From be2d244ef34ba2c799400907a2cfa854566444db Mon Sep 17 00:00:00 2001 From: Gavin Douglas Date: Tue, 6 Apr 2021 11:00:36 -0300 Subject: [PATCH 2/3] added edge exponent and placement tool options --- q2_picrust2/_custom_tree_pipeline.py | 10 +++++++--- q2_picrust2/_full_pipeline.py | 4 ++++ q2_picrust2/plugin_setup.py | 18 ++++++++++++++++++ 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/q2_picrust2/_custom_tree_pipeline.py b/q2_picrust2/_custom_tree_pipeline.py index a6483e9..6bdad23 100644 --- a/q2_picrust2/_custom_tree_pipeline.py +++ b/q2_picrust2/_custom_tree_pipeline.py @@ -11,6 +11,7 @@ def custom_tree_pipeline(table: biom.Table, threads: int = 1, hsp_method: str = "mp", max_nsti: float = 2.0, + edge_exponent: float = 0.5, skip_minpath: bool = False, no_gap_fill: bool = False, skip_norm: bool = False, @@ -45,7 +46,8 @@ def custom_tree_pipeline(table: biom.Table, " -p 1 " + \ " -n " + \ " -o " + hsp_out_16S + \ - " -m " + hsp_method + " -m " + hsp_method + \ + " -e " + str(edge_exponent) hsp_out_EC = path.join(picrust2_out, "EC_predicted.tsv.gz") hsp_out_EC_cmd = "hsp.py -i EC " + \ @@ -53,7 +55,8 @@ def custom_tree_pipeline(table: biom.Table, " -p " + str(threads) + \ " -n " + \ " -o " + hsp_out_EC + \ - " -m " + hsp_method + " -m " + hsp_method + \ + " -e " + str(edge_exponent) hsp_out_KO = path.join(picrust2_out, "KO_predicted.tsv.gz") hsp_out_KO_cmd = "hsp.py -i KO " + \ @@ -61,7 +64,8 @@ def custom_tree_pipeline(table: biom.Table, " -p " + str(threads) + \ " -n " + \ " -o " + hsp_out_KO + \ - " -m " + hsp_method + " -m " + hsp_method + \ + " -e " + str(edge_exponent) if highly_verbose: hsp_out_16S_cmd += " --verbose" diff --git a/q2_picrust2/_full_pipeline.py b/q2_picrust2/_full_pipeline.py index c6a119a..872fe69 100644 --- a/q2_picrust2/_full_pipeline.py +++ b/q2_picrust2/_full_pipeline.py @@ -12,8 +12,10 @@ def full_pipeline(table: biom.Table, seq: pd.Series, threads: int = 1, hsp_method: str = "mp", + placement_tool: str = "epa-ng", min_align: float = 0.8, max_nsti: float = 2.0, + edge_exponent: float = 0.5, skip_minpath: bool = False, no_gap_fill: bool = False, skip_norm: bool = False, @@ -44,6 +46,7 @@ def full_pipeline(table: biom.Table, input_table=biom_infile, output_folder=picrust2_out, processes=threads, + placement_tool=placement_tool, ref_dir=default_ref_dir, in_traits="EC,KO", custom_trait_tables=None, @@ -58,6 +61,7 @@ def full_pipeline(table: biom.Table, min_reads=1, min_samples=1, hsp_method=hsp_method, + edge_exponent=edge_exponent, min_align=min_align, skip_nsti=False, skip_minpath=skip_minpath, diff --git a/q2_picrust2/plugin_setup.py b/q2_picrust2/plugin_setup.py index 0530946..69ba18d 100644 --- a/q2_picrust2/plugin_setup.py +++ b/q2_picrust2/plugin_setup.py @@ -9,6 +9,8 @@ HSP_METHODS = ['mp', 'emp_prob', 'pic', 'scp', 'subtree_average'] +PLACEMENT_TOOLS = ['epa-ng', 'sepp'] + plugin = Plugin( name='picrust2', version="2021.2", @@ -29,8 +31,10 @@ parameters={'threads': Int % Range(1, None), 'hsp_method': Str % Choices(HSP_METHODS), + 'placement_tool': Str % Choices(PLACEMENT_TOOLS), 'min_align': Float % Range(0.0, 1.0), 'max_nsti': Float % Range(0.0, None), + 'edge_exponent': Float % Range(0.0, None), 'skip_minpath': Bool, 'no_gap_fill': Bool, 'skip_norm': Bool, @@ -49,6 +53,9 @@ parameter_descriptions={ 'threads': 'Number of threads/processes to use during workflow.', 'hsp_method': 'Which hidden-state prediction method to use.', + 'placement_tool': ('Placement tool to use when placing sequences into ' + 'reference tree. EPA-ng is the default, but SEPP ' + 'is less memory intensive.'), 'min_align': ('Proportion of the total length of an input query ' 'sequence that must align with reference sequences. ' 'Any sequences with lengths below this value after ' @@ -59,6 +66,11 @@ 'be output.'), 'skip_minpath': ('Do not run MinPath to identify which pathways are ' 'present as a first pass (on by default).'), + 'edge_exponent': ('Setting for maximum parisomony hidden-state ' + 'prediction. Specifies weighting transition costs ' + 'by the inverse length of edge lengths. If 0, then ' + 'edge lengths do not influence predictions. Must be ' + 'a non-negative real-valued number.'), 'no_gap_fill': ('Do not perform gap filling before predicting ' 'pathway abundances (gap filling is on otherwise by ' 'default).'), @@ -96,6 +108,7 @@ parameters={'threads': Int % Range(1, None), 'hsp_method': Str % Choices(HSP_METHODS), 'max_nsti': Float % Range(0.0, None), + 'edge_exponent': Float % Range(0.0, None), 'skip_minpath': Bool, 'no_gap_fill': Bool, 'skip_norm': Bool, @@ -119,6 +132,11 @@ 'be output.'), 'skip_minpath': ('Do not run MinPath to identify which pathways are ' 'present as a first pass (on by default).'), + 'edge_exponent': ('Setting for maximum parisomony hidden-state ' + 'prediction. Specifies weighting transition costs ' + 'by the inverse length of edge lengths. If 0, then ' + 'edge lengths do not influence predictions. Must be ' + 'a non-negative real-valued number.'), 'no_gap_fill': ('Do not perform gap filling before predicting ' 'pathway abundances (gap filling is on otherwise by ' 'default).'), From 15d3fe6200f4fdceaed273e6a029e250404aef08 Mon Sep 17 00:00:00 2001 From: Gavin Douglas Date: Wed, 7 Apr 2021 17:42:29 -0300 Subject: [PATCH 3/3] removed outdated processes option --- q2_picrust2/_custom_tree_pipeline.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/q2_picrust2/_custom_tree_pipeline.py b/q2_picrust2/_custom_tree_pipeline.py index 6bdad23..e05dc05 100644 --- a/q2_picrust2/_custom_tree_pipeline.py +++ b/q2_picrust2/_custom_tree_pipeline.py @@ -95,13 +95,11 @@ def custom_tree_pipeline(table: biom.Table, EC_metagenome_cmd = "metagenome_pipeline.py -i " + biom_infile + \ " -f " + hsp_out_EC + \ - " -p " + str(threads) + \ " -o " + EC_metagenome_out + \ " --max_nsti " + str(max_nsti) KO_metagenome_cmd = "metagenome_pipeline.py -i " + biom_infile + \ " -f " + hsp_out_KO + \ - " -p " + str(threads) + \ " -o " + KO_metagenome_out + \ " --max_nsti " + str(max_nsti)