jtlovell / GENESPACE

Other
180 stars 24 forks source link

Issue with Specifying Highlighted Regions in highlightBed #154

Closed YYsama11 closed 4 months ago

YYsama11 commented 4 months ago

Hi, Thank you for developing such a useful tool. I've been using GENESPACE to analyze multiple genomes and successfully generated riparian plots. However, I encountered an issue when trying to highlight a specific genomic region using the highlightBed parameter. I aimed to highlight the region on chromosome p08_YYchr1 (displayed as p08yy1 in the plot) from positions 43983435 to 47650192, which I found in ripDat[["blks"]], "blks_all.csv". Despite specifying these exact positions, the highlighted area extends over the entire chromosome p08_YYchr1, rather than just the specified segment. Could you please advise on how to accurately render only the specified region? Here is the code I used and the resulting plot:

gpar <- init_genespace(
genomeIDs = c("p08","p09","p10","p03","p12","p15","p14","p20","p19","p17","p16","p18","p21","p25","p24","p22","p27","p30","p32","p34","p33","p35","p36","p37"),
  nCores = 25,
  path2diamond = path2diamond,
  path2orthofinder = path2orthofinder,
  wd = wd,
  path2mcscanx = path2mcscanx)

roi <- data.frame(
  genome = c("p08"),
  chr = c("p08_YYchr1"),
  start = c(43983435),
  end = c(47650192))

roibed <- roi[,c("genome", "chr")]

ripDat <- plot_riparian(
  gsParam = out,
  highlightBed = roibed,
  refGenome = "p08", 
  #backgroundColor = NULL, 
  genomeIDs = c("p37","p36","p35","p33","p34","p32","p30","p27","p22","p24","p25","p21","p18","p16","p17","p19","p20","p14","p15","p12","p03","p10","p09","p08"),
  pdfFile = "riparian_plot_p08_YYchr1.pdf",
  useOrder = TRUE,
  verbose = TRUE,
  gapProp = 0,
  scaleGapSize = 0
)

image

jtlovell commented 4 months ago

Looks like you are passing roibed which doesn't have coordinates associated with it. Also, i think you need to give it coordinates in gene rank order if useOrder. Lastly, this feature can produce cruddy looking results in really complicated synteny networks (see p35 chr p357). I'd recommend making region highlights for a subset of simpler genomes.

YYsama11 commented 4 months ago

Thank you for your response, it helped resolve my issue. I tried expanding the range: originally it was from start = 43983435 , end = 47650192 but I extended it by 10 Mbp upstream and downstream, changing it to start = 33983435 , end = 57650192 Great, it's working now. Although I arbitrarily extended the values by 20 Mbp for no reason, it's enough to illustrate the issue I want to explain image

All the species in my analysis belong to the same order of monocots but different families, and the phylogenetic relationships become progressively more distant from top to bottom. Therefore, it was expected that the collinearity at the bottom would appear coarser.

Thank you again for your assistance.