# Procrustes error

**URL:** https://forum.qiime2.org/t/procrustes-error/8125
**Category:** Technical Support
**Created:** [January 31, 2019, 8:56pm UTC](https://forum.qiime2.org/t/procrustes-error/8125 "2019-01-31T20:56:33Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![turtleonaleash](https://forum.qiime2.org/user_avatar/forum.qiime2.org/turtleonaleash/32/3771_2.png) [@turtleonaleash](https://forum.qiime2.org/u/turtleonaleash)
#### Post date: [January 31, 2019, 8:56pm UTC](https://forum.qiime2.org/t/procrustes-error/8125/1 "2019-01-31T20:56:33Z")

</div>

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

---

<div class="post-metadata">

### Author: ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)
#### Post date: [February 1, 2019, 3:21pm UTC](https://forum.qiime2.org/t/procrustes-error/8125/2 "2019-02-01T15:21:31Z")

</div>



---

<div class="post-metadata">

### Author: ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)
#### Post date: [February 1, 2019, 3:41pm UTC](https://forum.qiime2.org/t/procrustes-error/8125/3 "2019-02-01T15:41:11Z")

</div>

Hey there @turtleonaleash! 🐢

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.

```tsv
# 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

```

```bash
# 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: 🦖

---

<div class="post-metadata">

### Author: ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)
#### Post date: [February 1, 2019, 3:41pm UTC](https://forum.qiime2.org/t/procrustes-error/8125/4 "2019-02-01T15:41:14Z")

</div>



---

<div class="post-metadata">

### Author: ![turtleonaleash](https://forum.qiime2.org/user_avatar/forum.qiime2.org/turtleonaleash/32/3771_2.png) [@turtleonaleash](https://forum.qiime2.org/u/turtleonaleash)
#### Post date: [February 1, 2019, 5:03pm UTC](https://forum.qiime2.org/t/procrustes-error/8125/5 "2019-02-01T17:03:59Z")

</div>

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

---

<div class="post-metadata">

### Author: ![turtleonaleash](https://forum.qiime2.org/user_avatar/forum.qiime2.org/turtleonaleash/32/3771_2.png) [@turtleonaleash](https://forum.qiime2.org/u/turtleonaleash)
#### Post date: [February 7, 2019, 8:12pm UTC](https://forum.qiime2.org/t/procrustes-error/8125/6 "2019-02-07T20:12:11Z")

</div>

This worked like a charm! Thanks so much! 🙂
