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

`prettyCoOncoplot` isn't supported by `prettyOncoplot` after maftools dependency has been removed from the latter #24

Closed vladimirsouza closed 6 months ago

vladimirsouza commented 7 months ago

This following code was run after changing the argument maftools_obj of the internal call of prettyOncoplot to maf_df.

#get data for plotting
meta = get_gambl_metadata()
meta = dplyr::filter(meta, cohort %in% c("dlbcl_reddy", "dlbcl_schmitz"))

ssm = dplyr::filter(GAMBLR.data::sample_data$grch37$maf,
                    Tumor_Sample_Barcode %in% meta$sample_id)
ssm = maftools::read.maf(ssm)

#build plot
prettyCoOncoplot(maf = ssm,
                 metadata = meta,
                 comparison_column = "cohort",
                 include_noncoding = NULL,
                 minMutationPercent = 0,
                 genes = c("MYC",
                           "TET2",
                           "TP53",
                           "DDX3X",
                           "ID3"),
                 metadataColumns = c("pathology",
                                     "EBV_status_inf",
                                     "pairing_status",
                                     "cohort"),
                 splitColumnName = "EBV_status_inf",
                 metadataBarHeight = 10,
                 fontSizeGene = 12,
                 metadataBarFontsize = 10,
                 legend_row = 2,
                 label1 = "Adult",
                 label2 = "Pediatric")

# Error: $ operator not defined for this S4 class 

This is the object given to prettyOncoplot's maf_df argument:

> ssm1
An object of class  MAF 
                        ID summary   Mean Median
 1:             NCBI_Build  GRCh37     NA     NA
 2:                 Center       .     NA     NA
 3:                Samples     468     NA     NA
 4:                 nGenes     234     NA     NA
 5:        Frame_Shift_Del     441  0.942      1
 6:        Frame_Shift_Ins     201  0.429      0
 7:           In_Frame_Del     125  0.267      0
 8:           In_Frame_Ins      20  0.043      0
 9:      Missense_Mutation    5680 12.137     10
10:      Nonsense_Mutation     805  1.720      1
11:       Nonstop_Mutation      19  0.041      0
12:            Splice_Site     394  0.842      1
13: Translation_Start_Site      85  0.182      0
14:                  total    7770 16.603     15

> class(ssm1)
[1] "MAF"
attr(,"package")
[1] "maftools"

The error in prettyOncoplot probably comes from this operation:

> maf_df <- ssm1
> maf_df$Tumor_Sample_Barcode
Error in ssm1$Tumor_Sample_Barcode : 
  $ operator not defined for this S4 class
Kdreval commented 6 months ago

Thanks for reporting this! There are few issues with this example alongside the function itself, so I'll update both and resolve this issue :+1:

Kdreval commented 6 months ago

This is now fixed in the PR #29