FMT Tutorial Pairwise Difference Comparisons

I am doing the longitudinal pairwise-differences to answer question 1d.

Here are my commands which I have done similarly to the longitudinal tutorial:

qiime longitudinal pairwise-differences
–m-metadata-file sample-metadata.tsv
–m-metadata-file core-metrics-results/shannon_vector.qza
–p-metric shannon
–p-group-column subject-id
–p-state-column week
–p-state-1 0
–p-state-2 18
–p-individual-id-column subject-id
–p-replicate-handling random
–o-visualization pairwise-differences.qzv

But I received this:
Plugin error from longitudinal:

individual_id_column, group_column, state_column, and metric must all be set to unique values.

I do not understand this. What have I done wrongly?

1 Like

You used subject-id as both the individual-id-column (which is correct) and the group-column (which should specify which treatment-group the subjects are in: FMT or control)

I hope that helps!

1 Like

Thank you for your help. When I changed the group_column from subject-id to treatment (which makes more sense), I received the message:
Plugin error from longitudinal:

  • State 0.0 is not represented by any members of donor group in metadata. Consider using a different group_column or state value.*

That is true as there is only -1 for week in donor. How do I solve this problem? Do I exclude the donor group? Thanks again!

Yes

hope that helps!

1 Like

Apologies for the many questions. But how do exclude the donor group, or subset the group column?

No worries :smile:

have you seen the filtering tutorial? See this section for examples:
https://docs.qiime2.org/2019.7/tutorials/filtering/#metadata-based-filtering

2 Likes

Hello, I am also really confused on this question. I have run this code to filter the table to exclude the donor group

qiime feature-table filter-samples
–i-table table.qza
–m-metadata-file sample-metadata.tsv
–p-where “[treatment-group] IN (‘control’, ‘treatment’)”
–o-filtered-table treatment-filtered-table.qza

and then run this code to do the pairways analysis

qiime longitudinal pairwise-differences
–m-metadata-file treatment-filtered-table.qza
–m-metadata-file shannon_vector.qza
–p-metric shannon
–p-group-column treatment-group
–p-state-column week
–p-state-1 0
–p-state-2 18
–p-individual-id-column subject-id
–p-replicate-handling random
–o-visualization pairwise-differences.qzv

and I get a plugin error which says ‘subject-id is not a column in your metadata’. I think there is a problem with my filtering but I don’t know what I’ve done wrong.

Thank you for your help!

Welcome to the forum, @Bethanie!

See the slight differences in your command vs. @YinXun's above:

You are inputting the filtered feature table, rather than the sample metadata file, so indeed as the error message indicates:

Swap in the sample metadata instead of the feature table and you should be good to go!

(but you have inadvertently discovered one of the neat secrets of QIIME 2: feature tables can be input as metadata, which is useful for some commands)

1 Like

Thank you so much @Nicholas_Bokulich!! I am trying to teach myself so it is a bit of a learning curve!!

So when I input the sample metadata file instead of my filtered feature table, I get the error message which says that it hasn’t been filtered and that there’s no 0.0 in the donor group.

How do I filter the metadata in a way that it can still be inputted into the pairways analysis?

Thank you!!

1 Like

The best way to filter a sample metadata file is just to delete the rows that you don't want. You can do this quickly with grep:

grep -v 'donor' sample-metadata.tsv > filtered-sample-metadata.tsv

(that will remove rows that say "donor" anywhere in the row, and output a new metadata file that you can use... whether or not that works for the pairwise-differences command in the context of the data you are inputting I do not know so you may need to adjust this... also note it is case-sensitive so may need to be adjusted :smile:)

1 Like

Thank you so much!!! It has worked!! I have been stuck on this command for 4 days now so I am very happy :smiley: :smiley:

1 Like

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