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

How to get labels to not overlap other chromosomes? #129

Open
yonniejon opened this issue Oct 22, 2022 · 2 comments
Open

How to get labels to not overlap other chromosomes? #129

yonniejon opened this issue Oct 22, 2022 · 2 comments
Assignees
Labels
usage question User question about how to use the package

Comments

@yonniejon
Copy link

image
What settings do I use to change the height between chromosomes?

@bernatgel bernatgel self-assigned this Oct 24, 2022
@bernatgel bernatgel added the usage question User question about how to use the package label Oct 24, 2022
@bernatgel
Copy link
Owner

Hi @yonniejon

What you need here is to change the "Plot Params". The idea is to create a plot.params object, modify the values you need and then use it as a parameter for plotKaryotype

Example:

pp <- getDefaultPlotParams(plot.type=2)
pp$leftmargin <- 0.3
pp$data2height <- 30
kp <- plotKaryotype(chromosomes=c("chr1", "chr2"), plot.type=2, plot.params = pp)

You can find more information at the karyoploteR tutorial: https://bernatgel.github.io/karyoploter_tutorial/Tutorial/PlotParams/PlotParams.html

These are the available parameters (you can create this image for your exact situation with plotDefaultPlotParams(plot.type=1)) but the parameter you need to increase is data1outmargin which I would set to something like 200 or so in your plot. Another thing that could help is to rotate the labels so they occupy less space. Try adding srt=45 to your call to kpPlotMarkers to see if this helps

Figure1-1

@yonniejon
Copy link
Author

Thank you!!! very helpful

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