RemoveSparseFeatures {CountClust} | R Documentation |
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.
RemoveSparseFeatures(data, filter_prop = 0.9)
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. |
Returns a list with
data |
filtered data with sparse features removed |
sparse_features |
the feature names of the features found sparse and removed |
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)