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

Feature request: support numeric annotation in oncoplot. #363

Closed
ShixiangWang opened this issue Jul 11, 2019 · 15 comments
Closed

Feature request: support numeric annotation in oncoplot. #363

ShixiangWang opened this issue Jul 11, 2019 · 15 comments

Comments

@ShixiangWang
Copy link
Contributor

> 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?

@PoisonAlien
Copy link
Owner

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.

laml@clinical.data[,days_to_last_followup := as.numeric(as.character(days_to_last_followup))]

@ShixiangWang
Copy link
Contributor Author

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

laml@clinical.data[,days_to_last_followup := as.numeric(as.character(days_to_last_followup))]
str(laml@clinical.data$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

@PoisonAlien
Copy link
Owner

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

@tingchiafelix
Copy link

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

@ShixiangWang
Copy link
Contributor Author

Still wait a fix.

@atarap
Copy link

atarap commented Jul 22, 2020

Hi, legend issue seems to still occur

@ShixiangWang
Copy link
Contributor Author

Hahah, @PoisonAlien you maybe have forgotten this 😭

@PoisonAlien
Copy link
Owner

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

@ShixiangWang
Copy link
Contributor Author

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

@kgaonkar6
Copy link

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.

@WilliamPolar
Copy link

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.

@PoisonAlien
Copy link
Owner

Hi,
I will have a look around soon.

@WilliamPolar
Copy link

WilliamPolar commented Aug 19, 2023 via email

PoisonAlien added a commit that referenced this issue Aug 22, 2023
@PoisonAlien
Copy link
Owner

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
laml@clinical.data$days_to_last_followup = as.numeric(laml@clinical.data$days_to_last_followup)

oncoplot(maf = laml, clinicalFeatures = "days_to_last_followup")

onc

Please let me know if this works for you..

@WilliamPolar
Copy link

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!

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

6 participants