degCovariates {DEGreport} | R Documentation |
This function will calculate the pcs using prcomp function, and correlate categorical and numerical variables from metadata.
degCovariates(counts, metadata, fdr = 0.1, scale = FALSE, min_pc_pct = 5, correlation = "spearman", plot = TRUE)
counts |
normalized counts matrix |
metadata |
data.frame with samples metadata. |
fdr |
numeric value to use as cutoff to determine the minimum fdr to consider significant correlations between pcs and covariates. |
scale |
boolean to determine wether counts matrix should be scaled for pca. default FALSE. |
min_pc_pct |
numeric value that will be used as cutoff to select only pcs that explain more variability than this. |
correlation |
character determining the method for the correlation between pcs and covariates. |
plot |
Whether to plot or not the correlation matrix. |
: list: a) significantCovars, covariates with FDR below the cutoff. b) plot, heatmap of the correlation found. c) corMatrix, correlation, p-value, FDR values for each covariate and PCA pais d) effectsSignificantcovars: that is PCs correlation between covariate and PCs, e) pcsMatrix: PCs loading for each sample
: Lorena Pantano, Kenneth Daily and Thanneer Malai Perumal
data(humanGender) library(DESeq2) idx <- c(1:10, 75:85) dse <- DESeqDataSetFromMatrix(assays(humanGender)[[1]][1:1000, idx], colData(humanGender)[idx,], design=~group) res <- degCovariates(log2(counts(dse)+0.5), colData(dse)) res$plot res$scatterPlot[[1]]