Convert genes in sets from row indices to their identifiers.

renameGenesInSets(species, sets, type, config = NULL)

Arguments

species

String specifying the taxonomy ID of the species of interest.

sets

List of integer vectors, typically generated by fetchGenesForAllSets or fetchGenesForSomeSets. Each vector represents a gene set and contains gene indices, i.e., row indices into the data frame returned by fetchAllGenes.

type

String specifying the type of gene identifier to convert to. This can be any type listed in fetchGeneTypes.

config

Configuration list, typically created by newConfig. If NULL, the default configuration is used.

Value

A list of the same length as sets. Each entry is now a character vector containing the specified identifiers for the genes in the corresponding set.

Details

If a gene has no identifiers of the specified type, it is omitted from the affected character vectors in the output list. If a gene has multiple identifiers of the specified type, all identifiers are reported in the affected character vectors in the output list. As a result, the apparent size of the gene sets from the output list (e.g., with lengths) may not agree with the real sizes in fetchSetSizes.

Author

Aaron Lun

Examples

example.sets <- fetchGenesForSomeSets("9606", 1:50)
head(example.sets)
#> [[1]]
#> [1] 11692 13228
#> 
#> [[2]]
#>  [1]   860  1492  2780  5076  5224  5318  8494 11134 11476 11798 17874 24843
#> 
#> [[3]]
#>  [1]  1444  1485  1490  3051  4129  4481  6908  7044  9983 12932
#> 
#> [[4]]
#> [1]  1446  1448  1449 20163
#> 
#> [[5]]
#> [1] 2755
#> 
#> [[6]]
#> [1] 4564 4565
#> 
renamed.sets <- renameGenesInSets("9606", example.sets, "symbol")
head(renamed.sets)
#> [[1]]
#> [1] "PIGV"  "ALG12"
#> 
#> [[2]]
#>  [1] "ERCC8"  "ERCC6"  "LIG4"   "TNP1"   "UNG"    "XRCC1"  "SIRT1"  "APTX"  
#>  [9] "NEIL3"  "TDP1"   "APLF"   "XNDC1N"
#> 
#> [[3]]
#>  [1] "ENDOG"   "ERCC1"   "ERCC4"   "MRE11"   "RBBP8"   "SETMAR"  "EXOG"   
#>  [8] "RAD50"   "ASTE1"   "DCLRE1C"
#> 
#> [[4]]
#> [1] "ENO1" "ENO2" "ENO3" "ENO4"
#> 
#> [[5]]
#> [1] "LCT"
#> 
#> [[6]]
#> [1] "SLC5A1" "SLC5A2"
#>