Biplot on a NMIT table

Hello,

I'm working with a set of longitudinal samples for which I have 5 timepoints and two groups. I was able to successfully run NMIT analysis and have a PCoA of my two groups. I was looking through the documentation to see if I could make a biplot for that PCoA plot to determine the taxa that are driving the change between the groups. When I try and run the biplot it yells that the samples must be the same. I'm assuming the issue comes from the NMIT compressing the different sample timepoints into one sample instance. If this is correct, is there any way around it? Or is there another recommendation to determine which taxa are driving the differences in the population?

Here are the commands I've run to get to this point:
Collapse table to genus and relative abundance

qiime taxa collapse --i-table filt_grp1_grp3_min2samp.qza --i-taxonomy ../../taxonomy_silva_138-99.qza --p-level 6 --o-collapsed-table coll_filt_grp1_grp3_min2samp_L6.qza`

qiime feature-table relative-frequency --i-table coll_filt_grp1_grp3_min2samp_L6.qza --o-relative-frequency-table rel_freq_coll_filt_grp1_grp3_min2samp_L6.qza

Run NMIT with Kendall correlation

qiime longitudinal nmit --i-table rel_freq_coll_filt_grp1_grp3_min2samp_L6.qza --m-metadata-file ../../mapping_file.txt --p-individual-id-column RatID --p-corr-method kendall --o-distance-matrix nmit-dm_kendall.qza

Test NMIT distance matrix for significance

qiime diversity beta-group-significance --i-distance-matrix nmit-dm_kendall.qza --m-metadata-file ../../mapping_file.txt --m-metadata-column Radiation_status --o-visualization vis_nmit_kendall_radiation.qzv

Generate PCoA and visualize

qiime diversity pcoa --i-distance-matrix nmit-dm_kendall.qza --o-pcoa nmit_kendall_radiation_pcoa.qza

qiime emperor plot --i-pcoa nmit_kendall_radiation_pcoa.qza --m-metadata-file ../../mapping_file.txt --o-visualization vis_nmit_kendall_radiation_pcoa.qzv

I then tried to generate the biplot with this command (using the same relative abundance table that went into the NMIT command).

qiime diversity pcoa-biplot --i-pcoa nmit_kendall_radiation_pcoa.qza --i-features rel_freq_coll_filt_grp1_grp3_min2samp_L6.qza --o-biplot nmit_kendall_radat
ion_biplot.qza

This gives me the error that "The eigenvectors and the descriptors must describe the same samples." Is there any way around this/a better method?

Any insight into this would be greatly appreciated!
Thanks,
Samantha

Hi @saatkinson ,

Yes, that's correct! nmit generates distances between subjects, not between samples, so not all samples are represented in the distance matrix.

So I am not sure that there is a really good workaround, but just an idea you could try (probably with a new set of issues):

  1. group the feature table by subject with feature-table group
  2. rename the sample IDs with feature-table rename-ids to match the IDs in the distance matrix
  3. try biplot again.

I am not sure if that will work but it's worth a try!

1 Like

Hi @Nicholas_Bokulich ,

This was exactly what I needed! Thanks so much for the help :smile:

For anyone wanting to do this for themselves, here are the steps I took:

  1. Group the frequency table (grouping doesn't work for relative abundance table) by sample number with feature-table group

  2. Rename IDs with feature-table rename-ids. I had to generate a small mapping file with a one-to-one conversion of the sampleID to the desired ID (duplicates aren't allowed).

  3. Collapse to desired level and convert to relative abundance with taxa collapse and feature-table relative-frequency, respectively

  4. Run biplot with diversity pcoa-biplot

  5. View with emperor biplot

~Samantha

2 Likes

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