How collaborativebioinformatics/genevar2 works
Project type and purpose
• GeneVar2 is a hybrid bioinformatics application combining:
• An R/Shiny web application for interactive gene-centric SV (structural variant) exploration
• A command-line annotation pipeline (R scripts and Python utilities) for bulk VCF SV annotation
File structure
• Top-level directories and files
• R/ → core R annotation modules (annotate_vcf.R, annotate_genes.R, etc.)
• genevarapp/ → Shiny application (ui.R, server.R, run-app.R), Python support (VCFanalyse.py, retrieve.py), prebuilt data, test data
• scripts/genevar/ → Snakefile workflow and helper R/Python scripts for batch pipeline
• testdata/ → example VCF and annotation_data.RData for local testing
• results/ → sample output files (TSV, CSV, VCF)
• Configuration and metadata
• LICENSE, .gitattributes, README.md
README for additional insights
• The README describes two user flows: “enter individual gene” and “upload a VCF”
• It references external resources (gencode, gnomAD-SV, ClinVar) and a DNAnexus deployment
• It lists R/Bioconductor dependencies, pipeline usage examples, enrichment analysis steps
Main components
a. User interfaces
1. Web UI (Shiny front end: genevarapp/ui.R)
2. CLI scripts (Rscript entry points in R/, scripts/genevar/Snakefile)
b. Application servers/modules
1. Shiny server logic (genevarapp/server.R)
2. Annotation modules (R scripts in R/: annotate_vcf.R, annotate_frequency.R, annotate_clinical_score.R, GeneAnnotationFromCSV.R)
3. Python utilities (genevarapp/retrieve.py for data fetching, VCFanalyse.py for parsing and initial VCF handling)
4. Batch workflow engine (Snakemake in scripts/genevar/Snakefile orchestrating R/Python scripts)
c. Data storage and resources
1. Static annotation data files (annotation_data.RData, gencode.tsv.gz, dbvar38.ann.tsv.gz, pli.gene.tsv.gz)
2. Test data (testdata/) and results (results/)
3. External databases (ClinVar, gnomAD-SV, OMIM, GTEx) accessed via APIs or predownloaded files
d. Outputs
1. Annotated VCF and CSV (test.output.vcf, test.output.csv)
2. Enrichment tables (TSV) and plots (PNG)
3. Dynamic tables and plots in Shiny UI
4. Downloadable files for user
Relationships and interactions
• Web flow:
User → Shiny UI → server.R
├─ if “gene query” → Python retrieve.py fetches SV + regulatory data → R functions annotate_genes, annotate_frequency, annotate_clinical_score → dynamic table + plots
└─ if “VCF upload” → server saves file → R annotate_vcf.R (calls helper scripts) → outputs CSV, VCF → R GeneAnnotationFromCSV.R for enrichment → tables + plots
• CLI flow (batch):
User → Snakefile → runs prepare_gencode.R, prepare_gnomadsv_freq.R → annotate_freq.R → vcf_plot.py → final VCF/CSV → GeneAnnotationFromCSV.R
• All modules read from/write to the static data folder under genevarapp/ or scripts/genevar/
Architectural patterns and design principles
• Modular scripting: each annotation task is a separate R/Python script, assembled by a master script or by Snakemake
• Two‐tier deployment: lightweight RShiny front end backed by statistical annotation logic
• Reproducible pipeline: Snakefile ensures consistent ordering of data preparation and annotation steps
• Separation of concerns: UI vs. compute vs. data retrieval