jtlovell / GENESPACE

Other
180 stars 24 forks source link

Plot one chromosome and highlight regions on it? #121

Closed ericgonzalezs closed 2 months ago

ericgonzalezs commented 1 year ago

It is possible to use the function plot_riparian() to select one whole chromosome and highlight some specific regions on it?

Let say plot the whole Chr1, but highlight only one or two regions inside Chr1.

I tried something like this:

roi <- data.frame( genome = c("genome1" ,"genome1"), chr = c("Chr1" ,"Chr1"), start = c(0, 125e6), end = c(194959971, 155e6), color= c("yellow", "blue"))

plot_riparian(gsParam = out, useRegions = FALSE, highlightBed = roi, minChrLen2plot = 0, syntenyWeight = 1, backgroundColor = NULL, genomeIDs =c("genome1", "genome2"))

But it is not working,

Many thanks.

ericgonzalezs commented 1 year ago

I did it by indicating the segments.

For example, let's say I want to plot Chr11:20-30Mb

roi <- data.frame( genome = c("genome1" ,"genome1", "genome1"), chr = c("Chr11" ,"Chr11", "Chr11"), start = c(0, 20e6, 30.1), end = c(19.9e6, 30e6, 194.9e6), color= c("yellow", "cyan1", "yellow"))

However, if I want to plot this using let's say genome1, genome2, and genome3. I have many problems visualizing genome2 and genome3. If I plot genome2 close to genome1, I can observe the region between these two genomes but not with genome3. If I plot genome3 close to genome1, I observe the region between these two genomes, but not with genome2

plot_riparian(gsParam = out, useRegions = FALSE, backgroundColor = NULL, highlightBed = roi_pet_11_P, genomeIDs = c("genome3", "genome2", "genome1") )

plot_riparian(gsParam = out, useRegions = FALSE, backgroundColor = NULL, highlightBed = roi_pet_11_P, genomeIDs = c("genome2", "genome3", "genome1") )

Do you know how I could fix this problem? I played with different values in the bed file, by using the positions regarding genome2 and genome3 instead of genome1, but I have the same results. And by observing syntenicBlock_coordinates.csv I can see that I have syntenic blocks between the 3 genomes in the area.

Reg11

bmsacchi commented 1 year ago

I'm experiencing the same issue. I think what is happening is the block between genome 2 & 3 is very large, so if your region breakpoints are within that large block it will be entirely colored yellow. As far as I can tell there's no way to label a small portion of a syntenic block.

sheinasim commented 11 months ago

I'm trying to do something similar. Is it possible to just plot individuals genes across all crhomosomes and all genomes? I have a bed file with genes under selection and I'd like to just draw a line from their position in one genome to their position in the other, but with the syntenic blocks grayed out underneath. Is this possible?

I can do this in RIdeogram, but Rideogram does not plot syntenic blocks, just individual genes. It can also only do 2 or three genomes at a time.

Thanks!

jtlovell commented 11 months ago

Sorry about the delayed response - this is a little concerning ... I'll have a look and try to address it in the v1.4 updates coming later this month. Will leave this open and post here if I can't re-create the problem and need the data. more soon. john

ericgonzalezs commented 11 months ago

Many thanks, I'll try the new version when is ready.

ParvaSharma commented 7 months ago

Hi Is the version 1.4 out? In my R version (4.3.2), the latest genespace version I can use is still 1.3.1. I have the same issue for plotting specific region (genes) of a chromosome. @sheinasim: Are you able to plot selected genes?

jtlovell commented 2 months ago

Its possible to coerce genespace into showing individual genes, but it is not something I would suggest. If you are still having trouble with small ROIs, lets move this conversation over to the open issue #160