R/xcombr_db-methods.R

#' @include xcombr_db-generic.R xcombr_db.R
#'
#' @param x An \code{\link[Biostrings]{AAStringSet}} or \code{\link[Biostrings]{AAString}}
#' @param xlSpecificity Defines the crosslinker specificity. Case insensitive.
#' @param linkType Should intra and/or inter-protein crosslinks be considered?
#'   Must be either \code{"intra"}, \code{"inter"}, or \code{"both"}
#' @param minLength Minimum peptide length for either of the crosslinked
#'   peptides.
#' @param maxLength Maximum peptide length for either of the crosslinked
#'   peptides.
#' @param peptideTerminalLink Should crosslinks at terminal residues of peptides
#'   be considered?
#' @param proteinTerminalLink Should crosslinks at terminal residues of the proteins
#'   be considered?
#' @param customSpecificity Optional. Used if \code{xlSpecificity = "custom"}.
#'   Must be a character vector of length 2 containing regular expressions for specificity rules.
#' @param digest Locgical indicating the whether the input AAStringSet or AAString should be
#'   digested using \code{\link[cleaver]{cleave}}.
#' @param ... Arguments passed to \code{\link[cleaver]{cleave}} to indicate digestion
#'   settings.
#' @param max50 Limits the maximum number of proteins to 50.
#'
#' @value An \code{\link[Biostrings]{AAStringSet}} of peptide sequences generated using
#' the xComb algorithm.
#'

#' @rdname xcombr_db

setMethod(f="xcombr_db",
          signature=signature(x="AAString"),
          definition=function(x,
                              xlSpecificity = "Amine:Amine",
                              linkType = "both",
                              minLength = 6,
                              maxLength = 24,
                              peptideTerminalLink = FALSE,
                              proteinTerminalLink = TRUE,
                              customSpecificity = NULL,
                              digest = T,
                              ...,
                              max50 = TRUE) {


              x <- AAStringSet(x)
              names(x) <- "Sequence_1"

              .xcombr_db(x,
                         xlSpecificity = xlSpecificity,
                         linkType = linkType,
                         minLength = minLength,
                         maxLength = maxLength,
                         peptideTerminalLink = peptideTerminalLink,
                         proteinTerminalLink = proteinTerminalLink,
                         customSpecificity = customSpecificity,
                         digest = digest,
                         ...,
                         max50 = max50)
          })

#' @rdname xcombr_db

setMethod(f="xcombr_db",
          signature=signature(x="AAStringSet"),
          definition=function(x,
                              xlSpecificity = "Amine:Amine",
                              linkType = "both",
                              minLength = 6,
                              maxLength = 24,
                              peptideTerminalLink = FALSE,
                              proteinTerminalLink = TRUE,
                              cleavageRanges = NULL,
                              customSpecificity = NULL,
                              digest = T,
                              ...,
                              max50 = TRUE) {

              if(is.null(names(x))) {
                  names(x) <- paste0("Sequence_", 1:length(x))
              }


              .xcombr_db(x,
                         xlSpecificity = xlSpecificity,
                         linkType = linkType,
                         minLength = minLength,
                         maxLength = maxLength,
                         peptideTerminalLink = peptideTerminalLink,
                         proteinTerminalLink = proteinTerminalLink,
                         customSpecificity = customSpecificity,
                         digest = digest,
                         ...,
                         max50 = max50)
          })
wfondrie/xCombR documentation built on May 15, 2019, 5:34 p.m.