feature_select: Feature selection

View source: R/feature_selection.R

feature_selectR Documentation

Feature selection

Description

Feature selection

Usage

feature_select(
  x,
  y,
  method = c("cor", "dif"),
  family = c("spearman", "pearson"),
  cutoff = NULL,
  padjcut = NULL
)

Arguments

x

input matrix.Rownames should be features like gene symbols or cgi, colnames be samples

y

response variable. Data type can be quantitative, binary and survival. Survival type can be generated through ?survival::Surv

method

Binary for method = "dif", quantitative response value for "dif" and "cor".

family

For method="cor", useser can choose "spearman" or "pearson" .

cutoff

Numeric. Estimate and log2FC cutoff value for correlation analysis and limma dif analysis.

padjcut

Numeric. Adjust P value cutoff.

Examples


data("crc_clin")
data("tcga_crc_exp")
mad <- apply(tcga_crc_exp, 1, mad)
tcga_crc_exp <- tcga_crc_exp[mad > 0.5, ]
pd1 <- as.numeric(tcga_crc_exp["PDCD1", ])
group <- ifelse(pd1 > mean(pd1), "high", "low")
pd1_cor <- feature_select(x = tcga_crc_exp, y = pd1, method = "cor", family = "pearson", padjcut = 0.05, cutoff = 0.5)
pd1_dif <- feature_select(x = tcga_crc_exp, y = pd1, method = "dif", padjcut = 0.05, cutoff = 2)
pd1_dif_2 <- feature_select(x = tcga_crc_exp, y = group, method = "dif", padjcut = 0.05, cutoff = 2)

IOBR/IOBR documentation built on April 4, 2024, 1:07 a.m.