| batch_pcc | R Documentation |
Computes partial correlation coefficients between multiple features and a target variable while controlling for an interference (confounding) variable. Adjusts p-values for multiple testing using the Benjamini-Hochberg method.
batch_pcc(
input,
interferenceid,
target,
features,
method = c("pearson", "spearman", "kendall")
)
input |
Data frame containing feature variables, target variable, and interference variable. |
interferenceid |
Character string specifying the column name of the interference (confounding) variable to control for. |
target |
Character string specifying the column name of the target variable. |
features |
Character vector specifying the column names of feature variables to correlate with the target. |
method |
Character string specifying the correlation method. Options are '"pearson"', '"spearman"', or '"kendall"'. Default is '"pearson"'. |
Tibble containing the following columns for each feature:
Feature name
Raw p-value
Partial correlation coefficient
Adjusted p-value (Benjamini-Hochberg method)
Negative log10-transformed p-value
Significance stars: **** p.adj<0.0001, *** p.adj<0.001, ** p.adj<0.01, * p.adj<0.05, + p.adj<0.5
Rongfang Shen
# Create small example data
set.seed(123)
test_data <- data.frame(
TumorPurity = runif(100),
TargetVar = rnorm(100),
Signature1 = rnorm(100),
Signature2 = rnorm(100)
)
# Calculate partial correlations controlling for tumor purity
res <- batch_pcc(
input = test_data,
interferenceid = "TumorPurity",
target = "TargetVar",
method = "pearson",
features = c("Signature1", "Signature2")
)
head(res)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.