Hi @ecg and @timanix,
The observed alpha and beta diversity is a function of the features in a sample. So, if you filter features or re-normalize the data, you must re-calculate diversity. If you want to change the samples, you must filter before QIIME visualization. (Alpha/Beta group significance, Adonis, PCoA, longitudinal analysis). In general, I suggest calculating your diversity once, because it tends to be computationally expensive and potentially slow. Then, I filtered and do the visualization/testing (which is quick).
The alpha diversity is independent of other samples (within-sample diversity). So, you can filter the alpha diversity. I don’t think there’s a specific way to do this, so I might try passing your filtered metadata into an analysis and hopefully it should just filtered down to the intersection of samples.
Beta diversity is a little bit more complicated.
The beta diversity is dependent on the pair of samples, but if I calculate distance on A vs B, that won’t affect A vs C. (Although A,B, and C are all constrained.) So, i you can just filter the sample out of the beta diversity distance matrix (try filter-distance-matrix
).
You will need to re-calculate your pcoa, since pcoa is dependent on the samples. You can do that with the pcoa
method and then pass in emperor’s plotting method. (These are the methods that sit underneath core metrics).
The one exception to this rule is that if you’re running DECOIDE of Gimilli, you need to re-calculate since those are ordinations and dependent on both the samples and features.
Best,
Justine