Skip to content
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
10 changes: 7 additions & 3 deletions q2_picrust2/_custom_tree_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -45,23 +46,26 @@ 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 " + \
" -t " + newick_infile + \
" -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 " + \
" -t " + newick_infile + \
" -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"
Expand Down
4 changes: 4 additions & 0 deletions q2_picrust2/_full_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down
13 changes: 8 additions & 5 deletions q2_picrust2/citations.bib
Original file line number Diff line number Diff line change
@@ -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}
}

26 changes: 22 additions & 4 deletions q2_picrust2/plugin_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,18 @@

HSP_METHODS = ['mp', 'emp_prob', 'pic', 'scp', 'subtree_average']

PLACEMENT_TOOLS = ['epa-ng', 'sepp']

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(
Expand All @@ -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,
Expand All @@ -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 '
Expand All @@ -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).'),
Expand All @@ -83,7 +95,7 @@

description=("QIIME 2 plugin for default 16S PICRUSt2 pipeline"),

citations=[citations['Douglas2019bioRxiv']]
citations=[citations['Douglas2020NatureBiotech']]
)


Expand All @@ -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,
Expand All @@ -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).'),
Expand Down Expand Up @@ -146,5 +164,5 @@
"used with the output of SEPP (q2-fragment-insertion) as a " +
"starting point."),

citations=[citations['Douglas2019bioRxiv']]
citations=[citations['Douglas2020NatureBiotech']]
)
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down