March 8, 2023, 5:24pm
Hi, I'm relatively new to Qiime2R and I've been attempting to produce a PCoA figure in R based off the 'Plotting PCoA' section in the tutorial (linked below). However, I've run into a problem in that the sub-labels aren't being differentiated resulting in this output:
Tutorial: Integrating QIIME2 and R for data visualization and analysis using qiime2R (March 2020 Update v0.99.20)
The qiime artifact is a method for storing the input and outputs for QIIME2 along with associated metadata and provenance information about how the object was formed. This method of storing objects has a number of obvious advantages; however, on the surface it does not lend itself to easy import to R for the R-minded data scientist. In reality, the .qza file is a compres…
My metadata is :
Pilot metadata 5.txt (939 Bytes)
And my code:
metadata5<-read_q2metadata("Pilot metadata 5.txt")
shannon<-read_qza("shannon_vector.qza")$data %>% rownames_to_column("SampleID")
select(SampleID, PC1, PC2) %>%
ggplot(aes(x=PC1, y=PC2, color='age-class', shape='sex', size=shannon_entropy)) +
scale_shape_manual(values=c(16,1), name="Sex") +
scale_size_continuous(name="Shannon Diversity") +
I'm not sure why 'age class' and 'sex' are not being split as they are in the metadata. I've run the tutorial PCoA through and can reproduce that plot, and as far as I can tell my code is identical (except of course for the relevant filenames and metadata etc.) so I'm quite stuck.
Any help with this would be greatly appreciated!
Welcome to the forum!
Would you mind sharing your
shannon_vector.qza as well? You can PM me if you'd rather not share on the forum. It'll be much easier troubleshooting.
Also what version of qiime2R are you using?
March 8, 2023, 7:54pm
Thank you very much for your response.
I can share them, but preferably as a PM if that's ok, is there a way to do that via the forum?
I'm using qiime2R version 0.99.6
March 8, 2023, 8:34pm
I believe it is trying to use the literal text for the aesthetic rather than the variable column. Be careful with copy and pasting as I think slack for example will sometimes convert ` to ' .
March 8, 2023, 10:08pm
Amazing thank you, that's solved it!