makeGenesDataFromTxDb: makeGenesDataFromTxDb

Description Usage Arguments Details Value Note See Also Examples

View source: R/genes.R

Description

This is a utility function that transforms a TxDb object into a custom object valid as input for kpPlotGenes.

Usage

1
makeGenesDataFromTxDb(txdb, karyoplot=NULL, plot.transcripts=TRUE, plot.transcripts.structure=TRUE)

Arguments

txdb

(a TxDb object) The transcript database object from which the data will be extracted.

karyoplot

(karyoplot object) A valid karyoplot object created by a call to plotKaryotype. If present, genes data will be restricted to the visible region in the plot. If NULL, all genes will be included. (defaults to NULL)

plot.transcripts

(boolean) TRUE if transcripts are needed in addition to the genes. (defaults to TRUE)

plot.transcripts.structure

(boolean) TRUE if the coding and non-coding exons are needed in addition to the genes and transcripts. (defaults to TRUE)

Details

This function creates a valid data object for kpPlotGenes starting from a TxDb object. The resulting object will contain only the genes and transcripts ovelapping the plot region of the given Karyoplot object.

Value

Returns a list with at least one element called genes, a GRanges with all genes overlapping karyoplot. If plot.transcripts is TRUE, the returned list will have a transcript element, a list of GRanges objects, one per gene (named with the gene ids), with the transcripts of that gene. If plot.transcripts.structure is TRUE, two more elements are present: coding.exons and non.coding.exons, each a list with one element per trascript (named with the transcript id), and each element the coding or non-coding exons of that transcript.

Note

kpPlotGenes accepts TxDb objects directly. This function is only expected to be used when the user want to manipulate the results somehow (i.e. removing some of the genes).

See Also

kpPlotGenes

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
 

library(TxDb.Hsapiens.UCSC.hg19.knownGene)

zoom <- toGRanges("chr17", 32.6e6, 33.2e6)
kp <- plotKaryotype(genome="hg19", zoom=zoom)

genes.data <- makeGenesDataFromTxDb(TxDb.Hsapiens.UCSC.hg19.knownGene, 
                 karyoplot=kp, plot.transcripts=TRUE, 
                 plot.transcripts.structure=TRUE)
  

karyoploteR documentation built on Nov. 8, 2020, 5:52 p.m.