Skip to content

Commit 3866467

Browse files
Merge pull request #8 from gavinmdouglas/v2.1.4-b_update
V2.1.4 b update
2 parents fc29048 + e6a34cd commit 3866467

File tree

5 files changed

+30
-18
lines changed

5 files changed

+30
-18
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
testfiles/*
2+
q2_picrust2.egg-info/
3+
q2_picrust2/__pycache__/

q2_picrust2/_custom_tree_pipeline.py

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import skbio
33
import biom
44
from os import path
5+
import sys
56
import pandas as pd
67
from tempfile import TemporaryDirectory
78
from q2_types.feature_table import FeatureTable, Frequency
@@ -31,59 +32,65 @@ def custom_tree_pipeline(table: biom.Table,
3132

3233
picrust2_out = path.join(temp_dir, "picrust2_out")
3334

35+
print("Running the below commands:", file=sys.stderr)
36+
3437
# Run hidden-state prediction step (on 16S, EC, and KO tables
3538
# separately.
36-
hsp_out_16S = path.join(picrust2_out, "16S_predicted.tsv")
39+
hsp_out_16S = path.join(picrust2_out, "16S_predicted.tsv.gz")
3740
system_call_check("hsp.py -i 16S " +
3841
" -t " + newick_infile +
3942
" -p 1 " +
4043
" -n " +
4144
"-o " + hsp_out_16S +
42-
" -m " + hsp_method)
45+
" -m " + hsp_method,
46+
print_out=True)
4347

44-
hsp_out_EC = path.join(picrust2_out, "EC_predicted.tsv")
48+
hsp_out_EC = path.join(picrust2_out, "EC_predicted.tsv.gz")
4549
system_call_check("hsp.py -i EC " +
4650
" -t " + newick_infile +
4751
" -p " + str(threads) +
4852
" -o " + hsp_out_EC +
49-
" -m " + hsp_method)
53+
" -m " + hsp_method,
54+
print_out=True)
5055

51-
hsp_out_KO = path.join(picrust2_out, "KO_predicted.tsv")
56+
hsp_out_KO = path.join(picrust2_out, "KO_predicted.tsv.gz")
5257
system_call_check("hsp.py -i KO " +
5358
" -t " + newick_infile +
5459
" -p " + str(threads) +
5560
" -o " + hsp_out_KO +
56-
" -m " + hsp_method)
61+
" -m " + hsp_method,
62+
print_out=True)
5763

5864
# Run metagenome pipeline step.
5965
EC_metagenome_out = path.join(picrust2_out, "EC_metagenome_out")
6066
system_call_check("metagenome_pipeline.py -i " + biom_infile +
6167
" -m " + hsp_out_16S +
6268
" -f " + hsp_out_EC +
6369
" -o " + EC_metagenome_out +
64-
" --max_nsti " + str(max_nsti))
70+
" --max_nsti " + str(max_nsti),
71+
print_out=True)
6572

6673
KO_metagenome_out = path.join(picrust2_out, "KO_metagenome_out")
6774
system_call_check("metagenome_pipeline.py -i " + biom_infile +
6875
" -m " + hsp_out_16S +
6976
" -f " + hsp_out_KO +
7077
" -o " + KO_metagenome_out +
71-
" --max_nsti " + str(max_nsti))
78+
" --max_nsti " + str(max_nsti),
79+
print_out=True)
80+
81+
EC_out = path.join(EC_metagenome_out, "pred_metagenome_unstrat.tsv.gz")
82+
KO_out = path.join(KO_metagenome_out, "pred_metagenome_unstrat.tsv.gz")
7283

7384
# Run pathway inference step.
7485
pathways_out = path.join(picrust2_out, "pathways_out")
75-
76-
EC_out = path.join(EC_metagenome_out, "pred_metagenome_unstrat.tsv")
77-
86+
pathabun_out = path.join(pathways_out, "path_abun_unstrat.tsv.gz")
7887
system_call_check("pathway_pipeline.py -i " + EC_out +
7988
" -o " + pathways_out +
80-
" -p " + str(threads))
89+
" -p " + str(threads),
90+
print_out=True)
8191

8292
# Read in output unstratified metagenome tables and return as BIOM
8393
# objects.
84-
KO_out = path.join(KO_metagenome_out, "pred_metagenome_unstrat.tsv")
85-
pathabun_out = path.join(pathways_out, "path_abun_unstrat.tsv")
86-
8794
ko_biom = biom.load_table(KO_out)
8895
ec_biom = biom.load_table(EC_out)
8996
pathabun_biom = biom.load_table(pathabun_out)

q2_picrust2/_full_pipeline.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,17 @@ def full_pipeline(table: biom.Table,
4040
func_outputs, pathway_outputs = picrust2.pipeline.full_pipeline(study_fasta=seq_outfile,
4141
input_table=biom_infile,
4242
output_folder=picrust2_out,
43-
threads=threads,
43+
processes=threads,
4444
ref_dir=default_ref_dir,
4545
in_traits="EC,KO",
4646
custom_trait_tables=None,
4747
marker_gene_table=default_tables["16S"],
4848
pathway_map=default_pathway_map,
49+
rxn_func="EC",
4950
no_pathways=False,
5051
regroup_map=default_regroup_map,
5152
no_regroup=False,
53+
metagenome_contrib=True,
5254
stratified=False,
5355
max_nsti=max_nsti,
5456
min_reads=1,
@@ -59,6 +61,7 @@ def full_pipeline(table: biom.Table,
5961
skip_minpath=False,
6062
coverage=False,
6163
per_sequence_contrib=False,
64+
remove_intermediate=False,
6265
verbose=True)
6366

6467
# Convert the returned unstratified tables to BIOM tables.

q2_picrust2/plugin_setup.py

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

1414
plugin = Plugin(
1515
name='picrust2',
16-
version="0.0.3",
16+
version="2019.4",
1717
website='https://github.com/gavinmdouglas/q2-picrust2',
1818
package='q2_picrust2',
1919
description=('This QIIME 2 plugin wraps the default 16S PICRUSt2 pipeline to run '

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="0.0.3",
5+
version="2019.4",
66
packages=find_packages(),
77
package_data={'q2_picrust2': ['citations.bib']},
88
author="Gavin Douglas",

0 commit comments

Comments
 (0)