Select samples randomly based on columns in metadata?

Hi

Is there a way in qiime2 to subset samples randomly based on columns in metadata?
Something like:

dataSub_male = Subset -n 50 —data data.qza —metadata metadata.qza —conditions gender == “Male” & ASD == “I do not have ASD”

dataSub_female = Subset -n 30 —data data.qza —metadata metadata.qza —conditions gender == “Female” & ASD == “I do not have ASD”

Then merge dataSub_male and dataSub_female?

Thanks,

Yes!

First you use
qiime feature-table filter-samples
to make a table for each of your groups of samples, then you randomly split samples into groups using
qiime sample-classifier split-table

While there is a not a tutorial that shows you exacly how to do this, there are docs and discussions about this process.

Let us know if you have any questions!

3 Likes

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.