PoisonAlien / maftools

Summarize, Analyze and Visualize MAF files from TCGA or in-house studies.
http://bioconductor.org/packages/release/bioc/html/maftools.html
MIT License
440 stars 217 forks source link

Setting Altered Changes Annotation Colour Order #471

Closed DarioS closed 7 months ago

DarioS commented 4 years ago

Changing nothing else apart from the value of altered, the clinical data colouring swaps labels (for WGD but not for the second variable).

image

This seems unintended.

PoisonAlien commented 4 years ago

Hello, Sorry for the delay in getting back. Can you post your command? Does it happen when you manually provide colours for annotations?

DarioS commented 4 years ago

I could not trigger it using a minimal example, so you'll need to load the attached R objects testData.zip The command is

load("testData.RData") # After unzipping.
oncoplot(MAF, colors = customColours, top = 50, showTumorSampleBarcodes = TRUE, removeNonMutated = FALSE,
         clinicalFeatures = c("WGD", "TP53_LOH"), sortByAnnotation = TRUE, sortByMutation = TRUE,
         annotationOrder = c("No", "Yes"), genesToIgnore = "TTN",
         gene_mar = 6, barcode_mar = 11)

Just add altered = TRUE to get the swapping of WGD legend.

PoisonAlien commented 4 years ago

Thanks for the data. I can reproduce it. I will take a look into it soon. Meanwhile you can use annotationColor argument to define color codes which should maintain the correct color order.

oncoplot(
  MAF,
  colors = customColours,
  top = 50,
  showTumorSampleBarcodes = TRUE,
  removeNonMutated = FALSE,
  clinicalFeatures = c("WGD", "TP53_LOH"),
  sortByAnnotation = TRUE,
  sortByMutation = TRUE,
  annotationOrder = c("No", "Yes"),
  genesToIgnore = "TTN",
  gene_mar = 6,
  barcode_mar = 11,
  altered = TRUE,
  annotationColor = list(
    WGD = c("Yes" = "red", "No" = "blue"),
    TP53_LOH = c("Yes" = "red", "No" = "blue")
  )
)
github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 60 days with no activity.

DarioS commented 1 year ago

Swapping still happens in the latest release of maftools.

PoisonAlien commented 1 year ago

Hi, I'm on holidays. I'll fix them the next week.

github-actions[bot] commented 10 months ago

This issue is stale because it has been open for 60 days with no activity.

DarioS commented 10 months ago

Stale but important.

github-actions[bot] commented 8 months ago

This issue is stale because it has been open for 60 days with no activity.

github-actions[bot] commented 7 months ago

This issue was closed because it has been inactive for 14 days since being marked as stale.