maftools icon indicating copy to clipboard operation
maftools copied to clipboard

Feature request: support numeric annotation in oncoplot.

Open ShixiangWang opened this issue 5 years ago • 10 comments

> 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
+ )

image

Support continuous scale?

ShixiangWang avatar Jul 11 '19 16:07 ShixiangWang

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 avatar Jul 14 '19 10:07 PoisonAlien

@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.

image

ShixiangWang avatar Jul 14 '19 14:07 ShixiangWang

Okay, I will fix this. This doesnt seem good.

PoisonAlien avatar Jul 16 '19 09:07 PoisonAlien

Hi, I'd like to follow up this legend issue. Do you guys fix that? I see the same question.

tingchiafelix avatar Jan 24 '20 19:01 tingchiafelix

Still wait a fix.

ShixiangWang avatar Jan 25 '20 08:01 ShixiangWang

Hi, legend issue seems to still occur

atarap avatar Jul 22 '20 23:07 atarap

Hahah, @PoisonAlien you maybe have forgotten this 😭

ShixiangWang avatar Jul 23 '20 03:07 ShixiangWang

Ah! I somehow overlooked it. I will work on it soon..

PoisonAlien avatar Jul 23 '20 07:07 PoisonAlien

It seems this issue suspends for almost a year. I will try to implement it and submit a PR recently.

ShixiangWang avatar Aug 20 '20 15:08 ShixiangWang

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.

kgaonkar6 avatar Jun 07 '21 17:06 kgaonkar6

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.

WilliamPolar avatar Aug 17 '23 04:08 WilliamPolar

Hi, I will have a look around soon.

PoisonAlien avatar Aug 17 '23 06:08 PoisonAlien

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

WilliamPolar avatar Aug 19 '23 14:08 WilliamPolar

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")

onc

Please let me know if this works for you..

PoisonAlien avatar Aug 22 '23 12:08 PoisonAlien

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!

WilliamPolar avatar Aug 25 '23 08:08 WilliamPolar