Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change y-axis values #136

Open
pailloufat-stack opened this issue Feb 28, 2023 · 0 comments
Open

Change y-axis values #136

pailloufat-stack opened this issue Feb 28, 2023 · 0 comments
Assignees
Labels
usage question User question about how to use the package

Comments

@pailloufat-stack
Copy link

pailloufat-stack commented Feb 28, 2023

Hello,

Thanks for your very useful tool. I use the kpPlotDensity function to get a coverage graph.

I would like to set up the y-axis values from the lowest coverage to the highest. The lowest is necessarly 0 because I work on the whole human genome and some regions are not covered (I checked with bedtools bamcoverage)

kp <- plotKaryotype(genome="hg38", chromosomes = "chr10")
kpPlotBAMDensity(kp, data="my_sorted.bam")
kpAxis(kp, ymax=kp$latest.plot$computed.values$max.density)`

I got this kind of plot. I can't spot the "0" coverage regions. Is it because the histogram is chuncked in multiple sections with the parameter window.size=1e6 ? And so, these regions are hidden by the covered regions?

karyoploteR-1

I reduced window.size to 100,000 but I still don't see the "0" coverage :

karyoploteR-chr10-1

Even if I use the kpPlotBAMCoverage() fuction. I cannot export the graph as pdf for the entire chromosome even if the kpPlotBAMCoverage() works :

(...)
> dev.off()
Error in dev.off() :
  'Calloc' could not allocate memory (2125547770 of 1 bytes)

So, I show you with a portion of the chr1 , where there is some portions without coverage (confirmed with bedtools bamcoverage) and I can spot the no covered regions :

kp <- plotKaryotype(genome = "hg38", chromosomes = "chr1", zoom=toGRanges("chr1:250000:350000"))
kpAddBaseNumbers(kp, tick.dist = 20000, add.units = TRUE)
kp <- kpPlotBAMCoverage(kp, data="/home/vipailler/Nanopore-Genoscope/aln_AA.sorted.bam", window.size = 10000)
kpAxis(kp, ymax=kp$latest.plot$computed.values$max.coverage)

karyoploteR-1

So, I suppose I can't spot the not covered regions because of the chromosome size?

Any help?

@pailloufat-stack pailloufat-stack changed the title Export plot as PDF Change y-axis values Feb 28, 2023
@bernatgel bernatgel self-assigned this Mar 1, 2023
@bernatgel bernatgel added the usage question User question about how to use the package label Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
usage question User question about how to use the package
Projects
None yet
Development

No branches or pull requests

2 participants