A class to represent the schematic display of a chromosome, also known as an ideogram. The respective information is typically directly fetched from UCSC.

# S4 method for class 'IdeogramTrack'
initialize(.Object, genome, chromosome, bands, name, ...)

IdeogramTrack(chromosome = NULL, genome, name = NULL, bands = NULL, ...)

# S4 method for class 'IdeogramTrack'
start(x)

# S4 method for class 'IdeogramTrack'
start(x) <- value

# S4 method for class 'IdeogramTrack'
end(x)

# S4 method for class 'IdeogramTrack'
end(x) <- value

# S4 method for class 'IdeogramTrack'
width(x)

# S4 method for class 'IdeogramTrack'
width(x) <- value

# S4 method for class 'IdeogramTrack'
length(x)

# S4 method for class 'IdeogramTrack'
chromosome(GdObject) <- value

# S4 method for class 'IdeogramTrack'
genome(x) <- value

# S4 method for class 'IdeogramTrack,ANY,ANY,ANY'
x[i, j, ..., drop = TRUE]

# S4 method for class 'IdeogramTrack'
position(GdObject, ...)

# S4 method for class 'IdeogramTrack'
drawGD(GdObject, minBase, maxBase, prepare = FALSE, ...)

# S4 method for class 'IdeogramTrack'
show(object)

Arguments

.Object

The object being initialized (standard S4 initialize convention); not normally supplied directly by the user.

genome

The genome on which to create the ideogram. This has to be a valid UCSC genome identifier if the ideogram data is to be fetched from the UCSC repository.

chromosome

The chromosome for which to create the ideogram. Has to be a valid UCSC chromosome identifier of the form chrx, or a single integer or numeric character unless option(ucscChromosomeNames=FALSE). The user has to make sure that the respective chromosome is indeed defined for the the track's genome.

bands

A data.frame with the cytoband information for all available chromosomes on the genome similar to the data that would be fetched from UCSC. The table needs to contain the mandatory columns chrom, chromStart, chromEnd, name and gieStain with the chromosome name, cytoband start and end coordinates, cytoband name and coloring information, respectively. This can be used when no connection to the internet is available or when the cytoband information has been cached locally to avoid the somewhat slow connection to UCSC.

name

Character scalar of the track's name used in the title panel when plotting. Defaults to the selected chromosome.

...

Additional items which will all be interpreted as further display parameters.

x, GdObject, object

The IdeogramTrack object.

value

The replacement value for a replacement method.

i, j

