Skip to content

Commit 4f6ede5

Browse files
Merge pull request #12 from gavinmdouglas/2021.2
v2021.2
2 parents 3f78a7e + 15d3fe6 commit 4f6ede5

File tree

5 files changed

+42
-13
lines changed

5 files changed

+42
-13
lines changed

q2_picrust2/_custom_tree_pipeline.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ def custom_tree_pipeline(table: biom.Table,
1111
threads: int = 1,
1212
hsp_method: str = "mp",
1313
max_nsti: float = 2.0,
14+
edge_exponent: float = 0.5,
1415
skip_minpath: bool = False,
1516
no_gap_fill: bool = False,
1617
skip_norm: bool = False,
@@ -45,23 +46,26 @@ def custom_tree_pipeline(table: biom.Table,
4546
" -p 1 " + \
4647
" -n " + \
4748
" -o " + hsp_out_16S + \
48-
" -m " + hsp_method
49+
" -m " + hsp_method + \
50+
" -e " + str(edge_exponent)
4951

5052
hsp_out_EC = path.join(picrust2_out, "EC_predicted.tsv.gz")
5153
hsp_out_EC_cmd = "hsp.py -i EC " + \
5254
" -t " + newick_infile + \
5355
" -p " + str(threads) + \
5456
" -n " + \
5557
" -o " + hsp_out_EC + \
56-
" -m " + hsp_method
58+
" -m " + hsp_method + \
59+
" -e " + str(edge_exponent)
5760

5861
hsp_out_KO = path.join(picrust2_out, "KO_predicted.tsv.gz")
5962
hsp_out_KO_cmd = "hsp.py -i KO " + \
6063
" -t " + newick_infile + \
6164
" -p " + str(threads) + \
6265
" -n " + \
6366
" -o " + hsp_out_KO + \
64-
" -m " + hsp_method
67+
" -m " + hsp_method + \
68+
" -e " + str(edge_exponent)
6569

6670
if highly_verbose:
6771
hsp_out_16S_cmd += " --verbose"

q2_picrust2/_full_pipeline.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ def full_pipeline(table: biom.Table,
1212
seq: pd.Series,
1313
threads: int = 1,
1414
hsp_method: str = "mp",
15+
placement_tool: str = "epa-ng",
1516
min_align: float = 0.8,
1617
max_nsti: float = 2.0,
18+
edge_exponent: float = 0.5,
1719
skip_minpath: bool = False,
1820
no_gap_fill: bool = False,
1921
skip_norm: bool = False,
@@ -44,6 +46,7 @@ def full_pipeline(table: biom.Table,
4446
input_table=biom_infile,
4547
output_folder=picrust2_out,
4648
processes=threads,
49+
placement_tool=placement_tool,
4750
ref_dir=default_ref_dir,
4851
in_traits="EC,KO",
4952
custom_trait_tables=None,
@@ -58,6 +61,7 @@ def full_pipeline(table: biom.Table,
5861
min_reads=1,
5962
min_samples=1,
6063
hsp_method=hsp_method,
64+
edge_exponent=edge_exponent,
6165
min_align=min_align,
6266
skip_nsti=False,
6367
skip_minpath=skip_minpath,

q2_picrust2/citations.bib

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
@article{Douglas2019bioRxiv,
2-
title={PICRUSt2: An improved and extensible approach for metagenome inference},
1+
@article{Douglas2020NatureBiotech,
2+
title={PICRUSt2 for prediction of metagenome functions},
33
author={Douglas et al.},
4-
journal={bioRxiv},
5-
year={2019},
6-
doi={10.1101/672295}
4+
journal={Nature Biotechnology},
5+
year={2020},
6+
volume={38},
7+
issue={6},
8+
pages={685-688},
9+
doi={10.1038/s41587-020-0548-6}
710
}
811

q2_picrust2/plugin_setup.py

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,18 @@
99

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

12+
PLACEMENT_TOOLS = ['epa-ng', 'sepp']
13+
1214
plugin = Plugin(
1315
name='picrust2',
14-
version="2019.10",
16+
version="2021.2",
1517
website='https://github.com/gavinmdouglas/q2-picrust2',
1618
package='q2_picrust2',
1719
description=('This QIIME 2 plugin wraps the default 16S PICRUSt2 pipeline to run '
1820
'metagenome inference based on marker gene data. Currently '
1921
'only unstratified output is supported.'),
2022
short_description='Predicts gene families and pathways from 16S sequences.',
21-
citations=[citations['Douglas2019bioRxiv']]
23+
citations=[citations['Douglas2020NatureBiotech']]
2224
)
2325

2426
plugin.methods.register_function(
@@ -29,8 +31,10 @@
2931

3032
parameters={'threads': Int % Range(1, None),
3133
'hsp_method': Str % Choices(HSP_METHODS),
34+
'placement_tool': Str % Choices(PLACEMENT_TOOLS),
3235
'min_align': Float % Range(0.0, 1.0),
3336
'max_nsti': Float % Range(0.0, None),
37+
'edge_exponent': Float % Range(0.0, None),
3438
'skip_minpath': Bool,
3539
'no_gap_fill': Bool,
3640
'skip_norm': Bool,
@@ -49,6 +53,9 @@
4953
parameter_descriptions={
5054
'threads': 'Number of threads/processes to use during workflow.',
5155
'hsp_method': 'Which hidden-state prediction method to use.',
56+
'placement_tool': ('Placement tool to use when placing sequences into '
57+
'reference tree. EPA-ng is the default, but SEPP '
58+
'is less memory intensive.'),
5259
'min_align': ('Proportion of the total length of an input query '
5360
'sequence that must align with reference sequences. '
5461
'Any sequences with lengths below this value after '
@@ -59,6 +66,11 @@
5966
'be output.'),
6067
'skip_minpath': ('Do not run MinPath to identify which pathways are '
6168
'present as a first pass (on by default).'),
69+
'edge_exponent': ('Setting for maximum parisomony hidden-state '
70+
'prediction. Specifies weighting transition costs '
71+
'by the inverse length of edge lengths. If 0, then '
72+
'edge lengths do not influence predictions. Must be '
73+
'a non-negative real-valued number.'),
6274
'no_gap_fill': ('Do not perform gap filling before predicting '
6375
'pathway abundances (gap filling is on otherwise by '
6476
'default).'),
@@ -83,7 +95,7 @@
8395

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

86-
citations=[citations['Douglas2019bioRxiv']]
98+
citations=[citations['Douglas2020NatureBiotech']]
8799
)
88100

89101

@@ -96,6 +108,7 @@
96108
parameters={'threads': Int % Range(1, None),
97109
'hsp_method': Str % Choices(HSP_METHODS),
98110
'max_nsti': Float % Range(0.0, None),
111+
'edge_exponent': Float % Range(0.0, None),
99112
'skip_minpath': Bool,
100113
'no_gap_fill': Bool,
101114
'skip_norm': Bool,
@@ -119,6 +132,11 @@
119132
'be output.'),
120133
'skip_minpath': ('Do not run MinPath to identify which pathways are '
121134
'present as a first pass (on by default).'),
135+
'edge_exponent': ('Setting for maximum parisomony hidden-state '
136+
'prediction. Specifies weighting transition costs '
137+
'by the inverse length of edge lengths. If 0, then '
138+
'edge lengths do not influence predictions. Must be '
139+
'a non-negative real-valued number.'),
122140
'no_gap_fill': ('Do not perform gap filling before predicting '
123141
'pathway abundances (gap filling is on otherwise by '
124142
'default).'),
@@ -146,5 +164,5 @@
146164
"used with the output of SEPP (q2-fragment-insertion) as a " +
147165
"starting point."),
148166

149-
citations=[citations['Douglas2019bioRxiv']]
167+
citations=[citations['Douglas2020NatureBiotech']]
150168
)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setup(
44
name="q2-picrust2",
5-
version="2019.10",
5+
version="2021.2",
66
packages=find_packages(),
77
package_data={'q2_picrust2': ['citations.bib']},
88
author="Gavin Douglas",

0 commit comments

Comments
 (0)