Last data update: 2014.03.03

R: Class "ChrBandTree"
ChrBandTree-classR Documentation

Class "ChrBandTree"

Description

This class represents chromosome band annotation data for a given experiment. The class is responsible for storing the mapping of band to set of gene IDs located within that band as well as for representing the tree structured relationship among the bands.

Objects from the Class

Objects should be created using NewChrBandTree or ChrBandTreeFromGraph.

Slots

toParentGraph:

Object of class "graph" representing the tree of chromosome bands. Edges in this directed graph go from child to parent.

toChildGraph:

Object of class "graph". This is the same as toParentGraph, but with the edge directons reversed. This is not an ideal implementation due to the duplication of data, but it provides quick access to parents or children of a given node.

root:

Object of class "character" giving the name of the root node. The convention is to use "ORGANISM:<organism>".

level2nodes:

Object of class "list" providing a mapping of levels in the tree to the set of nodes at that level. Levels X is defined as the set of nodes with a path length of X from the root node.

Methods

allGeneIds

Return a vector of gene IDs representing the gene universe for this ChrBandTree

childrenOf

Return a list with an element for each the character vector n. Each element is a character vector of node names of the children of the named element.

geneIds

Return a vector of gene IDs for a single band.

lgeneIds

Return a list of vectors of gene IDs when given more than one band. The "l" prefix is for list.

parentOf

Return the parents of the specified bands. See childrenOf for a description of the structure of the return value.

treeLevels

Return an integer vector identifying the levels of the tree.

level2nodes(g, level)

Return the nodes in the tree that are at the level specified by level. The level argument can be either numeric or character, but should match a level returned by treeLevels.

Note

Not all known chromosome bands will be represented in a given instance. The set of bands that will be present is determined by the available annotation data and the specified gene universe. The annotation source maps genes to their most specific band. Such bands and all bands on the path to the root will be represented in the resulting tree.

Currently there is only support for human and mouse data.

Author(s)

S. Falcon

Examples

library("hgu95av2.db")
set.seed(0xfeee)
univ = NULL ## use all Entrez Gene IDs on the chip (not recommended)
ct = NewChrBandTree("hgu95av2.db", univ)

length(allGeneIds(ct))

exampleLevels(ct)

geneIds(ct, "10p11")
lgeneIds(ct, "10p11")
lgeneIds(ct, c("10p11", "Yq11.22"))

pp = parentOf(ct, c("10p11", "Yq11.22"))
childrenOf(ct, unlist(pp))

treeLevels(ct)

level2nodes(ct, 0)
level2nodes(ct, 0L)
level2nodes(ct, "0")

level2nodes(ct, 1)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(Category)
Loading required package: stats4
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, cbind, colnames, do.call, duplicated, eval, evalq,
    get, grep, grepl, intersect, is.unsorted, lapply, lengths, mapply,
    match, mget, order, paste, pmax, pmax.int, pmin, pmin.int, rank,
    rbind, rownames, sapply, setdiff, sort, table, tapply, union,
    unique, unsplit

Loading required package: AnnotationDbi
Loading required package: Biobase
Welcome to Bioconductor

    Vignettes contain introductory material; view with
    'browseVignettes()'. To cite Bioconductor, see
    'citation("Biobase")', and for packages 'citation("pkgname")'.

Loading required package: IRanges
Loading required package: S4Vectors

Attaching package: 'S4Vectors'

The following objects are masked from 'package:base':

    colMeans, colSums, expand.grid, rowMeans, rowSums

Loading required package: Matrix

Attaching package: 'Matrix'

The following object is masked from 'package:S4Vectors':

    expand

> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/Category/ChrBandTree-class.Rd_%03d_medium.png", width=480, height=480)
> ### Name: ChrBandTree-class
> ### Title: Class "ChrBandTree"
> ### Aliases: ChrBandTree-class allGeneIds childrenOf parentOf lgeneIds
> ###   treeLevels level2nodes allGeneIds,ChrBandTree-method
> ###   childrenOf,ChrBandTree,character-method geneIds,ChrBandTree-method
> ###   lgeneIds,ChrBandTree-method parentOf,ChrBandTree,character-method
> ###   treeLevels,ChrBandTree-method level2nodes,ChrBandTree,numeric-method
> ###   level2nodes,ChrBandTree,character-method show,ChrBandTree-method
> ### Keywords: classes
> 
> ### ** Examples
> 
> library("hgu95av2.db")
Loading required package: org.Hs.eg.db


