maftools
maftools copied to clipboard
Feature request: support numeric annotation in oncoplot.
> oncoplot(
+ maf = laml,
+ draw_titv = TRUE,
+ clinicalFeatures = c('FAB_classification', 'Overall_Survival_Status', "days_to_last_followup"),
+ additionalFeature = c("Tumor_Seq_Allele2", "C"),
+ sortByAnnotation = TRUE,
+ logColBar = TRUE
+ )
Support continuous scale?
This is already taken care of in #207. Since the clnicalfeature is not a numeric - its plotted as a categorical variable. You coudl try the below and it should work.
[email protected][,days_to_last_followup := as.numeric(as.character(days_to_last_followup))]
@PoisonAlien
I don't see what I want from running the following code
library(maftools) # I used the latest version from GitHub
laml.maf = system.file('extdata', 'tcga_laml.maf.gz', package = 'maftools')
laml.clin = system.file('extdata', 'tcga_laml_annot.tsv', package = 'maftools')
laml = read.maf(maf = laml.maf, clinicalData = laml.clin)
[email protected][,days_to_last_followup := as.numeric(as.character(days_to_last_followup))]
str([email protected]$days_to_last_followup)
oncoplot(
maf = laml,
draw_titv = TRUE,
clinicalFeatures = c('FAB_classification', 'Overall_Survival_Status', "days_to_last_followup"),
sortByAnnotation = TRUE,
logColBar = TRUE
)
oncoplot(
maf = laml,
draw_titv = TRUE,
clinicalFeatures = c('FAB_classification', "days_to_last_followup"),
sortByAnnotation = TRUE,
logColBar = TRUE
)
oncoplot(
maf = laml,
draw_titv = TRUE,
clinicalFeatures = c("days_to_last_followup"),
sortByAnnotation = TRUE,
logColBar = TRUE
)
The last plot seems right but has a bad legend.
Okay, I will fix this. This doesnt seem good.
Hi, I'd like to follow up this legend issue. Do you guys fix that? I see the same question.
Still wait a fix.
Hi, legend issue seems to still occur
Hahah, @PoisonAlien you maybe have forgotten this 😭
Ah! I somehow overlooked it. I will work on it soon..
It seems this issue suspends for almost a year. I will try to implement it and submit a PR recently.
Is this issue resolved? I am having the same issue (maftools 2.8.05) where the numeric annotation does not show up as a continuous scale but as individual values in the legend.
Was solution to allow this numeric annotation provided yet? Please share if you know how. Currently, it looks like only categorical value can be plotted. How do you annotate scores per sample? This will be very helpful for maftool users.
Hi, I will have a look around soon.
Thank you. It will be great if you could resolve this issue.
On Thu, Aug 17, 2023 at 2:45 AM Anand Mayakonda @.***> wrote:
Hi, I will have a look around soon.
— Reply to this email directly, view it on GitHub https://github.com/PoisonAlien/maftools/issues/363#issuecomment-1681715913, or unsubscribe https://github.com/notifications/unsubscribe-auth/AM72VJVJKUIVR5B4FGPRAM3XVW4ZZANCNFSM4IBMNB3Q . You are receiving this because you commented.Message ID: @.***>
--
Best regards,
Wungki Park
Hi,
I have pushed changes to handle numeric annotations. Make sure that the annotation you're trying to annotate is of the class numeric
or else they will be considered categorical.
laml.maf <- system.file("extdata", "tcga_laml.maf.gz", package = "maftools")
laml.clin = system.file('extdata', 'tcga_laml_annot.tsv', package = 'maftools')
laml <- read.maf(maf = laml.maf, clinicalData = laml.clin)
# by default days_to_last_followup is of characters class. Converting it to numeric
[email protected]$days_to_last_followup = as.numeric([email protected]$days_to_last_followup)
oncoplot(maf = laml, clinicalFeatures = "days_to_last_followup")
Please let me know if this works for you..
This is amazing! I have been using customised palette for other annotations. Would it be possible to use a continuous palette colors instead of this default scale in red brown here? I really appreciate this help. Very helpful!