morinlab / GAMBLR.viz

Collection of functions to make plots for Genomic Analysis of Mature B-cell Lymphomas in R
https://morinlab.github.io/GAMBLR.viz/
MIT License
0 stars 0 forks source link

prettyRainfallPlot does not respect the projection whet returning SVs #15

Closed Kdreval closed 7 months ago

Kdreval commented 8 months ago

When returning SVs fo label, this function always calls the variants with default setting, disregarding what user provides in the main function call. This results in absent label for the SVs present there since the coordinates and chr prefixing does not match. It should be addressed here: https://github.com/morinlab/GAMBLR.viz/blob/9f3528fa0e2495de0b06b0d292b9535e0a846de7/R/prettyRainfallPlot.R#L213-L221

Refer to this thread with sample plots and calls to test the functionality

mattssca commented 7 months ago

In addition to the reported bug, the function seems to disregard if a custom maf is supplied with this_maf. For example, this is the very first code in this function

  if (missing(this_sample_id)) {
    warning("No sample_id was provided. Using all mutations in the MAF within your region!")
    if(missing(zoom_in_region)){
      stop("Must provide a zoom_in_region to plot when showing data from more than one patient")
    }
  }

I think an additional else statement needs to be added that checks if an maf is provided if a sample ID is not provided. For example, this call returns an error and suggests me to specify a zoom_in_region since multiple patients are to be visualized (this is not the case, the maf only has data from one patient).

> my_maf = GAMBLR.results::get_ssm_by_sample(this_sample_id = "01-20985T", 
+                                            this_seq_type = "genome", 
+                                            projection = "hg38")
>
> prettyRainfallPlot(this_maf = my_maf,                                                                                                                                                                 
+                    this_seq_type = "genome",
+                    projection = "hg38",
+                    chromosome = "10",
+                    label_sv = TRUE)
Error in prettyRainfallPlot(this_maf = my_maf, this_seq_type = "genome",  : 
  Must provide a zoom_in_region to plot when showing data from more than one patient