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

transformer for OrdinationFormat --> metadata #123

Closed
nbokulich opened this issue Jun 2, 2017 · 2 comments
Closed

transformer for OrdinationFormat --> metadata #123

nbokulich opened this issue Jun 2, 2017 · 2 comments

Comments

@nbokulich
Copy link
Member

This would be useful to use principal coordinates (or other ordination results) as input metadata. I am working on some methods that could employ this, e.g., to test whether samples change over PC1 before/after treatment.

The transformation of OrdinationFormat --> pd.DataFrame can be achieved with something like this (in a jupyter notebook, at least. I suppose the first line might be unnecessary in a transformer):

beta_div = beta_div.view(skbio.OrdinationResults)
beta_div = beta_div.samples.loc[:, 0:2]
beta_div.columns = ['unweighted-unifrac-pc1', 'unweighted-unifrac-pc2', 'unweighted-unifrac-pc3']

and then I assume the beta_div DataFrame can be converted to metadata with

qiime2.Metadata(beta_div)

I would find this extremely useful — any interest?

@ebolyen
Copy link
Member

ebolyen commented Jun 2, 2017

It would be qiime2.Metadata.from_artifact(beta_div) (if you wanted to preserve provenance), but yeah!

We're about to write a whole ton of transformers for FeatureData[...], I don't see why this couldn't be added to the list.

@ElDeveloper, does this kind of view make sense to you?

@thermokarst
Copy link
Contributor

Duplicate of #122, moving discussion into there.

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

3 participants