makeQueryTable: Separate Antibody/Antigen names into component parts

View source: R/makeQueryTable.R

makeQueryTableR Documentation

Separate Antibody/Antigen names into component parts

Description

Given a data.frame containing Antigen/Antibody names, reformat the names into possible gene names and return the data.frame in long format.

Usage

makeQueryTable(
  df,
  ab = "Antigen",
  id = "ID",
  control_col = NA,
  fun = NA,
  verbose = TRUE
)

Arguments

df

A data.frame or tibble.

ab

(character(1), default: "Antigen") Name of column in df containing antibody names

id

(default: "ID") Name of column in df containing IDs for each row.

control_col

(character(1), default: NA) Optional name of a logical column indicating whether an antibody is an isotype control. If present, controls will be removed to avoid spurious matches as they usually do not react against human genes.

fun

Optional custom function for formatting antigen names. Must take an argument "ab" giving the column name (as above) as its only argument. Other arguments can be prefilled e.g. with purrr::partial.

verbose

(logical, default: TRUE) If TRUE, prints a message when starting

Value

A tibble with columns containing the original ID, "name", the name of the formatting method that was applied, and "value", the result of applying the formatting method to the original antigen. The value "Antigen" in the name column contains the original antigen value, with some minor formatting such as converting Greek symbols to Latin characters.

Author(s)

Helen Lindsay

Examples

df <- data.frame(Antigen = c("KLRG1 (MAFA)", "KLRG1", "CD3 (CD3E)",
                            "HLA.A.B.C", "HLA-A/B/C", "NKAT2",
                            "CD66a.c.e", "CD66a_c_e", "CD11a/CD18 (LFA-1)"),
                ID = LETTERS[1:9])
makeQueryTable(df)

HelenLindsay/AbNames documentation built on June 6, 2023, 1:18 p.m.