Skip to contents

The TCGA barcode contains several pieces of information which can be parsed by the TCGAbarcode function. To select a specific type of sample, enter the appropriate sampleCode argument from the lookup table. See lookup table in data("sampleTypes"). Barcode inputs can be a character vector or a CharacterList object.

Usage

TCGAsampleSelect(barcodes, sampleCodes)

Arguments

barcodes

Either a TCGA barcode vector or CharacterList containing patient identifiers, sample, portion, plate, and center codes.

sampleCodes

Either a character or numeric vector of TCGA sample codes. See the sampleType dataset.

Value

A logical vector or LogicalList of the same length as 'barcodes' indicating sample type matches

Examples


example("TCGAbarcode")
#> 
#> TCGAbr> barcodes <- c("TCGA-B0-5117-11A-01D-1421-08",
#> TCGAbr+ "TCGA-B0-5094-11A-01D-1421-08",
#> TCGAbr+ "TCGA-E9-A295-10A-01D-A16D-09")
#> 
#> TCGAbr> ## Patient identifiers
#> TCGAbr> TCGAbarcode(barcodes)
#> [1] "TCGA-B0-5117" "TCGA-B0-5094" "TCGA-E9-A295"
#> 
#> TCGAbr> ## Sample identifiers
#> TCGAbr> TCGAbarcode(barcodes, sample = TRUE)
#> [1] "TCGA-B0-5117-11A" "TCGA-B0-5094-11A" "TCGA-E9-A295-10A"
TCGAsampleSelect(barcodes, c(11, 01))
#>    11    11    10 
#>  TRUE  TRUE FALSE