Create OTU table from table.qza & taxonomy.qza

Hello,

I have a quick question. I want to create a regular OTU table, containing the table.qza file and the taxonomy.qza file so that I can create an NMDS in R.

I followed the tutorials, here, and here just to see if they did anything different, but I ended up with the same file, but not exactly what I needed, since the taxonomy is not associated with any of the OTU ID's.

Since I have both the taxonomy file and the table.qza file already exported as .tsv files, is there a way for me to create an OTU table? I can't seem to figure out what OTU ID belongs to which sample or else, I would do this in excel, although this would be an incredible amount of work.

Any help is greatly appreciated.

Thanks

1 Like

Hi @Fabs,
Have a look here, I think this covers what you’re trying to do.

1 Like

Thank you, I am not sure how I missed this post.

I will message you guys back, if I get stumped, hope that’s okay.

1 Like

Yeih, it worked!

Last question, since I am exporting the table.qza and attached it to the taxonomy.qza, I want to know if the output is then the rarified table and or if I still need to perform this work and standardize it prior to creating a distance matrix, and or can I also export the bray-curtis distance matrix created in qiime for the NMDS?

HI @Fabs,
Your table.qza is not rarefied unless you specifically rarefied it using the feature-table rarefy function. So you will want to either rarefy or normalize this table with your preferred method once in R.
When you use the core-metrics methods however you are required to give a sampling depth. As so, the output distance matrices produced from this command (which includes a Bray-Curtis distance matrix) are based on that rarefied value. So no further normalizing is required if you use these in R. Note, your original table is not altered here though.
If you’re planning on normalizing your feature table instead of rarefying in R, you should normalize them first then calculate Bray-Curtis distances.
P.s. check out this cool tool for getting qiime2 artifacts into R easily.

1 Like

Perfect, so I can rarefy the table here with the feature-table rarefy, export that table as you previously mentioned and use the Bray-Curtis dissimilarity matrix created here in R so that everything is the same.

I will try this and hope I do it correctly, thanks and thank you for the link.

Quick question,

If I rarefy the table in Qiime and then export it to use in R, I can use the Bray-Curtis created in Qiime using the core-metrics command, right?

On another note"
I attempted to run the commands on the R link you mentioned, and the read_qza and I receive an error
function not found.

Do you know if this function still works?

Hi @Fabs,

Correct. Core-metrics will will create distance matrices based on the rarefied value you put in the --p-sampling-depth parameter without altering the original feature-table. If you want the table to be rarefied, use the feature-table rarefy command itself.

As far as I know it should still work. Could you start a new topic under the 'Other Bioinformatics Tools' section with details of your error and we'll ping the creator of the plugin for help.

2 Likes

Just to clarify, diversity core-metrics and diversity core-metrics-phylogenetic both return the rarefied table used for computing the DMs:

  --o-rarefied-table ARTIFACT PATH FeatureTable[Frequency]
                                  The resulting rarefied feature table.
                                  [required if not passing --output-dir]
2 Likes

Thanks.

I will try to update R, and then add qiime2R again and try the command and see if it works. If it does not, I will start a new thread.

Thanks and thanks for the clarification.

Sorry, I have one more question.

Since Qiime already calculated both alpha and Beta diversity, can I just use this info and plot it in an NMDS in R-studio, without having to go through the entire process of recalculating these metrics? If so, what files would I use to do this?

My apologies for the multiple questions, but I am currently doing this in R so I figured I’d ask.

absolutely. Export the distance matrix for beta diversity, and export the alpha diversity vectors (e.g., outputs of diversity alpha or diversity core-metrics).

Good luck!

2 Likes

This is so much better than recreating everything, thanks a million :slight_smile:

An off-topic reply has been split into a new topic: Wisconsin standardization on rarefied data?

Please keep replies on-topic in the future.

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