R/CleanNAAnnotationDataframe.R

Defines functions CleanNAAnnotationDataframe

### 
### Function removing genes from annotation dataframe with NA in any of the selected annotation fields
### 

CleanNAAnnotationDataframe<-function(input_dataframe, selected_columns_list=c("chr", "start", "end", "strand")) {

any_na_annotations<-apply(input_dataframe[,selected_columns_list],1,FUN=function(x) {
return(any(is.na(x)))
})
input_dataframe<-input_dataframe[!(any_na_annotations),]

return(input_dataframe)

}

Try the PREDA package in your browser

Any scripts or data that you put into this service are public.

PREDA documentation built on Nov. 8, 2020, 7:40 p.m.