MyNixOS website logo
Description

Calculate Correlations and Estimate Causality.

This tool performs pairwise correlation analysis and estimate causality. Particularly, it is useful for detecting the metabolites that would be altered by the gut bacteria.

CausCor

"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.

Installation

CausCor can be installed from CRAN,

# From CRAN
install.packages("CausCor")

or from GitHub,

# From GitHub
devtools::install_github("sugym/CausCor")

Packages used

  • cowplot 1.1.1
  • dplyr 1.0.8
  • ggplot2 3.3.5
  • grDevices 4.1.3
  • magrittr 2.0.3
  • stats 4.1.3
  • utils 4.1.3
  • WriteXLS 6.4.0

Features

This package has following functions.

  • 2 type filtering functions to get correlation lists: filter_n(), filter_40()
    • All correlation coefficients and R2 scores are calculated by Overlap samples only. Overlap is a pair that both bacteria and metabolite abundance are non-zero.
    • 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.

  • Function to save the list as a text file: save_text()
  • Function to save the scatter plot showing the correlation of pairs in the list as a pdf file: plot_16()

Usage

Preparation

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.

Filtering

  • 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

Saving

  • Save the list by save_text().
# Example
# You can choose file type from "excel", "csv", "tsv"
save_text(list_n, "list_n.xlsx", "excel")
  • Save the scatter plot by plot_16().
# Example
plot16(microbiome_table, metabolome_table, list_n, "list_n.pdf")
Metadata

Version

0.1.3

License

Unknown

Platforms (77)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows