Feature-table downstream processes

Hello,
I’m totally new in qiime2 environment. I had installed qiime in my computer and recently I completed the “moving pictures tutorial”. So, A collaborator sent me a Biom file and metadata file (txt type), I had imported both into qiime2 and I have created a “feature-table.qza” artifact, but now I dont sure what I need to do to continue, since I’m interested in knowing the taxonomy and the relative abundance in my samples. Can you help me please?
All suggestions will be appreciate.
Thanks!

Hi @LuisFelipe,

Welcome to QIIME2!
Looks like you’re onto a good start! As you have your QIIME2 FeatureTable[Frequency] artifact you should be able to perform taxonomic analyses following this portion of the Moving Pictures tutorial: taxonomic analysis. Now, the question is if your data in a BIOM table comes from a denoising technique (e.g. DADA2 or Deblur) or if it comes from closed-reference OTU picking. In the former case, you need to assign taxonomy to your sequences first. If you already have the taxonomy (note, it needs to be imported as a separate artifact), then you don’t need to do the classification.

As for the second part of your question, what exactly do you mean by relative abundance? If you mean differential abundance (e.g. what microbes are different between “healthy” and “sick” groups), you can use ANCOM.

hope this helps!

Tomasz

Hello @tomasz thank you for your help. Actually I have tried to follow this part of the tutorial (Taxonomic analysis), however in this part required me a feature-table [sequence] (rep-seqs.qza) to add to “gg-13-8-99-515-806-nb-classifier.qza” but as you know, I only have a feature-table [frequency] and metadata file.
I’m not sure what method (Denoising or OTU picking) my collaborator had used but is probably that the second one (I will ask), If so it, how command I must run to see taxonomy? If not, is possible to assign taxonomy to feature-table [frequency] artifact? what I need to do?

Please, information about that will be significant! Thank you so much!

I see! @LuisFelipe your course of action really depends on the type of your data.
If it’s closed reference data, then the BIOM table (in biom format, not qza artifact) may already have taxonomy embedded in it. If it’s not there, then depending on the reference database (e.g. GreenGenes) you should be able to extract taxonomies by mapping IDs to the database with some scripting.

If your data comes from one of the denoising techniques, then your feature IDs (microbe “names”) are sequences themselves. Then, using biom package you can generate a FASTA file which you can import into QIIME2 as FeatureTable[Sequence] artifact.
For example, using this code in ipython from your QIIME2 environment:

import biom
from skbio.sequence import Sequence

deblur = biom.load_table('deblur.biom')
seqs = deblur.ids(axis='observation')

fh = open('rep-seqs.fasta', 'a')
s = [Sequence(seq, metadata={'id': seq}).write(fh) for seq in seqs]

!qiime tools import --input-path rep-seqs.fasta --output-path rep-seqs.qza --type FeatureData[Sequence]

Ideally, your collaborator should provide you with raw data, so that you’re able to do all of the processing yourself in a consistent way, without relying on reverse-engineering your data. But I do understand that it’s not always an option.

If you need any further assistance, please let us know!

Tomasz

Hello @Tomasz, thank you again for your time. So, only one more question please: according with you, is there any form to know if my biom file have taxonomy assigned? May be running a bar plot command or similar? I’m worried by that, due to I don’t know how to continue to see the taxonomy of my samples. I will try to get the raw data.

I will grateful your suggestion.
Best!

Hi @LuisFelipe!

Are you talking about checking if your Feature IDs match between your feature table and your assigned taxonomy? If so, you could run taxa barplot - this will “join” the two files and render the taxonomic composition barplots.

I initially read your question as asking about taxonomy-annotated BIOM files, but I suspect I misread. Will keep my answer for that case here though, just in case!

You can import taxonomy-annotated BIOM tables by changing the import type in your import command:

qiime tools import \
  --input-path my_hdf5.biom \
  --output-path taxonomy.qza \
  --source-format BIOMV210Format \
  --type "FeatureData[Taxonomy]"

If the BIOM file you are importing doesn’t have taxonomy annotations, QIIME 2 will error like this:

qiime tools import \
  --input-path foo/feature-table.biom \
  --output-path taxonomy.qza \
  --source-format BIOMV210Format \
  --type "FeatureData[Taxonomy]"
Traceback (most recent call last):
  File "/Users/matthew/.conda/envs/q2dev/lib/python3.5/site-packages/q2cli/tools.py", line 116, in import_data
    view_type=source_format)
  File "/Users/matthew/src/qiime2/qiime2/qiime2/sdk/result.py", line 218, in import_data
    return cls._from_view(type_, view, view_type, provenance_capture)
  File "/Users/matthew/src/qiime2/qiime2/qiime2/sdk/result.py", line 243, in _from_view
    result = transformation(view)
  File "/Users/matthew/src/qiime2/qiime2/qiime2/core/transform.py", line 70, in transformation
    new_view = transformer(view)
  File "/Users/matthew/src/qiime2/qiime2/qiime2/core/transform.py", line 220, in wrapped
    file_view = transformer(view)
  File "/Users/matthew/.conda/envs/q2dev/lib/python3.5/site-packages/q2_types/feature_data/_transformer.py", line 218, in _27
    return _biom_to_tsv_taxonomy_format(table)
  File "/Users/matthew/.conda/envs/q2dev/lib/python3.5/site-packages/q2_types/feature_data/_transformer.py", line 136, in _biom_to_tsv_taxonomy_format
    raise TypeError('Table must have observation metadata.')
TypeError: Table must have observation metadata.

An unexpected error has occurred:

  Table must have observation metadata.

See above for debug info.

Thanks @thermokarst for your answer. Best!

1 Like

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