> set.seed(0xfeee)
> univ = NULL ## use all Entrez Gene IDs on the chip (not recommended)
> ct = NewChrBandTree("hgu95av2.db", univ)
Warning message:
unexpected band notation: Xq13.3-Xq21.2 using Xq 
> 
> length(allGeneIds(ct))
[1] 8575
> 
> exampleLevels(ct)
                      0                       1                       2 
"ORGANISM:Homo sapiens"                    "10"                   "10p" 
                      3                       4                       5 
                 "10p1"                 "10p11"               "10p11.2" 
                      6                       7 
              "Yq11.22"              "Yq11.221" 
> 
> geneIds(ct, "10p11")
 [1] "10006" "3688"  "57209" "6840"  "6935"  "56288" "8453"  "1390"  "94134"
[10] "3799"  "2572"  "1326"  "57608"
> lgeneIds(ct, "10p11")
$`10p11`
 [1] "10006" "3688"  "57209" "6840"  "6935"  "56288" "8453"  "1390"  "94134"
[10] "3799"  "2572"  "1326"  "57608"

> lgeneIds(ct, c("10p11", "Yq11.22"))
$`10p11`
 [1] "10006" "3688"  "57209" "6840"  "6935"  "56288" "8453"  "1390"  "94134"
[10] "3799"  "2572"  "1326"  "57608"

$Yq11.22
[1] "22829"  "9087"   "246126" "51581"  "9086"  

> 
> pp = parentOf(ct, c("10p11", "Yq11.22"))
> childrenOf(ct, unlist(pp))
$`10p1`
[1] "10p11" "10p12" "10p13" "10p14" "10p15"

$Yq11.2
[1] "Yq11.22"

> 
> treeLevels(ct)
[1] 0 1 2 3 4 5 6 7
> 
> level2nodes(ct, 0)
[1] "ORGANISM:Homo sapiens"
> level2nodes(ct, 0L)
[1] "ORGANISM:Homo sapiens"
> level2nodes(ct, "0")
[1] "ORGANISM:Homo sapiens"
> 
> level2nodes(ct, 1)
 [1] "10"                 "11"                 "12"                
 [4] "13"                 "14"                 "15"                
 [7] "16"                 "17"                 "18"                
[10] "19"                 "1"                  "20"                
[13] "21"                 "22"                 "2"                 
[16] "3"                  "4"                  "5"                 
[19] "6"                  "7"                  "8"                 
[22] "9"                  "X"                  "Y"                 
[25] "6_ssto_hap7"        "6_mcf_hap5"         "6_cox_hap2"        
[28] "6_mann_hap4"        "6_apd_hap1"         "6_qbl_hap6"        
[31] "6_dbb_hap3"         "17_ctg5_hap1"       "4_ctg9_hap1"       
[34] "1_gl000192_random"  "Un_gl000225"        "4_gl000194_random" 
[37] "4_gl000193_random"  "9_gl000200_random"  "Un_gl000222"       
[40] "Un_gl000212"        "7_gl000195_random"  "Un_gl000223"       
[43] "Un_gl000224"        "Un_gl000219"        "17_gl000205_random"
[46] "Un_gl000215"        "Un_gl000216"        "Un_gl000217"       
[49] "9_gl000199_random"  "Un_gl000211"        "Un_gl000213"       
[52] "Un_gl000220"        "Un_gl000218"        "19_gl000209_random"
[55] "Un_gl000221"        "Un_gl000214"        "Un_gl000228"       
[58] "Un_gl000227"        "1_gl000191_random"  "19_gl000208_random"
[61] "9_gl000198_random"  "17_gl000204_random" "Un_gl000233"       
[64] "Un_gl000237"        "Un_gl000230"        "Un_gl000242"       
[67] "Un_gl000243"        "Un_gl000241"        "Un_gl000236"       
[70] "Un_gl000240"        "17_gl000206_random" "Un_gl000232"       
[73] "Un_gl000234"        "11_gl000202_random" "Un_gl000238"       
[76] "Un_gl000244"        "Un_gl000248"        "8_gl000196_random" 
[79] "Un_gl000249"        "Un_gl000246"        "17_gl000203_random"
[82] "8_gl000197_random"  "Un_gl000245"        "Un_gl000247"       
[85] "9_gl000201_random"  "Un_gl000235"        "Un_gl000239"       
[88] "21_gl000210_random" "Un_gl000231"        "Un_gl000229"       
[91] "M"                  "Un_gl000226"        "18_gl000207_random"
> 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>