How to create a feature metadata file with wanted taxonomic phyla?

Hello Nicholas, I was wondering, with the “qiime feature-table filter-features”, how the metadata file is written? Is there a certain header to the column where you list the taxonomic features? For example, is my one-column metadata file anywhere near? However, it seems like I am working with only one dimension, and I know that usually a metadata file has 2 dimensions?

taxa
p__Proteobacteria
p__Bacteroidetes
p__Actinobacteria
p__Acidobacteria
p__Verrucomicrobia

I have done it the other way with taxa filter-table, but I would like it better if I could do it with an external metadata file.

Thanks for your help, m a r t i n

P. S. By the way, the ‘k__Bacteria;__;’ part does NOT work, but it still runs with it inside.

artifactsDir=/users/PAS0471/osu9207/Desktop/osu9207/partners/valles/io/artifacts/16S/runs2n3

qiime taxa filter-table
–i-table $artifactsDir/3.valles.16S.runs2n3.subset.featureTableFreq.cutadapt.dada2.qza
–i-taxonomy $artifactsDir/4.valles.16S.runs2n3.featureDataTaxo.cutadapt.dada2.gg.qza
–p-include p__Proteobacteria,p__Bacteroidetes,p__Actinobacteria,p__Acidobacteria,p__Verrucomicrobia,p__Chloroflexi,p__Planctomycetes,‘k__Bacteria;__;’,p__TM7,p__Gemmatimonadetes
–o-filtered-table $artifactsDir/4.4.valles.16S.runs2n3.subset.featureTableFreqs.filteredTop10phyla.cutadapt.dada2.qza
–verbose

Hi @MartinLubell! Check out the Metadata in QIIME 2 tutorial for information on sample and feature metadata! For feature metadata, you will need to make sure that your IDs are whatever your Feature IDs are in the table (if the table isn’t collapsed, they are most likely long strings of letters and numbers; if they are collapsed then it is probably taxonomic annotations).

Check out this example from the tutorial reference above!


Glad you found the taxa filter-table command, that is what I was going to recommend to you!

This is probably because of the quotes, and how they are interacting with your shell. How about something like:

qiime taxa filter-table
  --i-table table.qza \
  --i-taxonomy taxonomy.qza \
  --p-include 'p__Proteobacteria,p__Bacteroidetes,p__Actinobacteria,p__Acidobacteria,p__Verrucomicrobia,p__Chloroflexi,p__Planctomycetes,\'k__Bacteria;__;\',p__TM7,p__Gemmatimonadetes' \
  --o-filtered-table filtered-table.qza \
  --verbose

Hello Matthew (@thermokarst),

I just realized what is going on!

For the last couple of days, I was stuck at understanding the following qsv:

I was thinking: what is this featureID, what does it have to do with the taxonomic features? I finally exported the .csv to Excel, and taTahhhHHH: now, I see it, and it makes sense. I had never thought of seeing to the right of the sequence in the .qsv!

I now think I will be able to figure it out from here.

Thanks, m a r t i n

1 Like

I guess I will keep it at the “taxa filter-table” step, knowing that I have to write out, in the script, what taxonomic elements I want to keep. The “foster-table filter-features” method will only get me the list of feature IDs, and, at this stage, the method “taxa filter-table” does not accept an external (not really a metadata) file of the list of taxonomic elements I want to keep.

1 Like

I am now able to work it like I want. Here is an example of 2 different "exact" searches:
1.) the kingdom level with the lower layers unresolved
2.) organisms at a certain family level

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