Skip to content

Commit

Permalink
Merge pull request #352 from picrust/v2.5.3
Browse files Browse the repository at this point in the history
V2.5.3
  • Loading branch information
gavinmdouglas authored Aug 8, 2024
2 parents e5c1b9c + a4f717c commit c038d18
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ jobs:
conda init bash
source ~/.bashrc
conda activate picrust2
pip install --editable .
pip install --use-pep517 --config-settings editable_mode=compat -e .
pytest -v
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# PICRUSt2

Pleae see the [PICRUSt2 wiki](https://github.com/picrust/picrust2/wiki) for the documentation and tutorials.
Please see the [PICRUSt2 wiki](https://github.com/picrust/picrust2/wiki) for the documentation and tutorials.

Note that this repository contains the source code for MinPath, which is distributed under the GNU General Public License.

**If you have a question about PICRUSt2, please ask this on the [PICRUSt users Google group](https://groups.google.com/g/picrust-users) rather than creating an issue on Github.**
**If you have a question about PICRUSt2, please ask it on the [PICRUSt users Google group](https://groups.google.com/g/picrust-users) rather than creating an issue on GitHub.**

7 changes: 4 additions & 3 deletions picrust2-env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ dependencies:
- biom-format >=2.1.10
- cython
- epa-ng=0.3.8
- gappa=0.8.0
- dendropy=4.5.2
- gappa >=0.8.0,<=0.8.5
- glpk >=4.65
- h5py >=2.10.0
- hmmer >=3.1b2,<=3.2.1
Expand All @@ -21,8 +22,8 @@ dependencies:
- pandas >=1.1.5
- pytest >=4.4.1
- pytest-cov >=2.6.1
- python >=3.5,<3.9
- python >=3.5
- r-base >=3.5.1
- r-castor >=1.7.2
- scipy >=1.2.1
- sepp=4.3.10
- sepp=4.4.0
4 changes: 2 additions & 2 deletions picrust2/metagenome_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def strat_funcs_by_samples(func_abun, sample_abun, rare_seqs=[],

# Return dataframe and also unstratified dataframe if specified.
if return_unstrat:
return(strat_func, strat_func.groupby(level='function', axis=0).sum())
return(strat_func, strat_func.groupby(level='function').sum())
else:
return(strat_func)

Expand Down Expand Up @@ -392,7 +392,7 @@ def contrib_to_unstrat(contrib_table, sample_order=None):
contrib_table = pd.pivot_table(data=contrib_table, columns='sample',
index='function',
values='taxon_function_abun',
aggfunc=np.sum, fill_value=0)
aggfunc='sum', fill_value=0)

contrib_table.index.name = None
contrib_table.columns.name = None
Expand Down
18 changes: 9 additions & 9 deletions picrust2/pathway_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ def path_abun_weighted_by_seq(reaction_abun, func_ids, total_sum, path_abun,

# Get dataframe with sum of all genes per sequence.
seq_path_abun = pd.pivot_table(data=reaction_abun, index="sequence",
aggfunc=np.sum)
aggfunc='sum')

# Get weighted pathway abundance.
strat_path_abun = (seq_path_abun / total_sum) * path_abun
Expand Down Expand Up @@ -640,7 +640,7 @@ def contributional_path_abun(reaction_abun, func_ids, total_sum, path_abun,
'taxon',
'taxon_abun',
'taxon_rel_abun'],
aggfunc=np.sum)
aggfunc='sum')

contrib_path.reset_index(inplace=True)

Expand Down Expand Up @@ -859,7 +859,7 @@ def contrib_format_pathway_levels(sample_id, contrib_input, minpath_map, out_dir
unstrat_input = contrib_to_unstrat(contrib_input)

# Define dictionary for keeping track of reaction abundances.
reaction_abun = unstrat_input[sample_id].to_dict(defaultdict(int))
reaction_abun = unstrat_input[sample_id].to_dict(into=defaultdict(int))

if run_minpath:
pathways_present = minpath_wrapper(sample_id, unstrat_input,
Expand Down Expand Up @@ -961,7 +961,7 @@ def basic_strat_pathway_levels(sample_id, strat_input, minpath_map, out_dir,
unstrat_input = strat_to_unstrat_counts(strat_input)

# Define dictionary for keeping track of reaction abundances.
reaction_abun = unstrat_input[sample_id].to_dict(defaultdict(int))
reaction_abun = unstrat_input[sample_id].to_dict(into=defaultdict(int))

if run_minpath:

Expand Down Expand Up @@ -1043,7 +1043,7 @@ def unstrat_pathway_levels(sample_id, unstrat_input, minpath_map, out_dir,
unstrat_input.set_index("function", drop=True, inplace=True)

# Define dictionary for keeping track of reaction abundances.
reaction_abun = unstrat_input[sample_id].to_dict(defaultdict(int))
reaction_abun = unstrat_input[sample_id].to_dict(into=defaultdict(int))

if run_minpath:

Expand Down Expand Up @@ -1193,16 +1193,16 @@ def regroup_func_ids(in_df, in_format, mapfile, proc):
index=['sample', 'function', 'taxon',
'taxon_abun',
'taxon_rel_abun'],
aggfunc=np.sum)
aggfunc='sum')

elif in_format == "strat":
regrouped_table = pd.pivot_table(raw_new_ids_combined,
index=["function", "sequence"],
aggfunc=np.sum)
aggfunc='sum')
elif in_format == "unstrat":
regrouped_table = pd.pivot_table(raw_new_ids_combined,
index="function",
aggfunc=np.sum)
aggfunc='sum')

regrouped_table.reset_index(inplace=True)
regrouped_table.columns.name = None
Expand Down Expand Up @@ -1427,4 +1427,4 @@ def strat_to_unstrat_counts(strat_df, func_col="function"):

strat_df = strat_df.drop(["sequence"], axis=1)

return(pd.pivot_table(data=strat_df, index=func_col, aggfunc=np.sum))
return(pd.pivot_table(data=strat_df, index=func_col, aggfunc='sum'))
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["setuptools>=64", "wheel"]
build-backend = "setuptools.build_meta"
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
from glob import glob

__license__ = "GPL"
__version__ = "2.5.2"
__maintainer__ = "Gavin Douglas"
__version__ = "2.5.3"
__maintainer__ = "Langille Lab"

long_description = ("Douglas et al. 2020. PICRUSt2 for prediction of "
"metagenome functions. Nature Biotechnology. doi: "
Expand Down

0 comments on commit c038d18

Please sign in to comment.