Split Genes By Chromosome (Arm). Input can be one of a matrix to be split into several matrices or a character vector of gene names to be split into several character vectors.

splitGenes(x, by = "chr")

Arguments

x

a matrix with gene names as rows or a character vector of gene names.

by

a string; one of 'chr' or 'arm', determining how the matrix or character vector should be split. Default: 'chr'

Value

if a matrix was provided, a list of matrices. If a character vector was provided, a list of character vectors. Both lists will be of length # of chromosome (arms) in the genome in question. Ie. length 24 for H.sapiens.

Examples

m = infercna::useData() a = splitGenes(x = m) b = splitGenes(x = rownames(m)) all(sapply(a, nrow) == lengths(b))
#> [1] TRUE
#> [1] "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15" #> [16] "16" "17" "18" "19" "20" "21" "22" "X" "Y"
names(splitGenes(x = m, by = 'arm'))
#> [1] "1p" "1q" "2p" "2q" "3p" "3q" "4p" "4q" "5p" "5q" "6p" "6q" #> [13] "7p" "7q" "8p" "8q" "9p" "9q" "10p" "10q" "11p" "11q" "12p" "12q" #> [25] "13q" "14q" "15q" "16p" "16q" "17p" "17q" "18p" "18q" "19p" "19q" "20p" #> [37] "20q" "21p" "21q" "22q" "Xp" "Xq" "Yp" "Yq"