IQR.filter: IQR (interquartile range) filter to extract genes from...

View source: R/pipeline_functions.R

IQR.filterR Documentation

IQR (interquartile range) filter to extract genes from expression matrix

Description

IQR.filter is a function to extract genes from the expression matrix by setting threshold to their IQR value. IQR (interquartile range) is a measure of statistical dispersion. It is calculated for each gene across all the samples. By setting threshold value, genes with certain statistical dispersion across samples will be filtered out. This step is mainly used to perform sample cluster and to prepare the input for SJAracne.

Usage

IQR.filter(
  exp_mat,
  use_genes = rownames(exp_mat),
  thre = 0.5,
  loose_gene = NULL,
  loose_thre = 0.1
)

Arguments

exp_mat

matrix, the gene expression matrix. Each row represents a gene/transcript/probe, each column represents a sample.

use_genes

a vector of characters, the gene list needed to be filtered. Default is the row names of exp_mat.

thre

numeric, the threshold for IQR of the genes in use_genes. Default is 0.5.

loose_gene

a vector of characters, the gene list that only need to pass the loose_thre. This parameter is designed for the input of possible drivers used in SJAracne. Default is NULL.

loose_thre

numeric, the threshold for IQR of the genes in loose_gene. Default is 0.1.

Value

Return a vector with logical values indicate which genes should be kept.

Examples

mat1 <- matrix(rnorm(15000),nrow=1500,ncol=10)
colnames(mat1) <- paste0('Sample',1:ncol(mat1))
rownames(mat1) <- paste0('Gene',1:nrow(mat1))
choose1 <- IQR.filter(mat1,thre=0.5,
                     loose_gene=paste0('Gene',1:100))

jyyulab/NetBID documentation built on Dec. 23, 2024, 6:34 a.m.