Skip to content
New issue

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

qiime2 plugin? #31

Open
mortonjt opened this issue Apr 12, 2021 · 4 comments
Open

qiime2 plugin? #31

mortonjt opened this issue Apr 12, 2021 · 4 comments

Comments

@mortonjt
Copy link

Would there be any interest in attaching a qiime2 plugin to this repository?

Of course, it would have to be resolved after merging #29
But it could be incredibly useful to have internal node relabeling in place; particularly for interpreting ILR coordinates.

@wasade
Copy link
Member

wasade commented Apr 12, 2021

Merged and yes, there would be a lot of interest to see a q2-plugin here

@mortonjt
Copy link
Author

I was able to get t2t to work, even though it required a bit of massaging to convert from qiime2 taxonomy to a suitable taxonomy that t2t accepts. I can get a PR started in ~2 weeks.

@wasade
Copy link
Member

wasade commented Apr 12, 2021 via email

@mortonjt
Copy link
Author

Correct, I had to hack that in as well.
I had to use cat taxonomy.tsv | sed -e "1d" | cut -f1,2 > consistency.tsv followed by the following code to make q2 style taxonomy play nicely with t2t.

import pandas as pd
RANK_ORDER = ['d', 'p', 'c', 'o', 'f', 'g', 's']
taxa = pd.read_table('consistency.tsv', index_col=0, header=None)
def f(x):
    tabs = x.split('; ')
    n = len(RANK_ORDER) - len(tabs)
    if n > 0:
        return x + '; ' + '__; '.join(RANK_ORDER[-n:]) + '__'
    else:
        return x
data = taxa[1].apply(f)
data.to_csv('t2t_consistency.tsv', sep='\t', header=None)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants