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

Chromosome positioning issues (2) #116

Open
dansapozhnikov opened this issue Feb 24, 2022 · 3 comments
Open

Chromosome positioning issues (2) #116

dansapozhnikov opened this issue Feb 24, 2022 · 3 comments
Assignees
Labels
bug usage question User question about how to use the package

Comments

@dansapozhnikov
Copy link

dansapozhnikov commented Feb 24, 2022

Hi, I am seeing an issue here:

Rplot33

The first position on the chromosome distance labeling at the bottom is 1, when it should be 0 Mb. The first base in my chromosomes file is 1 (1-based) (not 0-based). When I switch it to 0-based to try to fix it, a different issue comes up - the place where a 1 should be, becomes 1000 (the other positions are fine).

kpAddBaseNumbers(kp, tick.dist = 1000000, tick.len = 10, tick.col="red", cex=1.1, minor.tick.dist = 100000, minor.tick.len = 5, minor.tick.col = "gray")

Thanks!

Dan

@sihellem
Copy link

sihellem commented Dec 1, 2023

I have a similar issue in which my minimum coordinate gets displayed as 2b (see picture).

Rplot03

My genome file:
scaffold_1 1 103392817

The code:

kpAddBaseNumbers(kp, add.units=T,minor.ticks=T,tick.dist=10000000, minor.tick.dist=1000000)

Any solution to this?

@bernatgel bernatgel self-assigned this Dec 11, 2023
@bernatgel bernatgel added the bug label Dec 11, 2023
@bernatgel
Copy link
Owner

Hi all,

Sorry for taking this long to answer. This issue got under my radar.

@sihellem In your case, the most probable cause is that you have named your genome file ".bed". BED files use 0-based half-open (] ranges so when reading the file karyoploteR transforms them to closed [] ranges. With this, it interprets the first coordinate (1) as "just before my interval" and so the chromosome starts with 2. Simply changing the name of the file from .bed to .txt should do the trick, since any other file format is interpreted as closed ranges. Alternatively, you can define your genome directly in R with

my.genome <- toGRanges("scaffold_1:1-13392817")

@dansapozhnikov Regarding your first issue, it should be solved adding "add.units=TRUE" to the kpAddBaseNumbers call, since the first 1 is base 1 and the second one is base 1 million. With bases that should be clear.

Regrading your second issue, I've not seen this problem before and it's strange. Could you please send me the data producing this error and the code you are using so I can track the root of the problem?

Thanks! and hope this helps!

Bernat

@bernatgel bernatgel added the usage question User question about how to use the package label Dec 11, 2023
@sihellem
Copy link

@bernatgel: this solved it for me, thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug usage question User question about how to use the package
Projects
None yet
Development

No branches or pull requests

3 participants