Code arcana, by file - legumeinfo/ZZBrowse GitHub Wiki
buildAnnotations.R
Reads the genome annotations from a (local or remote) GFF3 file.
buildGWAS.R
Reads a "dataset" (GWAS data frame) from remote GWAS files.
buildQTL.R
Reads a "dataset" (QTL data frame) from remote QTL files.
common.R
Miscellaneous useful functions go here.
jth_ref()
The cleanest way (that I could think of) to parametrize the code by species. For example,
input[jth_ref("datasets", 1)](/legumeinfo/ZZBrowse/wiki/jth_ref("datasets",-1))
and input$datasets
are identical, and
input[jth_ref("datasets", 2)](/legumeinfo/ZZBrowse/wiki/jth_ref("datasets",-2))
and input$datasets2
are identical. This is a property of R lists.
gChart.R
Defines the Manhattan plot in the Whole Genome view (across all chromosomes).
gChartMacro.R
Defines the macro-synteny chart in the Whole Genome view. Macro-synteny blocks are color-coded by the species 1 chromosome. For species 2, it plots the corresponding blocks against their distance metric. Mouseover a block for more information.
gcvMicroservices.R
Implements the GCV microservices calls.
global.R
- Declare required Bioconductor packages at the top of this file.
- Load required R packages here.
- Read from the organism files here.
- Defines colors for the Manhattan plots.
ontologyTerms.R
Loads various sets of ontology terms from their files.
pChart.R
Defines the Manhattan plot in the Chromosome view (for the selected chromosome).
pChartMacro.R
Defines the macro-synteny chart in the Chromosome view.
server.R
The bulk of the action in ZZBrowse occurs here.
values <- reactiveValues()
values
stores reactive quantities such as values$organism
that are not part of reactive input or output.
observe()
Code in an observe()
block gets executed when the user changes any reactive quantity (input$xxx
, output$xxx
, values$xxx
) mentioned within it.
See the Shiny documentation for more details on reactive programming.
loadRemoteData()
Analogous to loadUserData()
which is for local GWAS files.
Gene family colors
A successful genomic linkage query returns nf gene families common to the two organisms. We map them to nf colors, uniformly distributed along a rainbow color scheme from red to magenta.
Advantage: as the rainbow has a familiar order, the user easily notices when the corresponding genes of organism 2 are "out of order" relative to those of organism 1.
Disadvantage: for large nf, the colors of neighboring highlighted genes may be too similar to distinguish.
startup.R
Declare required R packages here.
tour.csv
Steps in the intro.js tour.
ui.R
Loads CSS scripts and JavaScript libraries.
userConfig.R
User-configurable global variables.
zChart.R
Defines the chart of genes on forward and reverse strands in the Chromosome view.
Currently there are three possibilities for doClickOnLine
:
- If the Genomic Linkage box is checked and we clicked on a gene in the organism 1 zChart, do the genomic linkages query. Otherwise (we clicked on an organism 2 gene, or the Genomic Linkage box is unchecked), we want to launch a URL for the selected gene:
- If the gene's URL refers to the Legume Information System, query LIS for all available URLs and let the user launch them from a dialog box.
- Otherwise (as for A. thaliana), the gene has a single URL. Launch it.