Learn R Programming

IdMappingAnalysis (version 1.16.0)

DataFilter$minCountGroupConstraint: Perform minimum count based thresholding of an input vector subdivided into groups

Description

Perform minimum count based thresholding of an input vector subdivided into groups.

Usage

## Static method (use this): ## DataFilter$minCountGroupConstraint(X, filtParams, ...)
## Don't use the below: "minCountGroupConstraint"(static, X, filtParams, ...)

Arguments

X
filtParams
vector of constraint parameters. The filtParams[3] is a list of integer vectors, each containing the indexes of an input X vector data and thus defining the groups within the input vector. If the fraction of input elements for a given group (defined by filtParam[3]) which value is greater or equal filtParams[1] is less than filtParam[2], and if all groups satisfy this condition, then the input vector is replaced by NAs, otherwise it is kept intact.
...
Not used

Value

numeric vector or vector of NA 's depending on passing the constraints criteria.

See Also

For more information see DataFilter.

Examples

Run this code
 #derive sample groups from outcomes
 outcomes<-unique(examples$outcomeMap[,2]);
 groups<-list();
 for(outcome in outcomes)
	groups[[outcome]]<-which(examples$outcomeMap[,2]==outcome);

 #perform filtering by groups
 fltExperimentSet<-DataFilter$do.apply(examples$msmsExperimentSet,
   byRows=TRUE,filterFun=DataFilter$minCountGroupConstraint,filtParams=list(1,0.3,groups),verbose=TRUE);

 #print the number of rows set to NA
 sum(is.na(rowSums(fltExperimentSet[,-1])))
 

Run the code above in your browser using DataLab