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

function request: per sample filtering #177

Open
qiyunzhu opened this issue Apr 26, 2018 · 1 comment
Open

function request: per sample filtering #177

qiyunzhu opened this issue Apr 26, 2018 · 1 comment

Comments

@qiyunzhu
Copy link

qiyunzhu commented Apr 26, 2018

Improvement Description
Hello qiime2 team, this is Qiyun Zhu from the Knight Lab. We (cc'ing @wasade and @tanaes) recently realized that filtering out low-abundance taxa on a per-sample base can effectively reduce table density, and improve the resolution of downstream beta diversity analysis, especially for those unweighted metrics. To my understanding, both QIIME1 and 2 do not have the function for per-sample filtering. Would it be a good idea to add this function?

Proposed Behavior
The implementation should be very simple. My solution (using the biom library) is:

th = 0.001  # threshold, which is a fraction

def filter_otus(data, id_, md):
    bound = data.sum() * th
    data[data < bound] = 0
    return data

table.transform(filter_otus, axis='sample')
table.remove_empty(axis='observation')

References
(Migrated from #396)

@mestaki
Copy link

mestaki commented Sep 29, 2020

Forum x reference

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