R/searchPublished.R

Defines functions searchPublished

Documented in searchPublished

#' Search for T cell receptor beta CDR3 amino acid sequences with known antigen
#' specificity
#'
#' Search for published T cell receptor beta CDR3 amino acid sequences with
#' known antigen specificity in a list of data frames.
#'
#' @param study_table A tibble generated by the LymphoSeq2 functions
#' [readImmunoSeq()] or [productiveSeq()].  "junction_aa",
#' "duplicate_frequency", and "duplicate_count" are required columns.
#' @return Returns a tibble with each instance that a published TCR sequence
#' appeared along with additional information including antigen specificity,
#' epitope, HLA type, and PubMed ID (PMID) for the reference where the sequence
#' was characterized.
#' @examples
#' file_path <- system.file("extdata", "TCRB_sequencing",
#'  package = "LymphoSeq2")
#' study_table <- LymphoSeq2::readImmunoSeq(path = file_path, threads = 1)
#' study_table <- LymphoSeq2::topSeqs(study_table, top = 100)
#' amino_table <- LymphoSeq2::productiveSeq(study_table = study_table,
#'  aggregate = "junction_aa")
#' LymphoSeq2::searchPublished(amino_table)
#' @export
searchPublished <- function(study_table) {
  study_table <- dplyr::left_join(study_table, LymphoSeq2::publishedTRB,
    by = c("junction_aa" = "aminoAcid")
  )
  return(study_table)
}
shashidhar22/LymphoSeq2 documentation built on Jan. 16, 2024, 4:29 a.m.