RemoveSparseFeatures: Removes features with a lot of 0 counts

Description Usage Arguments Value Examples

View source: R/RemoveSparseFeatures.R

Description

This function deals with zero counts in the counts dataset. If for a feature, the proportion of zeros across the samples is greater than filter_prop, then we remove the feature.

Usage

1
RemoveSparseFeatures(data, filter_prop = 0.9)

Arguments

data

count data in a sample by feature matrix.

filter_prop

threshold proportion. If the proportion of zeros for the feature exceeds this threshold then we remove the feature altogether. Default is 0.9.

Value

Returns a list with

data

filtered data with sparse features removed

sparse_features

the feature names of the features found sparse and removed

Examples

1
2
3
mat <- rbind(c(2,0,3,0,4),c(4,5,5,0,0),c(30,34,63,25,0),c(0,0,0,0,0));
RemoveSparseFeatures(mat, filter_prop = 0.5)
RemoveSparseFeatures(mat)

kkdey/CountClust documentation built on Jan. 17, 2021, 5:32 p.m.