Merging Error Table and RepSeq

Im trying to merge the table.qza and the rep.seq.qza but I get the following error:
"Cannot merge because there are no IDs shared across metadata objects "
How can this be? The tables were generated from the same run/analysis after dada2 plugin… Its not that I m trying to merge different anaylsis, shouldn t the metadata be the same? Am I using the wrong Plugin?

qiime feature-table merge
–i-tables table.qza
-i-tables rep-seqs.qza

Hi @stella
You must merge two or more tables each other and two or more ref-seqs each other with different commands!
This function you have used qiime feature-table merge is only for merging tables! you are not allowed to merge Table and ref-seq each other!
If you do not have more tables to merge and more ref-seq to merge, just go on the nest step analysis.
By the way, you should add an output parameter to your command that I do not see it!
Good luck

Hi @stella!

As @TurboQiimer pointed out, the feature-table merge command is for merging multiple feature tables together.

You do not need to "merge" or "join" your FeatureTable[Frequency] or FeatureData[Sequence] - QIIME 2 commands keep those two data types separated in downstream steps.

Was there something in particular you were trying to accomplish here? Please share more details, if so!


thanks for your reply

What I would like to create is a table with the features + respective sequences matches with the sample. Example:
Sample ID – Feature ID — Sequence
Is this somehow possible?

Hi @stella - you can "rename" the feature IDs using any valid feature metadata - including your FeatureData[Sequence]:

qiime feature-table rename-ids \
  --i-table table.qza \
  --m-metadata-file rep-seqs.qza \
  --m-metadata-column "Sequence" \
  --p-axis feature \
  --p-strict \
  --o-renamed-table renamed-table.qza \

Give that a shot and let us know how it goes.



Thanks :wink:

That’s not really what I need too.

I would like to have a new table showing the sequence and feature ID (like on the repseq table) as well as the frequency (as on the table.qza). In addition, I would like to have a column showing in which sample the sequence was found. Now I can only see on the table.qza the # of samples Observed in.

Hence, I would like to see the Sequences found on a sample resolution level.

The command I showed above was an example of how to rename the feature IDs - feel free to customize as you see fit. For example - export the FeatureData[Sequence], load in a spreadsheet editor, and create a new column with the ID labels you’re looking for. Then follow the protocol I outlined above, but be sure to change the metadata-file and metadata-column params as necessary.

This would need to be done outside of the FeatureTable[Frequency] => I would export the data and customize as necessary. I’ll point out too, you should be prepared for each feature to be seen in more than one sample - this kind of nested table usually leads to a lot of pain, in my experience.

1 Like

I just re-read this and I’m not sure I follow - an unmodified FeatureTable[Frequency] shows the number of times a feature was observed in each sample. In order to determine the “# of samples observed in” you would need to derive that from this table, using the “observed_features” alpha diversity metric, for example. You could also manually count up the number of samples that have counts > 0.

The orientation of the FeatureTable[Frequency] is samples as rows, and features as columns, btw.

1 Like

Ok, I m going to make an example.
I importd 8 samples. I see on the table.qzv that feature x has a Frequency of 389,179 and it also tell me that # of Samples Observed In is 7. I can now go to the repseq.qzv and check to which sequence the feature x corresponds.
What I m interested in, is to know in which 7 out of 8 samples the feature was present.
So I would like to know which sample was missing the feature x and the frequency of feautre x /sample. I assume the 389,179 refers to the 7 samples out of 8 total samples it appeared in…?

Great, thanks!

Ah, we were talking about two different things, you switched from talking about the FeatureTable[Frequency] data to the visualization produced by feature-table summarize. No worries!

First, you need to get your table in order:

qiime feature-table transpose \
  --i-table table.qza \
  --o-transposed-feature-table transposed-table.qza

qiime metadata tabulate \
  --m-input-file transposed-table.qza \
  --m-input-file rep-seqs.qza \
  --o-visualization merged.qzv

qiime tools export \
  --input-path merged.qzv \
  --output-path merged

Then, load the merged/metadata.tsv file in your favorite spreadsheet editor (or, if your favorite programming environment, I'll demonstrate here using Google Sheets):

Note the formula I entered at the top. This will show the samples that have observations corresponding to each individual feature.

An alternative visualization that gets the same information is feature-table heatmap:

qiime feature-table heatmap \
  --i-table table.qza \
  --m-feature-metadata-file rep-seqs.qza \
  --m-feature-metadata-column Sequence \
  --o-visualization heatmap.qzv

Hope that helps!



Great. This worked out all the way it should and was very helpful!
Would there also be a way to merge the Seqences of the rep-seq.qza with a collapsed taxonomy.qza file, lets say when collapsed at the genus level…?

No, because after a table is collapsed based on taxonomy, the individual features (taxa) do not map to any single sequence. Instead, you could merge your table with your taxonomy using the same qiime metadata tabulate command that @thermokarst demonstrated above, just include the taxonomy as an additional --m-input-file. Then taxonomy can be viewed (and searched in the resulting visualization) side-by-side with sequences and abundance.

1 Like

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