This function returns the specified snippet of information obtained from the TCGA barcode.
Usage
TCGAbarcode(
barcodes,
participant = TRUE,
sample = FALSE,
portion = FALSE,
plate = FALSE,
center = FALSE,
index = NULL
)
Arguments
- barcodes
A character vector of TCGA barcodes
- participant
Logical (default TRUE) participant identifier chunk
- sample
Logical (default FALSE) includes the numeric sample code of the barcode and the vial letter
- portion
Logical (default FALSE) includes the portion and analyte codes of the barcode
- plate
Logical (default FALSE) returns the plate value
- center
Logical (default FALSE) returns a matrix with the plate and center codes
- index
An optional numeric vector indicating barcode positions when split by the delimiter (i.e., hyphen '-'). For example, an index of
c(1, 2)
corresponds to 'TCGA-ZZ' inTCGA-ZZ-A1A1
.
Examples
barcodes <- c("TCGA-B0-5117-11A-01D-1421-08",
"TCGA-B0-5094-11A-01D-1421-08",
"TCGA-E9-A295-10A-01D-A16D-09")
## Patient identifiers
TCGAbarcode(barcodes)
#> [1] "TCGA-B0-5117" "TCGA-B0-5094" "TCGA-E9-A295"
## Sample identifiers
TCGAbarcode(barcodes, sample = TRUE)
#> [1] "TCGA-B0-5117-11A" "TCGA-B0-5094-11A" "TCGA-E9-A295-10A"