-
Notifications
You must be signed in to change notification settings - Fork 11
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 find which coordinates are repeating in target chromosomes #27
Comments
Hi @khush876 , Sorry for the delay in responding to this. I have recently started a new position, so been a bit hectic finishing up one job and startng the next. Some answers to you points, (1) This is something we can add quite easily, for now you could use this function in place of plot_synteny_colourfullly <- function (ali, q_chrom, t_chrom, centre = TRUE, rc = FALSE, xlab = "Position in query",
ylab = "", x_labeller = Mb_lab, ribbon_colour="grey80", seq_colour="white")
{
synt_df <- pafr:::synteny_data(ali, q_chrom = q_chrom, t_chrom = t_chrom,
rc = rc)
cs <- pafr::chrom_sizes(ali)
tlen <- cs$tlens$tlen[cs$tlens$tname == t_chrom]
qlen <- cs$qlens$qlen[cs$qlens$qname == q_chrom]
seq_lens <- data.frame(seq = factor(c(q_chrom, t_chrom)),
start = 0, end = c(qlen, tlen))
if (centre) {
os <- abs(tlen - qlen)/2
if (qlen > tlen) {
synt_df[["x"]][synt_df[["seq"]] == t_chrom] <- synt_df[["x"]][synt_df[["seq"]] ==
t_chrom] + os
seq_lens[2, 2:3] <- seq_lens[2, 2:3] + os
}
else {
synt_df[["x"]][synt_df[["seq"]] == q_chrom] <- synt_df[["x"]][synt_df[["seq"]] ==
q_chrom] + os
seq_lens[1, 2:3] <- seq_lens[1, 2:3] + os
}
}
if (q_chrom > t_chrom) {
bottoms <- c(2.05, 0.8)
tops <- c(2.2, 0.95)
}
else {
bottoms <- c(0.8, 2.05)
tops <- c(0.95, 2.2)
}
ggplot() + geom_polygon(data = synt_df, aes_string(x = "x",
y = "seq", group = "block_id"), fill = ribbon_colour, colour = "black") +
geom_rect(data = seq_lens, aes_string(xmin = "start",
xmax = "end", ymin = "bottoms", ymax = "tops"), colour = "black",
fill = seq_colour) + scale_x_continuous(xlab, labels = x_labeller) +
ylab(ylab)
} Using the example from the README you could do #beautiful....
plot_synteny_colourfullly(long_ali, q_chrom="Q_chr3", t_chrom="T_chr4", centre=TRUE, seq_colour = "forestgreen", ribbon_colour = "pink") (2) In short no. I think doing this well would be quite difficult (how to order target and query sequences, etc) so it's not something that is likely to be on the horizon. I have produce nice figures for thiese sorts of plots with MCScan (https://github.com/tanghaibao/mcscan) and if we get #26 of the ground we might be able to make whole genome circos plots with similar effects (3)I'm not sure exactly what you are after, with #26 we hope to make it quick and easy to produce circos plots. It is also possible to extract the location of a given aligned-block from the |
Hi David, Thank you so much for sending the code. It is really great. It gives really beautiful synteny plot. I am very happy that I can make different color for each chromosome.
plot 1 <- q_chrom="Q_chr1", t_chrom="T_chr1" superplot <- plot 1, plot 2, plot 3
Thank you |
Hi,
It is very useful tool and the graphics are amazing. However, I have some issues if you can address
Thank you
The text was updated successfully, but these errors were encountered: