Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

somaticInteractions top not count cn samples when plotting #1072

Open
WandaC-S opened this issue Nov 13, 2024 · 0 comments
Open

somaticInteractions top not count cn samples when plotting #1072

WandaC-S opened this issue Nov 13, 2024 · 0 comments

Comments

@WandaC-S
Copy link

WandaC-S commented Nov 13, 2024

Hi,
I encountered an issue while using the somaticInteractions function to plot the top occurrence triangle diagram. It appears that the function currently selects the top genes based on MutatedSamples rather than AlteredSamples.

Would it be possible to update the function to allow for the selection of top genes based on AlteredSamples? Alternatively, could you add a parameter to control this behavior so that users can choose between selecting top genes based on MutatedSamples or AlteredSamples?

It works well when there is no copy number data.

library(tidyverse)
library(maftools)
# without cntable
laml.maf <- system.file("extdata", "tcga_laml.maf.gz", package = "maftools")
laml <- read.maf(maf = laml.maf)
top.genes <- laml@gene.summary %>% 
  arrange(desc(AlteredSamples)) %>% .$Hugo_Symbol
top.genes[1:5] #"FLT3"   "DNMT3A" "NPM1"   "IDH2"   "IDH1"  
somaticInteractions(maf = laml, top = 5)

noCN
When I add copy number data to the MAF file, the plot displays the top MutatedSamples, and TP53 is not shown.

file_CNV <- "test.cn.txt"
laml.maf <- system.file("extdata", "tcga_laml.maf.gz", package = "maftools")
laml <- read.maf(maf = laml.maf,cnTable = file_CNV)
top.genes <- laml@gene.summary %>% 
  arrange(desc(AlteredSamples)) %>% .$Hugo_Symbol
top.genes[1:5] #"FLT3"   "DNMT3A" "NPM1"   "IDH2"   "TP53"  
somaticInteractions(maf = laml, top = 5)

CN top5

After changing the 'top' value to 8, TP53 appears as the 5th gene in the plot.

somaticInteractions(maf = laml, top = 8)

CN top8

The file_CNV is uploaded as an attachment. I have added 4 deletion (Del) samples to TP53.
test.cn.txt
Gene Sample_name CN
TP53 TCGA-AB-2988 Del
TP53 TCGA-AB-2869 Del
TP53 TCGA-AB-3009 Del
TP53 TCGA-AB-2887 Del

Session info
I tested two versions of maftools

R version 4.3.2 (2023-10-31)  maftools_2.21.2
R version 4.2.0 (2022-04-22 ucrt)   maftools_2.12.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant