"CausCor" is an R package for correlation analysis to estimate causality. Particularly, it is useful for detecting the metabolites that would be altered by the gut bacteria.
CausCor can be installed from CRAN,
# From CRAN install.packages("CausCor")
or from GitHub,
# From GitHub devtools::install_github("sugym/CausCor")
This package has following functions.
filter_n
, filter_40
, filter_cc
filter_n
is the filtering function with thresholds for Spearman correlation coefficient, Overlap, and R2 score.filter_40
is the more specialized function for causal estimation. Overlap is fixed between 40% and 60% of the total samples by default. (If necessary, you can change them.) And only extract the pattern that the samples who have the bacteria always have the metabolite in a certain pair.filter_cc
is a function that integrates filter_n
and filter_40
. You are free to select the threshold to use and whether or not to use directional filtering. We recommend using this function rather than the two above.save_text
plot_16
Prepare two category tables and read them as dataframe. The first column has the names of features, and second and subsequent columns have the values for each sample. The order of the samples must be aligned in the two datasets.
All filtering functions need microbiome table, metabolome table and two category names ("genus" and "metabolome", etc.).
filter_n
requires the setting of thresholds for Spearman correlation coefficient, Overlap, and R2 score.
# Example list_n <- filter_n(microbiome_table, metabolome_table, "genus", "metabolome", 0.6, # Spearman 5, # Overlap 0.3) # R2 Score
filter_40
requires the setting of thresholds for Spearman correlation coefficient and R2 score. If necessary, you can set minimum or maximum Overlap.# Example list_40 <- filter_40(microbiome_table, metabolome_table, "genus", "metabolome", 0.6, # Spearman 0.3) # R2 Score list_5to10 <- filter_40(microbiome_table, metabolome_table, "genus", "metabolome", 0.6, # Spearman 0.3, # R2 Score min_sample = 5, # minimum Overlap max_sample = 10) # maximum Overlap
filter_cc
requires the setting of minimum value of Spearman correlation coefficient and R2 score, minimum and maximum value of Overlap. You can select to extract only the association that a sample with a value in the x-axis category (bacteria) will always have a value in the y-axis category (metabolite). This feature is True by default.# Example list_cc <- filter_cc(microbiome_table, metabolome_table, "genus", "metabolome", min_cor = 0.6, # Spearman min_r2 = 0.3, # R2 Score min_sample = 5, # minimum Overlap max_sample = 10, # maximum Overlap direction = True) # select direction filtering
save_text
.# Example # You can choose file type from "excel", "csv", "tsv" save_text(list_n, "list_n.xlsx", "excel")
plot_16
. You can select to italicize the axis labels. Only the x-axis is italicized by default.# Example plot16(microbiome_table, metabolome_table, list_n, "list_n.pdf")
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4