The change Michael Lawrence made a few months ago on the tracks() to allow italics in the plot titles works well if you work with expression class objects, but I found an additional issue. I need to generate several plots and instead of writing each gene name manually, I would like to parse a variable to the italic function.
That means, instead of generating the plot title like this:
plot_title <- expression(paste("Variation in ", italic("AAAA"), " gene")) , I would like to replace "AAAA" by the variable gene_name.
In order to do so, I need to use the bquote function like this:
plot_title <- bquote('Variation in'~italic(.(gene_name))~'gene')
This function returns a "call" class object. Whenever I generate the plot title this way, it works with the plot or autoplot function, but the tracks function does not recognize it, and it returns the following error:
Error in validObject(.Object) : invalid class "Tracks" object: invalid object for slot "main" in class "Tracks": got class "call", should be or extend class "characterORexpressionORNULL"
Can the "call" class be added to the "main" argument of the tracks function?
R version 3.3.2 (2016-10-31) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 7 x64 (build 7601) Service Pack 1 locale:  LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252  LC_MONETARY=English_United States.1252 LC_NUMERIC=C  LC_TIME=English_United States.1252 attached base packages:  parallel stats4 stats graphics grDevices utils datasets methods  base other attached packages:  Homo.sapiens_1.3.1 TxDb.Hsapiens.UCSC.hg19.knownGene_3.2.2  org.Hs.eg.db_3.4.0 GO.db_3.4.0  OrganismDbi_1.16.0 GenomicFeatures_1.26.2  AnnotationDbi_1.36.0 Biobase_2.34.0  biovizBase_1.22.0 ggbio_1.22.3  ggplot2_2.2.0 GenomicRanges_1.26.1  GenomeInfoDb_1.10.2 IRanges_2.8.1  S4Vectors_0.12.1 BiocGenerics_0.20.0  RSQLite_1.1-1 loaded via a namespace (and not attached):  httr_1.2.1 AnnotationHub_2.6.4  splines_3.3.2 Formula_1.2-1  shiny_0.14.2 assertthat_0.1  interactiveDisplayBase_1.12.0 latticeExtra_0.6-28  RBGL_1.50.0 BSgenome_1.42.0  Rsamtools_1.26.1 yaml_2.1.14  lattice_0.20-34 digest_0.6.10  RColorBrewer_1.1-2 XVector_0.14.0  colorspace_1.3-2 htmltools_0.3.5  httpuv_1.3.3 Matrix_1.2-7.1  plyr_1.8.4 XML_3.98-1.5  biomaRt_2.30.0 zlibbioc_1.20.0  xtable_1.8-2 scales_0.4.1  BiocParallel_1.8.1 htmlTable_1.7  tibble_1.2 openssl_0.9.5  SummarizedExperiment_1.4.0 nnet_7.3-12  lazyeval_0.2.0 survival_2.40-1  magrittr_1.5 mime_0.5  memoise_1.0.0 GGally_1.3.0  foreign_0.8-67 graph_1.52.0  BiocInstaller_1.24.0 tools_3.3.2  data.table_1.10.0 stringr_1.1.0  munsell_0.4.3 cluster_2.0.5  ensembldb_1.6.2 Biostrings_2.42.1  base64_2.0 grid_3.3.2  RCurl_1.95-4.8 dichromat_2.0-0  VariantAnnotation_1.20.2 labeling_0.3  bitops_1.0-6 gtable_0.2.0  DBI_0.5-1 reshape_0.8.6  reshape2_1.4.2 R6_2.2.0  GenomicAlignments_1.10.0 gridExtra_2.2.1  knitr_1.15.1 rtracklayer_1.34.1  Hmisc_4.0-1 stringi_1.1.2  Rcpp_0.12.8 rpart_4.1-10  acepack_1.4.1
Thank you very much,