Description Usage Arguments Value Examples
View source: R/correlationAnalysis.R
Get a dataframe of correlated ARGs and taxa using Spearman's Correlation
1 | getSpearmanCorrelation(data, ids = NA, taxon_level, taxon_ignore)
|
data |
A dataframe of combined non-subsampled mapping data and metadata |
ids |
A character vector of sample IDs |
taxon_level |
A string representing the taxon level to apply Spearman's Correlation, where k is Kingdom, p is Phylum, c is Class, o is Order, f is Family, g is Genus, s is Species and t is Strain |
taxon_ignore |
A string representing the taxon level to not include in Spearman's Correlation, where k is Kingdom, p is Phylum, c is Class, o is Order, f is Family, g is Genus, s is Species, t is Strain and "" is don't ignore any taxa. It has to be a taxon after taxon_level. |
A dataframe containing correlated ARGs and taxa, rho and adjusted p-values
1 2 3 4 5 | df_map <- readMappingData("/home/vicky/Documents/CHMI/Resistome-paper/resistomeAnalysis/db/MAPPING_DATA/nonsubsampled_merged.csv", without_US_duplicates = TRUE)
metaphlan <- read.csv("/home/vicky/Documents/CHMI/Resistome-paper/resistomeAnalysis/db/METAPHLAN/metaphlan.csv", stringsAsFactors = FALSE, row.names = 1)
metaphlan_rpkm <- combineMetaphlanandARG(df_map, metaphlan)
high_cor_uk_oral <- getSpearmanCorrelation(metaphlan_rpkm, ids = unique(df_map$ID[df_map$Cohort == "Twin" & df_map$sample_type == "saliva"]), taxon_level = "t", taxon_ignore = "@@")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.