View source: R/correlate_with_expr.R
| correlate_with_expr | R Documentation |
Computes Pearson correlations between CNV segment means and RNA expression values for each gene present in both datasets. RNA data is log2-transformed prior to analysis. Three result files are written: all correlations, those with p-value < 0.05, and those with both p-value < 0.05 and correlation coefficient > 0.8.
correlate_with_expr(cnv_file, rna_file)
cnv_file |
Character. Path to the CNV matrix CSV file (output of
|
rna_file |
Character. Path to the RNA expression CSV file. Rows are genes; first column is gene names; remaining columns are sample IDs (trimmed to 12 characters for TCGA-style matching). |
Sample IDs in the RNA file are trimmed to 12 characters to match
TCGA-style identifiers. Infinite values from log2(0) are
replaced with 0. Pearson correlation is computed using
stats::cor.test with use = "complete.obs". This
function is cancer-type agnostic.
A named list with three data frames:
All computed Pearson correlations with
columns gene, cor_val, p.value.
Subset where p.value < 0.05.
Subset where p.value < 0.05 AND
cor_val > 0.8.
Results are also written to CSV files in the temporary directory.
Chin L, et al. (2011). Making sense of cancer genomic data. Genes Dev, 25(6):534-555.
cnv_file <- system.file("extdata", "cnv_matrix.csv", package = "RiskyCNV")
rna_file <- system.file("extdata", "rna_data.csv", package = "RiskyCNV")
results <- correlate_with_expr(
cnv_file = cnv_file,
rna_file = rna_file
)
head(results$all_correlations)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.