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

`prettyOncoplot` is missing a step to assign POS/NEG colours #46

Closed lkhilton closed 7 months ago

lkhilton commented 7 months ago

prettyOncoplot is missing the line that assigns POS/NEG colours for columns when a custom colours aren't specified.

When I run it in verbose mode it does indicate that it found the colours:

[1] ">>>>>>>"
[1] "POS" "NEG"
[1] "<<<<<<<"
found colours for bcl2_ba here
[1] ">>>>>>>"
[1] "POS" "NEG"
[1] "<<<<<<<"
found colours for bcl6_ba here
$lymphgen
  EZB-MYC       EZB  EZB-COMP       ST2  ST2-COMP       MCD  MCD-COMP       BN2  BN2-COMP        N1   N1-COMP       A53     Other COMPOSITE        NA 
"#52000F" "#721F0F" "#C7371A" "#C41230" "#EC3251" "#3B5FAC" "#6787CB" "#7F3293" "#A949C1" "#55B55E" "#7FC787" "#5b6d8a" "#ACADAF" "#ACADAF"   "white" 

$bcl2_ba
      POS       NEG        NA 
"#c41230" "#E88873"   "white" 

$bcl6_ba
      POS       NEG        NA 
"#c41230" "#E88873"   "white" 

But it then returns the error

Error: elements in `col` should be named vectors.

This is using the bcl2_ba and bcl6_ba columns returned by get_gambl_metadata.

Kdreval commented 7 months ago

Can you please check if this PR fixes the issue? https://github.com/morinlab/GAMBLR.viz/pull/44 This PR was just merged yesterday There was recently a bug introduced that was not handling factors properly, I wonder if this is the same issue.

lkhilton commented 7 months ago

I actually revisited this and I think I'm wrong, but no matter what combination of metadata variables or custom colours I pass to prettyOncoplot I can't get it to produce a plot if I include either bcl2_ba or bcl6_ba columns...

lkhilton commented 7 months ago

Hm, I just installed GAMBLR 30 minutes ago but the change from the PR doesn't appear in the version I just installed...

Kdreval commented 7 months ago

The other thing I can think of is that the GAMBLR.viz was also recently updated to drop the ggsci dependency. Maybe that one is not up to date? I am using the viz master version and this is the plot if I run the example usage but use the full metadata and add the fish columns to plot

maf_metadata <- GAMBLR.results::get_gambl_metadata(seq_type_filter = "genome") %>%
    dplyr::filter(pathology %in% c("FL", "DLBCL"))
maf_data <- get_ssm_by_samples(
    these_samples_metadata = maf_metadata
)
fl_genes = c("RRAGC", "CREBBP", "VMA21", "ATP6V1B2")
dlbcl_genes = c("EZH2", "KMT2D", "MEF2B", "CD79B", "MYD88", "TP53")
genes = c(fl_genes, dlbcl_genes)
gene_groups = c(rep("FL", length(fl_genes)), rep("DLBCL", length(dlbcl_genes)))
names(gene_groups) = genes
prettyOncoplot(
    maf_df = maf_data,
    genes = genes,
    these_samples_metadata = maf_metadata %>%
        arrange(patient_id),
    splitGeneGroups = gene_groups,
    keepGeneOrder = TRUE,
    splitColumnName = "pathology",
    metadataBarHeight = 5,
    metadataBarFontsize = 8,
    legend_row = 2,
    fontSizeGene = 11,
    metadataColumns = c("pathology", "lymphgen", "sex", "myc_ba", "bcl2_ba", "bcl6_ba"),
    sortByColumns = c("pathology", "lymphgen", "sex", "myc_ba", "bcl2_ba", "bcl6_ba")
)

image

Kdreval commented 7 months ago

Hm, maybe this is an unexpected behaviour from using the version tags in the DESCRIPTION :thinking: So, even though there is later commit available with update, it installs the commit associated with that version tag

Kdreval commented 7 months ago

Did you have a chance to check this towards the latest master and see if this is fixed, or does it need some action still? I can investigate if there are still some problems 😃

lkhilton commented 7 months ago

I forced installing from Master using renv::install("morinlab/GAMBLR.viz@3680b4c2c6933859d610ac80ed1e81f636315fca").

It works as expected now and it automatically retrieves the standard colours for LymphGen and the FISH POS/NEG columns.

I noticed there is no default for the minMutationPercent - maybe this would be a good feature to add? ]

Thanks for your help!