makeGenesDataFromTxDb {karyoploteR} | R Documentation |
This is a utility function that transforms a TxDb object into a custom
object valid as input for kpPlotGenes
.
makeGenesDataFromTxDb(karyoplot, txdb, plot.transcripts, plot.transcripts.structure)
karyoplot |
(karyoplot object) A valid karyoplot object created by a call to |
txdb |
(a TxDb object) The transcript database object from which the data will be extracted. |
plot.transcripts |
(boolean) TRUE if transcripts are needed in addition to the genes. |
plot.transcripts.structure |
(boolean) TRUE if the coding and non-coding exons are needed in addition to the genes and transcripts. |
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.
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.
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).
library(TxDb.Hsapiens.UCSC.hg19.knownGene) zoom <- toGRanges("chr17", 32.6e6, 33.2e6) kp <- plotKaryotype(genome="hg19", zoom=zoom) genes.data <- makeGenesDataFromTxDb(kp, TxDb.Hsapiens.UCSC.hg19.knownGene, TRUE, TRUE)