R/cleave-functions.R

Defines functions .cleave

.cleave <- function(x, enzym="trypsin", missedCleavages=0L,
                    custom=NULL, unique=TRUE) {

  pos <- .cleavageRanges(x=x, enzym=enzym, custom=custom,
                         missedCleavages=missedCleavages)

  peptides <- mapply(function(xx, r)substring(xx, r[,1L], r[,2L]),
                     xx=x, r=pos, SIMPLIFY=FALSE, USE.NAMES=TRUE)

  if (unique) {
    peptides <- lapply(peptides, unique)
  }
  peptides
}

Try the cleaver package in your browser

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

cleaver documentation built on Nov. 8, 2020, 7:20 p.m.