Index arguments for [-style subsetting; ignored, since subsetting is not supported for IdeogramTrack.

drop

logical; ignored, since subsetting is not supported for IdeogramTrack.

minBase, maxBase

The currently plotted genomic range.

prepare

logical, indicating whether drawGD is being called in 'prepare' mode (compute layout only) or 'plotting' mode (render to the device).

Value

The return value of the constructor function is a new object of class IdeogramTrack.

Details

Ideograms are schematic depictions of chromosomes, including chromosome band information and centromere location. The relevant data for various species is stored in the UCSC data base. The initializer method of the class will automatically fetch the respective data for a given genome and chromosome from UCSC and fill the appropriate object slots. When plotting IdeogramTrack objects, the current genomic location is indicated on the chromosome by a colored box.

The Gviz.ucscUrl option controls which URL is being used to connect to UCSC. For instance, one could switch to the European UCSC mirror by calling options(Gviz.ucscUrl = "http://genome-euro.ucsc.edu/cgi-bin/").

Functions

  • initialize(IdeogramTrack): Fetch the chromosome band and length information from UCSC (or use the user-supplied bands table) and use it to populate the range and bandTable slots.

  • IdeogramTrack(): Constructor function for IdeogramTrack-class.

  • start(IdeogramTrack): returns NULL. The start coordinate is not a meaningful concept for a whole-chromosome IdeogramTrack and is not supported.

  • start(IdeogramTrack) <- value: a no-op: the start coordinate cannot be set for an IdeogramTrack and the object is returned unchanged.

  • end(IdeogramTrack): returns NULL. The end coordinate is not a meaningful concept for a whole-chromosome IdeogramTrack and is not supported.

  • end(IdeogramTrack) <- value: a no-op: the end coordinate cannot be set for an IdeogramTrack and the object is returned unchanged.

  • width(IdeogramTrack): returns NULL. The width is not a meaningful concept for a whole-chromosome IdeogramTrack and is not supported.

  • width(IdeogramTrack) <- value: a no-op: the width cannot be set for an IdeogramTrack and the object is returned unchanged.

  • length(IdeogramTrack): return the number of chromosome bands stored in the object.

  • chromosome(IdeogramTrack) <- value: replace the active chromosome. If band information for the new chromosome is already cached in the object's bandTable slot it is reused directly; otherwise a new IdeogramTrack is constructed by re-fetching the band data for the new chromosome.

  • genome(IdeogramTrack) <- value: replace the active genome, re-fetching the chromosome band information for the new genome.

  • x = IdeogramTrack[i = ANY, j = ANY, drop = ANY]: subsetting is not supported for IdeogramTrack; the object is returned unchanged.

  • position(IdeogramTrack): returns NULL. Genomic position is not a meaningful concept for a whole-chromosome IdeogramTrack and is not supported.

  • drawGD(IdeogramTrack): plot the object to a graphics device, rendering the chromosome bands, centromere and, if from/to are supplied, a highlighted box indicating the currently displayed genomic region.

  • show(IdeogramTrack): Show method.

Note

When fetching ideogram data from UCSC the results are cached for faster access. See clearSessionCache on details to delete these cached items.

Objects from the Class

Objects can be created using the constructor function IdeogramTrack.

Author

Florian Hahne

Examples


## Construct the object
if (FALSE) { # \dontrun{
idTrack <- IdeogramTrack(chromosome = 7, genome = "mm39")
} # }


## Plotting
plotTracks(idTrack, from = 5000000, to = 9000000)


## Track names
names(idTrack)
#> [1] "chr7"
names(idTrack) <- "foo"
plotTracks(idTrack, from = 5000000, to = 9000000)



## Accessors
chromosome(idTrack)
#>   chr7 
#> "chr7" 
if (FALSE) { # \dontrun{
chromosome(idTrack) <- "chrX"
} # }

genome(idTrack)
#> [1] "mm9"
if (FALSE) { # \dontrun{
genome(id) <- "hg38"
} # }

range(idTrack)
#> IRanges object with 20 ranges and 0 metadata columns:
#>            start       end     width
#>        <integer> <integer> <integer>
#>    [1]         0  15943333  15943334
#>    [2]  15943333  19131999   3188667
#>    [3]  19131999  29760888  10628890
#>    [4]  29760888  36138221   6377334
#>    [5]  36138221  39326888   3188668
#>    ...       ...       ...       ...
#>   [16] 116917775 124357997   7440223
#>   [17] 124357997 129140997   4783001
#>   [18] 129140997 144021442  14880446
#>   [19] 144021442 147741553   3720112
#>   [20] 147741553 152524553   4783001
ranges(idTrack)
#> GRanges object with 20 ranges and 2 metadata columns:
#>        seqnames              ranges strand |     name     type
#>           <Rle>           <IRanges>  <Rle> | <factor> <factor>
#>    [1]      qA1          0-15943333      * |      qA1  gpos100
#>    [2]      qA2   15943333-19131999      * |      qA2  gneg   
#>    [3]      qA3   19131999-29760888      * |      qA3  gpos33 
#>    [4]      qB1   29760888-36138221      * |      qB1  gneg   
#>    [5]      qB2   36138221-39326888      * |      qB2  gpos33 
#>    ...      ...                 ...    ... .      ...      ...
#>   [16]      qF1 116917775-124357997      * |      qF1   gneg  
#>   [17]      qF2 124357997-129140997      * |      qF2   gpos33
#>   [18]      qF3 129140997-144021442      * |      qF3   gneg  
#>   [19]      qF4 144021442-147741553      * |      qF4   gpos33
#>   [20]      qF5 147741553-152524553      * |      qF5   gneg  
#>   -------
#>   seqinfo: 97 sequences from an unspecified genome; no seqlengths

## Annotation
values(idTrack)
#>    name    type
#> 1   qA1 gpos100
#> 2   qA2    gneg
#> 3   qA3  gpos33
#> 4   qB1    gneg
#> 5   qB2  gpos33
#> 6   qB3    gneg
#> 7   qB4  gpos33
#> 8   qB5    gneg
#> 9    qC gpos100
#> 10  qD1    gneg
#> 11  qD2  gpos66
#> 12  qD3    gneg
#> 13  qE1 gpos100
#> 14  qE2    gneg
#> 15  qE3  gpos33
#> 16  qF1    gneg
#> 17  qF2  gpos33
#> 18  qF3    gneg
#> 19  qF4  gpos33
#> 20  qF5    gneg

## coercion
as(idTrack, "data.frame")
#>    X.seqnames   X.start     X.end  X.width X.strand X.name  X.type name    type
#> 1         qA1         0  15943333 15943334        *    qA1 gpos100  qA1 gpos100
#> 2         qA2  15943333  19131999  3188667        *    qA2    gneg  qA2    gneg
#> 3         qA3  19131999  29760888 10628890        *    qA3  gpos33  qA3  gpos33
#> 4         qB1  29760888  36138221  6377334        *    qB1    gneg  qB1    gneg
#> 5         qB2  36138221  39326888  3188668        *    qB2  gpos33  qB2  gpos33
#> 6         qB3  39326888  49955776 10628889        *    qB3    gneg  qB3    gneg
#> 7         qB4  49955776  56864554  6908779        *    qB4  gpos33  qB4  gpos33
#> 8         qB5  56864554  63773332  6908779        *    qB5    gneg  qB5    gneg
#> 9          qC  63773332  74933665 11160334        *     qC gpos100   qC gpos100
#> 10        qD1  74933665  80779554  5845890        *    qD1    gneg  qD1    gneg
#> 11        qD2  80779554  84499665  3720112        *    qD2  gpos66  qD2  gpos66
#> 12        qD3  84499665  94597109 10097445        *    qD3    gneg  qD3    gneg
#> 13        qE1  94597109 104694553 10097445        *    qE1 gpos100  qE1 gpos100
#> 14        qE2 104694553 107351775  2657223        *    qE2    gneg  qE2    gneg
#> 15        qE3 107351775 116917775  9566001        *    qE3  gpos33  qE3  gpos33
#> 16        qF1 116917775 124357997  7440223        *    qF1    gneg  qF1    gneg
#> 17        qF2 124357997 129140997  4783001        *    qF2  gpos33  qF2  gpos33
#> 18        qF3 129140997 144021442 14880446        *    qF3    gneg  qF3    gneg
#> 19        qF4 144021442 147741553  3720112        *    qF4  gpos33  qF4  gpos33
#> 20        qF5 147741553 152524553  4783001        *    qF5    gneg  qF5    gneg