kevinblighe / EnhancedVolcano

Publication-ready volcano plots with enhanced colouring and labeling
397 stars 81 forks source link

Issue with selectLab #131

Closed ka-lw closed 3 months ago

ka-lw commented 3 months ago

Hi Kevin. I'm having a problem with the 'selectLab' functionality. It keeps throwing an error : Error in EnhancedVolcano(stage7.all.markers, selectLab = c(unip.glycol), : argument "lab" is missing, with no default

This happens regardless if I provide with a vector or directly give a subset of the object being plotted. I've tried updated the package and installing the dev version, still no joy. I'm using R 4.4.0 and EnhancedVolcano_1.13.2. Any ideas appreciated!

unip.glycol
 [1] "Tpi1"     "Pkm"      "Pklr"     "Pgk2"     "Pgk1"     "Pfkp"     "Pfkm"     "Pfkl"     "Hkdc1"    "Hk3"      "Hk2"      "Hk1"      "Gpi"      "Gck"      "Gapdhs"   "Gapdh"    "Eno4"     "Eno3"     "Eno2"    
[20] "Eno1"     "EG433182" "Aldoc"    "Aldob"    "Aldoart2" "Aldoart1" "Aldoa"    "Adpgk"   

keyvals<- ifelse(
  stage7.all.markers$gene %in% unip.glycol & stage7.all.markers$avg_log2FC >=0, "deeppink",
  ifelse(stage7.all.markers$gene %in% unip.glycol & stage7.all.markers$avg_log2FC <=0, "blue",
  "grey"))

keyvals[is.na(names(keyvals))] <- "grey"
names(keyvals)[keyvals == "deeppink"] <- 'Upregulated Glycolytic Genes'
names(keyvals)[keyvals == "blue"] <- 'Downregulated Glycolytic Genes'

EnhancedVolcano( stage7.all.markers,
                selectLab=c(unip.glycol),
                colCustom = keyvals,
                x = 'avg_log2FC',
                y = 'p_val',
                title = 'P7.0',
                pointSize = 5.5)