Hello!
I've been using Qiime2R to plot PCoAfor my data. This is the code I have so far:
metadata<-read_q2metadata("Metadata.tsv")
wunifrac<-read_qza("weighted_unifrac_pcoa_results.qza")
shannon<-read_qza("shannon_vector.qza")$data %>% rownames_to_column("SampleID")
wunifrac$data$Vectors %>%
select(SampleID, PC1, PC2) %>%
left_join(metadata) %>%
left_join(shannon) %>%
ggplot(aes(x=PC1, y=PC2, color=Time-Point
, size=shannon_entropy)) +
geom_point(alpha=0.5) + #alpha controls transparency and helps when points are overlapping
xlab(paste(round(100wunifrac$data$ProportionExplained[1],2),"%")) +
ylab(paste(round(100wunifrac$data$ProportionExplained[2],2),"%")) +
theme_q2r() +
scale_size_continuous(name="Shannon Diversity") +
scale_color_discrete(name="Time Point") +
stat_ellipse() + #Adds confidence interval ellipses
ggtitle("Jackson C57BL/6 Mice i.p injected with 100 ug of curli twice a week")
I've managed to have PC1 and PC2 in my graph, which is great, but I was wondering if it were possible to add a third axis like in emperor in Qiime2R?
On a separate note, I was wondering if it were possible to figure out what exactly is causing the difference in my data points. I understand that PC1 and PC2 percentile is describing the proportion of difference in the data set, but is it possible to understand which featureID/taxa is causing this?
Please let me know!