Skip to contents

Add a column to a data frame from the hgnc dataset

Usage

hgnc_join(
  .data,
  by = "hgnc_id",
  column = "symbol",
  one_to_many = FALSE,
  file = get_hgnc_file()
)

Arguments

.data

The data frame to join with

by

The column to join by, as in dplyr::left_join()

column

The column to add to the data frame from the HGNC dataset

one_to_many

A boolean value indicating whether cases where the 'by' column maps to multiple valuesof the selected column should be returned. If set to FASLE (the default), such one-to-many cases will yield NA. If set to TRUE, the returned column will be a list of vectors of varying length.

file

A file or URL of the complete HGNC data set (in TSV format), as used by import_hgnc_dataset().

Value

A data frame with the HGNC column added

Examples

if (FALSE) {
library(dplyr)
df <- tibble(hgnc_id = c("HGNC:44948", "HGNC:43240", "HGNC:23357", "HGNC:1855", "HGNC:39400"))

df %>%
 hgnc_join(by = 'hgnc_id', column = 'symbol') %>%
 hgnc_join(by = 'hgnc_id', column = 'entrez_id')
}