getGeneClass: Extracting gene classes from SRST2-formatted allele IDs.

View source: R/func__getGeneClasses.R

getGeneClassR Documentation

Extracting gene classes from SRST2-formatted allele IDs.

Description

SRST2 defines each allele ID using several fields: [sequence cluster ID]__[cluster symbol (the name of a gene, product class or group)]__[gene or allele name]__[sequence ID] [additional annotations separated by ";"]. For instance, a valid sequence ID is: 225__SulI_Sul__SulI__1616 no;no;SulI;Sul;U37105;4069-4908;840. Usually, the cluster symbol is the antimicrobial class for an antimicrobial resistance gene. This function aims to extract this symbol from the allele ID. It is a simple function, however, this package includes it because of its frequent usage.

Usage

getGeneClass(ids)

Arguments

ids

A character vector of allele IDs.

Author(s)

Yu Wan (wanyuac@126.com)

Examples

assoc <- lmm(...)
arg_cls <- data.frame(allele = assoc$mapping$allele, class = getGeneClass(x = assoc$mapping$gene), stringsAsFactors = FALSE)


wanyuac/GeneMates documentation built on Aug. 12, 2022, 7:37 a.m.