R/is_unproductive.R

Defines functions is_unproductive

Documented in is_unproductive

is_unproductive <- function (data) {

if ( ! all( c("dna","pep") %in% names(data) ) )
  stop ("Missing DNA or peptides sequence(s) in the data.")

if ( class(data) == 'character' )
  data <- data.frame(t(data), stringsAsFactors=F)

unproductive_length     <- nchar(data$dna) %% 3 > 0
unproductive_stop       <- grepl ('\\*', data$pep)

return ( unproductive_length | unproductive_stop )
}
charles-plessy/clonotypeR.old documentation built on May 12, 2017, 2:19 a.m.