plot_pcoa | R Documentation |
This is a simple PCoA function that colours all points by one metadata variable. It can be helpful to visualise metadata variables independently when assessing potential confounding metadtaa factors
plot_pcoa(relab, met, colour = NULL, shape = NULL, CI = 0.95)
relab |
dataframe. relative abundance data with features in rows and samples in columns. feature IDs in rowname. |
met |
dataframe. metadata with samples in rows. sample IDs in rowname |
colour |
string. defulat NULL. metadata variable to colour points by |
shape |
string. default NULL. metadata variable to set shape of points by |
CI |
numeric. Default 0.95. Confidence interval used to draw ellipse around colour variable. set to NULL to omit drawing ellipse |
data(dss_example)
met_df <- dss_example$metadata
count_df <- dss_example$merged_abundance_id %>%
column_to_rownames('featureID')
count_df <- count_df[,met_df$sampleID]
relab <- relab(count_df)
iter_var <- c('Genotype','Phenotype')
for(i in iter_var) {
plot_pcoa(relab, met_df, colour = i)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.