We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dataframes are easier to obtain than list of tuple of lists (which is the current input of TreeNode.from_taxonomy )
TreeNode.from_taxonomy
The current workaround (using the metaphlan4 database as a reference) is as follows
from skbio import TreeNode taxonomy = pd.read_table('MetaPhlAn4/mpa_vJan21_CHOCOPhlAnSGB_202103_species.txt', header=None, index_col=0) taxonomy = pd.DataFrame(list(taxonomy[1].apply(lambda x: x.split('|')).values), index=taxonomy.index) taxonomy.columns = ['k', 'p', 'c', 'o', 'f', 'g', 's'] lineages = [(tup.Index, [tup.k, tup.p, tup.c, tup.o, tup.f, tup.g, tup.s]) for tup in taxonomy.itertuples(index=True)] tree = TreeNode.from_taxonomy(lineages)
The text was updated successfully, but these errors were encountered:
It would be pleasant for from_taxonomy to detect the separator used, and to split accordingly as well.
from_taxonomy
Sorry, something went wrong.
No branches or pull requests
Dataframes are easier to obtain than list of tuple of lists (which is the current input of
TreeNode.from_taxonomy
)The current workaround (using the metaphlan4 database as a reference) is as follows
The text was updated successfully, but these errors were encountered: