Get Ig segment allele, gene and family names

Share:

Description

getSegment performs generic matching of delimited segment calls with a custom regular expression. getAllele, getGene and getFamily extract the allele, gene and family names, respectively, from a character vector of immunoglobulin (Ig) or TCR segment allele calls in IMGT format.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
getSegment(segment_call, segment_regex, first = TRUE, collapse = TRUE,
  strip_d = TRUE, sep = ",")

getAllele(segment_call, first = TRUE, collapse = TRUE, strip_d = TRUE,
  sep = ",")

getGene(segment_call, first = TRUE, collapse = TRUE, strip_d = TRUE,
  sep = ",")

getFamily(segment_call, first = TRUE, collapse = TRUE, strip_d = TRUE,
  sep = ",")

Arguments

segment_call

character vector containing segment calls delimited by commas.

segment_regex

string defining the segment match regular expression.

first

if TRUE return only the first call in segment_call; if FALSE return all calls delimited by commas.

collapse

if TRUE check for duplicates and return only unique segment assignments; if FALSE return all assignments (faster). Has no effect if first=TRUE.

strip_d

if TRUE remove the "D" from the end of gene annotations (denoting a duplicate gene in the locus); if FALSE do not alter gene names.

sep

character defining both the input and output segment call delimiter.

Value

A character vector containing allele, gene or family names.

References

http://imgt.org

See Also

countGenes

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
kappa_call <- c("Homsap IGKV1D-39*01 F,Homsap IGKV1-39*02 F,Homsap IGKV1-39*01",
                "Homsap IGKJ5*01 F")

getAllele(kappa_call)
getAllele(kappa_call, first=FALSE)
getAllele(kappa_call, first=FALSE, strip_d=FALSE)

getGene(kappa_call)
getGene(kappa_call, first=FALSE)
getGene(kappa_call, first=FALSE, strip_d=FALSE)

getFamily(kappa_call)
getFamily(kappa_call, first=FALSE)
getFamily(kappa_call, first=FALSE, collapse=FALSE)
getFamily(kappa_call, first=FALSE, strip_d=FALSE)

heavy_call <- c("Homsap IGHV1-69*01 F,Homsap IGHV1-69D*01 F", 
                "Homsap IGHD1-1*01 F", 
                "Homsap IGHJ1*01 F")

getAllele(heavy_call, first=FALSE)
getAllele(heavy_call, first=FALSE, strip_d=FALSE)

getGene(heavy_call, first=FALSE)
getGene(heavy_call, first=FALSE, strip_d=FALSE)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.