plotCorr: Show DE/DM state correlation between cell types

View source: R/plotCorr.R

plotCorrR Documentation

Show DE/DM state correlation between cell types

Description

This function generates -log10 transformed p-values for each pair of cell types and calculate corresponding Pearson correlation and odds ratio - a modification of function 'ggpairs' in package 'GGally'.

Usage

plotCorr(pval, de.state=NULL, pval.thres=NULL, fdr.thres=NULL, p.size = 0.2,
         p.color = grDevices::adjustcolor( "black", alpha.f = 0.2),
         fig.margin = c(1,1,1,1),
         fig.margin.unit = 'in', line.type = 'dashed', line.color = 'blue')

Arguments

pval

matrix of p-values, with rows representing features and columns representing cell types.

de.state

(optional) matrix of DE/DM states (1: DE/DM, 0:non-DE/DM), with rows representing features and columns representing cell types.

pval.thres

threshold of p-value to define DE/DM, required if de.state not provided.

fdr.thres

threshold of FDR to define DE/DM, required if de.state not provided and FDR is prefered than p-value.

p.size

point size for scatter plot

p.color

point color for scatter plot

fig.margin

figure margin

fig.margin.unit

unit of figure margin

line.type

line type in scatter plot

line.color

line color in scater plot

Value

A figure contains scatter plots, Pearson correlaiton and odds ration of -log10 transformed p-values for each pair of cell types.

Author(s)

Luxiao Chen <luxiao.chen@emory.edu>

Examples

pval.1 <- runif(1000,0,1)
pval.2 <- pval.1 + rnorm(1000,0,0.01)
pval.2[pval.2 < 0] =0
pval.3 <- runif(1000,0,1)

pval.input <- data.frame('cell.1'=pval.1,
                         'cell.2'=pval.2,
                         'cell.3'=pval.3)

plotCorr(pval = pval.input, pval.thres = 0.05)

ziyili20/TOAST documentation built on Aug. 28, 2022, 11:28 a.m.