Procrustes error


(Jacqueline B) #1

Hi all,

I’ve been searching for the answer to this question but I haven’t been able to find a solution. I’m a really novice qiime2 user - comfortable with the moving pictures tutorial but over my head when it comes to pretty much everything else! It has been suggested to me by a colleague that I look at performing a procrustes-plot/procrustes analysis. I see that this is a feature that was brought back in qiime2 so I have been attempting to follow the directions - however I’ve hit a wall!

I’m currently running qiime2-2018.11, native install on MacOS/conda environment.

I’ve filtered my table to two timepoints: initial and final. I then ran coremetrics on both the final and the initial and I have been using the results of those two PCoA plots to attempt my procrustes. The exact code I am running is:

qiime emperor procrustes-plot
–i-reference-pcoa bray_curtis_pcoa_results_initial.qza
–i-other-pcoa bray_curtis_pcoa_results_final.qza
–m-metadata-file metadata.tsv
–o-visualization procrustes_plot.qzv

The error I am receiving when I run this code is:

Plugin error from emperor:

The ordination at index (0) does not represent the exact same samples. Mismatches are: A30, A52, A40, A35, A49, A31, A32, A34, A42, A48, A37, A50, A39, A45, A51, A29, A41, A53, A38, A33, A36, A46, A44, A08, A47, A07.

Thanks in advance…
J


(Matthew Ryan Dillon) assigned thermokarst #2

(Matthew Ryan Dillon) #3

Hey there @turtleonaleash! :turtle:

The problem here is that the sample IDs need to be the same in both bray_curtis_pcoa_results_initial.qza and bray_curtis_pcoa_results_final.qza in order for this viz to work. One way to do that is to relabel the sample ids in your filtered feature tables.

# Example QIIME 2 Sample Metadata
sample-id	time		pairingid
a		initial		sample1
b		final		sample1
c		initial		sample2
d		final		sample2
e		initial		sample3
f		final		sample3
# create "initial" feature table
qiime feature-table filter-samples \
    --i-table table.qza \
    --m-metadata-file md.tsv \
    --p-where "time='initial'" \
    --o-filtered-table initial-table.qza
# this file should have samples a, c, e

# create "final" feature table
qiime feature-table filter-samples \
    --i-table table.qza \
    --m-metadata-file md.tsv \
    --p-where "time='final'" \
    --o-filtered-table final-table.qza
# this file should have samples b, d, f

# relabel sample ids in initial table
qiime feature-table group \
    --i-table initial-table.qza \
    --p-axis sample \
    --m-metadata-file md.tsv \
    --m-metadata-column pairingid \
    --p-mode sum \
    --o-grouped-table initial-table-relabeled.qza
# this file should have samples sample1, sample2, sample3 (corresponding to a, c, e)

# relabel sample ids in final table
qiime feature-table group \
    --i-table final-table.qza \
    --p-axis sample \
    --m-metadata-file md.tsv \
    --m-metadata-column pairingid \
    --p-mode sum \
    --o-grouped-table final-table-relabeled.qza
# this file should have samples sample1, sample2, sample3 (corresponding to b, d, f)

Now, use the newly relabeled tables to run your core-metrics (x2) (don’t forget to choose the same even sampling depth). Also, you will need to create a new metadata file for this step, one with the new “pairingid” as your main “id” column.

Keep us posted! :qiime2: :t_rex:


(Matthew Ryan Dillon) unassigned thermokarst #4

(Jacqueline B) #5

Thank you so much for the response! I will try it out and let you know how it goes! :grinning:


(Jacqueline B) #6

This worked like a charm! Thanks so much! :slight_smile: