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 space between seqs within the same bin #150

Closed
yzhong005 opened this issue May 31, 2023 · 5 comments
Closed

Change space between seqs within the same bin #150

yzhong005 opened this issue May 31, 2023 · 5 comments

Comments

@yzhong005
Copy link

Thank you so much for conducting this wonderful package! I quite like it!
I have met a problem that, I cannot find how to change the space (distance) between seqs on the same line (share the same bin_id). If I change the space in gggenomes, it is actually changing the space between all bins, which is not what I really want. Can anyone provide some suggestions? Thank u!

@thackl
Copy link
Owner

thackl commented May 31, 2023

Try gggenomes(spacing=0.2) or so. Does that help?

https://thackl.github.io/gggenomes/reference/gggenomes.html

@yzhong005
Copy link
Author

That will also increase the space between different lines (bins). However, I only want to change the space within bin, between different seqs.

@yzhong005
Copy link
Author

IMG_9841

I want to change the space in GREEN circle, not the space with right arrows.

@thackl
Copy link
Owner

thackl commented May 31, 2023

Hm, so this is how it looks like with spacing=0.3. Isn't that exactly what you want?

library(gggenomes)
s0 <- tibble(
  bin_id = c("A", "A", "B"),
  seq_id = c("a1","a2","b1"),
  length = c(2e5, 3e5, 5e5)
)

p1 <- gggenomes(seqs=s0) +
  geom_seq() +         # draw contig/chromosome lines
  geom_seq_label() +   # label each sequence 
  geom_bin_label()  # label each bin


p2 <- gggenomes(seqs=s0, spacing=0.3) +
  geom_seq() +         # draw contig/chromosome lines
  geom_seq_label() +   # label each sequence 
  geom_bin_label()  # label each bin

library(patchwork)
p1 + p2

image

@yzhong005
Copy link
Author

Wow, great! Thank you so much!

@thackl thackl closed this as completed Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants