Closed caonetto closed 4 years ago
Hi @caonetto
Sure, it's possible to plot any bands as the chromosomes bands. You can do it in two different ways:
data.panel
: This is my preferred option and I think this is the cleanest and most versatile. You'll need to use data.panel="ideogram"
to plot on the ideogram (you can see how to use it at https://bernatgel.github.io/karyoploter_tutorial//Tutorial/DataPanels/DataPanels.html) and combine it with kpPlotRegions. For example, you could plot the chromatin state track seen in the ENCODE example (https://bernatgel.github.io/karyoploter_tutorial//Examples/EncodeEpigenetics/EncodeEpigenetics.html) and plot it on the ideogram adding data.panel="ideogram"
to the kpPlotRegions call. If you want to try this option and find problems, ask me here or in biostars and I'll be happy to help.Thank you for your response, Is there any option to also plot data directly from lets say a gff file?? How do you upload all the associated data included in a GFF file from the loaded genome and plot densities of different things included in the gff file? Any idea of a tutorial that could be close enough to achieve this?
Thanks you.
So far GFF files are not directly supported. You'll need to use another package to convert them into an accepted format.
One possibility is to use rtracklayer::import to import a GFF and then filter the GRanges to obtain the different elements and plot the densities with kpPlotDensity
. Something silinar to this (unfinished and untested code):
library(rtracklayer)
gff.data <- import("data.file.gff")
only.exons <- gff.data[gff.data$type=="exon"]
kp <- plotKaryotype()
kpPlotDensity(kp, data=only.exons)
On the other hand, if you have a GFF representing genes, you can call GenomicFeatures::makeTxDbFromGFF
and then use the (unsufficiently documented at the moment) functions makeGenesDataFromTxDb
and kpPlotGenes
(and maybe addGeneNames
and mergeTranscripts
) to plot the gene structures.
Hi, Thanks for developing the package looks great. I wonder if it’s possible to plot any sort of bands using custom colors? Something like the cytobands but input a bed file with regions and a column with colors associated to the type of region?
Thanks