filter_expr: Filter a gene expression data.frame

Description Usage Arguments Details Value Examples

Description

Filter a gene expression data.frame

Usage

1
filter_genes(expr, pct = 0.75, apply_vst = FALSE)

Arguments

expr

A data.frame containing expression data

pct

Percentage of most expressed genes to keep.

apply_vst

Logical. If TRUE, will apply variance stabilizing transform before filtering data.

Details

This function takes a gene expression data.frame and applies a percentage filter (keeps the pct) most expressed genes). If apply_vst is TRUE, a variance stabilizing transformation is applied on gene expression values as long as mean and variance values have a Spearman's rho of over 0.5. This transformation is intended to remove this dependence between the parameters. One should then apply the select_genes function to get significant genes.

Value

A data.frame containing filtered expression data

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# Get example expression data
data(expr0)
# Filter genes
expr_f <- filter_genes(expr0)
# Check selected genes
expr_f[1:5, 1:5]
# Filter genes and apply variance stabilizing transformation
expr_f2 <- filter_genes(expr0, apply_vst=TRUE)
# Check results
expr_f2[1:5, 1:5]
# Selected genes
selected <- select_genes(expr_f2)
# Get data.frame with only selected genes
expr_s <- expr_f2[selected, ]
# Check results
expr_s[1:5, 1:5]

Example output

Warning message:
replacing previous importggplot2::annotatebyggpmisc::annotatewhen loadingCEMiToolX1913_d0 X1913_d3 X1913_d7 X1911_d0 X1911_d3
HBB     13.19873 14.92036 14.98221 13.78113 14.76081
HBA2    13.76894 14.96412 14.98703 13.67176 14.78928
KRT123P 12.92786 14.79587 14.83737 13.52328 14.66080
HBA1    12.16379 14.86128 14.87355 12.31662 14.38398
DUSP1   12.92282 13.84120 14.04626 13.20706 13.69986
        X1913_d0 X1913_d3 X1913_d7 X1911_d0 X1911_d3
HBB     13.19873 14.92036 14.98221 13.78113 14.76081
HBA2    13.76894 14.96412 14.98703 13.67176 14.78928
KRT123P 12.92786 14.79587 14.83737 13.52328 14.66080
HBA1    12.16379 14.86128 14.87355 12.31662 14.38398
DUSP1   12.92282 13.84120 14.04626 13.20706 13.69986
          X1913_d0  X1913_d3 X1913_d7 X1911_d0 X1911_d3
HBA1      12.16379 14.861276 14.87355 12.31662 14.38398
RPS26     11.13540  9.663552  9.62106 12.06424 12.15919
LYZ       11.56361 12.413904 11.29802 12.85029 12.31579
PPBP      12.61296 12.955377 13.82550 12.02593 10.84787
abParts35 11.50589 11.699947 11.43535 11.30181 12.22802

CEMiTool documentation built on March 13, 2021, 2 a.m.