R/designGroupSpecificPrimers.R

Defines functions designGroupSpecificPrimers

Documented in designGroupSpecificPrimers

designGroupSpecificPrimers  <- function(xstringset, groups, tiles, identifier='', dbConn, doAlign=T, ...) {
  #' Design group-specific primers
  #' @param fasta A connection object or a character string specifying the file path to the file containing the sequences, an XStringSet object if type is XStringSet, or a QualityScaledXStringSet object if type is QualityScaledXStringSet. Files compressed with gzip, bzip2, xz, or lzma compression are automatically detected and decompressed during import. Full URL paths (e.g., "http://" or "ftp://") to uncompressed text files or gzip compressed text files can also be used.
  #' @param groups Data frame containing information to be added to the dbFile.
  #' @param dbConn A SQLite connection object or a character string specifying the path to the database file.
  #' @param identifier Character string used to narrow the search results to those matching a specific identifier. Determines the target group(s) for which primers will be designed. If "" then all identifiers are selected.
  #' @export

  doAlignment <- function(xset) {
    useqs <- unique(xset)
    uidxs <- match(xset, useqs)
    aseqs <- AlignSeqs(useqs, verbose=F)
    aseqs[uidxs]
  }

  Seqs2DB(
    ifelse(
      !doAlign, xstringset,
      doAlignment(xstringset)
    ), "FASTA", dbConn, identifier
  )

  Add2DB(groups, dbConn)

  DesignPrimers(tiles = tiles, identifier = identifier, ...)
}
Chebuu/Design-Group-Specific-Primers documentation built on Aug. 17, 2020, 1:29 a.m.