Skip to content

Commit

Permalink
Merge pull request #285 from picrust/v2.5.1
Browse files Browse the repository at this point in the history
v2.5.1
  • Loading branch information
gavinmdouglas authored Oct 31, 2022
2 parents 90ff3d9 + 3d229dd commit 98f1113
Show file tree
Hide file tree
Showing 24 changed files with 32 additions and 27 deletions.
2 changes: 1 addition & 1 deletion picrust2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
__copyright__ = "Copyright 2018-2022, PICRUSt Project"
__license__ = "GPL"
__url__ = "https://github.com/picrust/picrust2"
__version__ = "2.5.0"
__version__ = "2.5.1"
2 changes: 1 addition & 1 deletion picrust2/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__copyright__ = "Copyright 2018-2022, The PICRUSt Project"
__license__ = "GPL"
__version__ = "2.5.0"
__version__ = "2.5.1"

from os import path

Expand Down
4 changes: 2 additions & 2 deletions picrust2/metagenome_pipeline.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python

__license__ = "GPL"
__version__ = "2.5.0"
__version__ = "2.5.1"

import sys
import pandas as pd
Expand Down Expand Up @@ -338,7 +338,7 @@ def metagenome_contributions(func_abun, sample_abun, rare_seqs=[],
func_abun_subset_melt['taxon_rel_function_abun'] = func_abun_subset_melt['genome_function_count'] * func_abun_subset_melt['taxon_rel_abun']

func_abun_subset_melt['norm_taxon_function_contrib'] = func_abun_subset_melt['taxon_function_abun'] / \
func_abun_subset_melt.groupby("function").sum()["taxon_function_abun"][func_abun_subset_melt["function"]].to_numpy()
func_abun_subset_melt.groupby("function").sum(numeric_only = True)["taxon_function_abun"][func_abun_subset_melt["function"]].to_numpy()

# Collapse sequences identified as "rare" to the same category.
rare_seqs = [r for r in rare_seqs if r in func_abun_subset_melt['taxon'].to_list()]
Expand Down
9 changes: 7 additions & 2 deletions picrust2/pathway_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__copyright__ = "Copyright 2018-2022, The PICRUSt Project"
__license__ = "GPL"
__version__ = "2.5.0"
__version__ = "2.5.1"

import sys
from collections import defaultdict
Expand Down Expand Up @@ -498,6 +498,8 @@ def pathway_pipeline(inputfile,
path_abun_unstrat_by_seq = contrib_to_unstrat(contrib_table=path_abun_strat,
sample_order=list(path_abun_unstrat.columns.values))

path_abun_unstrat_by_seq.index.name = 'pathway'

# Check if an abundance table is empty, which can happen when very few gene
# families are input.
if len(path_abun_unstrat.index) == 0:
Expand Down Expand Up @@ -530,7 +532,7 @@ def prep_pathway_df_out(in_tab, strat_index=False, num_digits=4):

if not in_tab_df.empty:
# Split stratified index into 2 new columns.
split_df = pd.DataFrame.from_records(list(in_tab_df.index.str.split('\\|\\|\\|', 1)), columns=['pathway', 'sequence'])
split_df = pd.DataFrame.from_records(list(in_tab_df.index.str.split(pat = '\\|\\|\\|', n = 1)), columns=['pathway', 'sequence'])
in_tab_df.reset_index(inplace=True)
in_tab_df[['pathway', 'sequence']] = split_df

Expand All @@ -540,6 +542,9 @@ def prep_pathway_df_out(in_tab, strat_index=False, num_digits=4):
# Add these columns to be first.
in_tab_df = in_tab_df[['pathway', 'sequence'] + orig_col]

else:
in_tab_df.index.name = 'pathway'

return(in_tab_df)


Expand Down
2 changes: 1 addition & 1 deletion picrust2/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__copyright__ = "Copyright 2018-2022, The PICRUSt Project"
__license__ = "GPL"
__version__ = "2.5.0"
__version__ = "2.5.1"

from os import path
import sys
Expand Down
2 changes: 1 addition & 1 deletion picrust2/place_seqs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__copyright__ = "Copyright 2018-2022, The PICRUSt Project"
__license__ = "GPL"
__version__ = "2.5.0"
__version__ = "2.5.1"

import sys
from os import path, chdir, getcwd
Expand Down
4 changes: 2 additions & 2 deletions picrust2/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__copyright__ = "Copyright 2018-2022, The PICRUSt Project"
__license__ = "GPL"
__version__ = "2.5.0"
__version__ = "2.5.1"

from os import makedirs, chmod
from os.path import abspath, dirname, isdir, join, exists, splitext
Expand Down Expand Up @@ -544,7 +544,7 @@ def convert_humann2_to_picrust2(infiles, outfile, stratified):

original_col = list(humann2_combined.columns)

split_df = pd.DataFrame.from_records(list(humann2_combined.index.str.split('\\|', 1)), columns=[first_col, 'sequence'])
split_df = pd.DataFrame.from_records(list(humann2_combined.index.str.split(pat = '\\|', n = 1)), columns=[first_col, 'sequence'])

humann2_combined.reset_index(inplace=True)

Expand Down
2 changes: 1 addition & 1 deletion picrust2/wrap_hsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__copyright__ = "Copyright 2018-2022, The PICRUSt Project"
__license__ = "GPL"
__version__ = "2.5.0"
__version__ = "2.5.1"

from os import path
import sys
Expand Down
2 changes: 1 addition & 1 deletion scripts/add_descriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__copyright__ = "Copyright 2018-2022, The PICRUSt Project"
__license__ = "GPL"
__version__ = "2.5.0"
__version__ = "2.5.1"

import argparse
from picrust2.default import default_map
Expand Down
2 changes: 1 addition & 1 deletion scripts/convert_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__copyright__ = "Copyright 2018-2022, The PICRUSt Project"
__license__ = "GPL"
__version__ = "2.5.0"
__version__ = "2.5.1"

import argparse
from picrust2.util import (check_files_exist, contrib_to_legacy,
Expand Down
2 changes: 1 addition & 1 deletion scripts/hsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__copyright__ = "Copyright 2018-2022, The PICRUSt Project"
__license__ = "GPL"
__version__ = "2.5.0"
__version__ = "2.5.1"

import argparse
from picrust2.wrap_hsp import castor_hsp_workflow
Expand Down
2 changes: 1 addition & 1 deletion scripts/metagenome_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__copyright__ = "Copyright 2018-2022, The PICRUSt Project"
__license__ = "GPL"
__version__ = "2.5.0"
__version__ = "2.5.1"

import argparse
from os import path
Expand Down
2 changes: 1 addition & 1 deletion scripts/pathway_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__copyright__ = "Copyright 2018-2022, The PICRUSt Project"
__license__ = "GPL"
__version__ = "2.5.0"
__version__ = "2.5.1"

import argparse
from picrust2.pathway_pipeline import pathway_pipeline
Expand Down
2 changes: 1 addition & 1 deletion scripts/picrust2_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__copyright__ = "Copyright 2018-2022, The PICRUSt Project"
__license__ = "GPL"
__version__ = "2.5.0"
__version__ = "2.5.1"

import argparse
from os import path
Expand Down
2 changes: 1 addition & 1 deletion scripts/place_seqs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__copyright__ = "Copyright 2018-2022, The PICRUSt Project"
__license__ = "GPL"
__version__ = "2.5.0"
__version__ = "2.5.1"

import argparse
from picrust2.place_seqs import place_seqs_pipeline
Expand Down
2 changes: 1 addition & 1 deletion scripts/print_picrust2_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__copyright__ = "Copyright 2018-2022, The PICRUSt Project"
__license__ = "GPL"
__version__ = "2.5.0"
__version__ = "2.5.1"

from sys import platform, version as python_version, executable

Expand Down
2 changes: 1 addition & 1 deletion scripts/shuffle_predictions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__copyright__ = "Copyright 2018-2022, The PICRUSt Project"
__license__ = "GPL"
__version__ = "2.5.0"
__version__ = "2.5.1"

import argparse
from picrust2.util import check_files_exist, shuffle_predictions
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

__copyright__ = "Copyright 2018-2022, The PICRUSt Project"
__license__ = "GPL"
__version__ = "2.5.0"
__version__ = "2.5.1"
__maintainer__ = "Gavin Douglas"

long_description = ("Please visit the google group if you have questions: "
Expand Down
2 changes: 1 addition & 1 deletion tests/test_hsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__copyright__ = "Copyright 2018-2022, The PICRUSt Project"
__license__ = "GPL"
__version__ = "2.5.0"
__version__ = "2.5.1"

import unittest
from os import path
Expand Down
2 changes: 1 addition & 1 deletion tests/test_metagenome_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__copyright__ = "Copyright 2018-2022, The PICRUSt Project"
__license__ = "GPL"
__version__ = "2.5.0"
__version__ = "2.5.1"

import unittest
from os import path
Expand Down
2 changes: 1 addition & 1 deletion tests/test_pathway_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__copyright__ = "Copyright 2018-2022, The PICRUSt Project"
__license__ = "GPL"
__version__ = "2.5.0"
__version__ = "2.5.1"

import unittest
import pandas as pd
Expand Down
2 changes: 1 addition & 1 deletion tests/test_place_seqs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__copyright__ = "Copyright 2018-2022, The PICRUSt Project"
__license__ = "GPL"
__version__ = "2.5.0"
__version__ = "2.5.1"

import unittest
import gzip
Expand Down
2 changes: 1 addition & 1 deletion tests/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__copyright__ = "Copyright 2018-2022, The PICRUSt Project"
__license__ = "GPL"
__version__ = "2.5.0"
__version__ = "2.5.1"

import unittest
from os import path
Expand Down
2 changes: 1 addition & 1 deletion tests/test_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__copyright__ = "Copyright 2018-2022, The PICRUSt Project"
__license__ = "GPL"
__version__ = "2.5.0"
__version__ = "2.5.1"

import unittest
from os import path
Expand Down

0 comments on commit 98f1113

Please sign in to comment.