-
Notifications
You must be signed in to change notification settings - Fork 223
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
Rightbardata retrieval and used to as leftBrData #1078
Comments
Hi, Some of these are hard-coded and can not be changed. This is the closest you can do to switch the bar plots from right to left. Note that you won't be able to color code the data on the left bar. library(maftools)
laml.maf = system.file("extdata", "tcga_laml.maf.gz", package = "maftools") #MAF file
laml.clin = system.file('extdata', 'tcga_laml_annot.tsv', package = 'maftools') #clinical data
laml = read.maf(maf = laml.maf, clinicalData = laml.clin)
genes2plot = c("FLT3", "DNMT3A", "NPM1", "IDH2", "IDH1", "TET2", "RUNX1",
"TP53", "NRAS", "CEBPA")
n_samples = laml@summary[ID %in% "Samples", summary] |> as.numeric()
mut_freq = maftools::getGeneSummary(laml)[Hugo_Symbol %in% genes2plot, .(Hugo_Symbol, AlteredSamples)]
mut_freq[, pct := (AlteredSamples / n_samples)*100]
data.table::setDF(x = mut_freq, mut_freq$Hugo_Symbol)
> mut_freq
Hugo_Symbol AlteredSamples pct
FLT3 FLT3 52 26.943005
DNMT3A DNMT3A 48 24.870466
NPM1 NPM1 33 17.098446
IDH2 IDH2 20 10.362694
IDH1 IDH1 18 9.326425
TET2 TET2 17 8.808290
RUNX1 RUNX1 16 8.290155
TP53 TP53 15 7.772021
NRAS NRAS 15 7.772021
CEBPA CEBPA 13 6.735751
maftools::oncoplot(
maf = laml,
genes = genes2plot,
leftBarData = mut_freq,
drawRowBar = FALSE,
leftBarLims = c(0, max(mut_freq$AlteredSamples)),
gene_mar = 1
) |
Thanks a lot. If not I can use image tools to crop/split and rotate right bar plot horizontally along x-axis and combine again to fulfill what I want? Then crop gene names and mutation freq % and switch them and combine. Does it sound right?
Sent from my iPhone
On Dec 17, 2024, at 09:15, Anand Mayakonda ***@***.***> wrote:
Hi,
Some of these are hard-coded and can not be changed. This is the closest you can do to switch the bar plots from right to left. Note that you won't be able to color code the data on the left bar.
Hope this helps to a certain extent.
library(maftools)
laml.maf = system.file("extdata", "tcga_laml.maf.gz", package = "maftools") #MAF file
laml.clin = system.file('extdata', 'tcga_laml_annot.tsv', package = 'maftools') #clinical data
laml = read.maf(maf = laml.maf, clinicalData = laml.clin)
genes2plot = c("FLT3", "DNMT3A", "NPM1", "IDH2", "IDH1", "TET2", "RUNX1",
"TP53", "NRAS", "CEBPA")
n_samples = ***@***.***[ID %in% "Samples", summary] |> as.numeric()
mut_freq = maftools::getGeneSummary(laml)[Hugo_Symbol %in% genes2plot, .(Hugo_Symbol, AlteredSamples)]
mut_freq[, pct := (AlteredSamples / n_samples)*100]
data.table::setDF(x = mut_freq, mut_freq$Hugo_Symbol)
mut_freq
Hugo_Symbol AlteredSamples pct
FLT3 FLT3 52 26.943005
DNMT3A DNMT3A 48 24.870466
NPM1 NPM1 33 17.098446
IDH2 IDH2 20 10.362694
IDH1 IDH1 18 9.326425
TET2 TET2 17 8.808290
RUNX1 RUNX1 16 8.290155
TP53 TP53 15 7.772021
NRAS NRAS 15 7.772021
CEBPA CEBPA 13 6.735751
maftools::oncoplot(
maf = laml,
genes = genes2plot,
leftBarData = mut_freq,
drawRowBar = FALSE,
leftBarLims = c(0, max(mut_freq$AlteredSamples)),
gene_mar = 1
)
image.png (view on web)<https://github.com/user-attachments/assets/f053d7ea-6c47-476b-80e4-0d9b38e08a2e>
—
Reply to this email directly, view it on GitHub<#1078 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BHAFOAMQVXYX5VGJHUTED4T2GAWWXAVCNFSM6AAAAABTWJDCMCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNBYGU3TINZSGU>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
The information transmitted in this electronic communication is intended only for the person or entity to whom it is addressed. It may also contain confidential and/or privileged material. Any use of the information transmitted by persons or entities other than the intended recipient is strictly prohibited. If this email was sent to you in error and includes sensitive Dana-Farber information (for example, patient information, Social Security Numbers, credit card information), please communicate this to Dana-Farber's Compliance Hotline at www.compliancereport.org <http://www.compliancereport.org> . If the information transmitted does not contain such sensitive information, please contact the sender and properly dispose of the email.
Please note that this e-mail is not secure (encrypted). If you do not wish to continue communication over unencrypted e-mail, please notify the sender of this message immediately. Continuing to send or respond to e-mail after receiving this message means you understand and accept this risk and wish to continue to communicate over unencrypted e-mail.
|
Hi, Yes, it should be fine. Save the plots as vector graphics (pdf, svg) so you can edit them in Illustrator or Affinity Designer. |
Thank you!
I see oncoplot obj can be saved and oncomatrix can be retrieved by obj$oncomatrix for MAF obj. If I only want to create oncoplot for GISTIC without integrating with mutation table, is the same way to retrieve oncomatrix for GISTIC?
Why I am asking is that there is somaticinteraction() to check occurrence of mutations on mutation MAF. I wonder if it can be done the same for CNV only provided with GISTIC results?
Sent from my iPhone
On Dec 17, 2024, at 09:23, Wang, Zunqiu ***@***.***> wrote:
Thanks a lot. If not I can use image tools to crop/split and rotate right bar plot horizontally along x-axis and combine again to fulfill what I want? Then crop gene names and mutation freq % and switch them and combine. Does it sound right?
Sent from my iPhone
On Dec 17, 2024, at 09:15, Anand Mayakonda ***@***.***> wrote:
Hi,
Some of these are hard-coded and can not be changed. This is the closest you can do to switch the bar plots from right to left. Note that you won't be able to color code the data on the left bar.
Hope this helps to a certain extent.
library(maftools)
laml.maf = system.file("extdata", "tcga_laml.maf.gz", package = "maftools") #MAF file
laml.clin = system.file('extdata', 'tcga_laml_annot.tsv', package = 'maftools') #clinical data
laml = read.maf(maf = laml.maf, clinicalData = laml.clin)
genes2plot = c("FLT3", "DNMT3A", "NPM1", "IDH2", "IDH1", "TET2", "RUNX1",
"TP53", "NRAS", "CEBPA")
n_samples = ***@***.***[ID %in% "Samples", summary] |> as.numeric()
mut_freq = maftools::getGeneSummary(laml)[Hugo_Symbol %in% genes2plot, .(Hugo_Symbol, AlteredSamples)]
mut_freq[, pct := (AlteredSamples / n_samples)*100]
data.table::setDF(x = mut_freq, mut_freq$Hugo_Symbol)
mut_freq
Hugo_Symbol AlteredSamples pct
FLT3 FLT3 52 26.943005
DNMT3A DNMT3A 48 24.870466
NPM1 NPM1 33 17.098446
IDH2 IDH2 20 10.362694
IDH1 IDH1 18 9.326425
TET2 TET2 17 8.808290
RUNX1 RUNX1 16 8.290155
TP53 TP53 15 7.772021
NRAS NRAS 15 7.772021
CEBPA CEBPA 13 6.735751
maftools::oncoplot(
maf = laml,
genes = genes2plot,
leftBarData = mut_freq,
drawRowBar = FALSE,
leftBarLims = c(0, max(mut_freq$AlteredSamples)),
gene_mar = 1
)
image.png (view on web)<https://github.com/user-attachments/assets/f053d7ea-6c47-476b-80e4-0d9b38e08a2e>
—
Reply to this email directly, view it on GitHub<#1078 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BHAFOAMQVXYX5VGJHUTED4T2GAWWXAVCNFSM6AAAAABTWJDCMCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNBYGU3TINZSGU>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
The information transmitted in this electronic communication is intended only for the person or entity to whom it is addressed. It may also contain confidential and/or privileged material. Any use of the information transmitted by persons or entities other than the intended recipient is strictly prohibited. If this email was sent to you in error and includes sensitive Dana-Farber information (for example, patient information, Social Security Numbers, credit card information), please communicate this to Dana-Farber's Compliance Hotline at www.compliancereport.org <http://www.compliancereport.org> . If the information transmitted does not contain such sensitive information, please contact the sender and properly dispose of the email.
Please note that this e-mail is not secure (encrypted). If you do not wish to continue communication over unencrypted e-mail, please notify the sender of this message immediately. Continuing to send or respond to e-mail after receiving this message means you understand and accept this risk and wish to continue to communicate over unencrypted e-mail.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the issue
I see the default rightbar is a summary count bar plot for each gene(rowSum). What I want is the same bar plot to be plotted in the left instead. Where and how to retrieve the default rightBarData so that I can used to act as leftBarData to plot left bar instead. In addition, how to access the “% mutation” that besides right bar for each row as well as the gene names as I want to switch the orientation (left is bar plot with % mutation, right is gene names). I see early version of maftools was in this manner, now it is the opposite orientation. Any help is appreciated! Thank you
The text was updated successfully, but these errors were encountered: