The Shiny Variant Explorer (tSVE) was primarily developped to demonstrate features implemented in the TVTB, not as a production environment. As a result, a few important considerations should be made to clarify what should and should not be expected from the web-application:
...
1).ggplot
objects,
definition of custom genomic ranges).ggplot
) are currently the only output that can
be exported from the web-application (using the web browser “Download
image”, or equivalent context menu item). In the future, action buttons
may be added to export tables (e.g. CSV format) and figures
(e.g. PDF format).The Shiny Variant Explorer suggests a few additional package dependencies compared to the package, to support certain forms of data input and display.
Input
EnsDb
2 annotation packages
are required if that interface is used to query genomic ranges
(demonstrated in this section).Display
The TVTB::tSVE()
method launches the
web-application.
Overall, the web-application is implemented as a web-page with a top level navigation bar organised from left to right to reflect progression through a typical analysis, with the exception of the last two menu items Settings and Session, which may be useful to check and update at any point.
Here is a brief overview of the menu items:
EnsDb
annotation package may be selected to use the
associated database interface.The Input panel controls the major input parameters of the analysis, including phenotypes (and therefore samples), genomic ranges, and fields to import from VCF file(s). Those inputs are useful to import only data of interest, as well as to limit memory usage and duration of calculations.
Phenotypes are critical to define groups of samples that may be
compared in summary statistics, tables, and plots. Moreover, phenotypes
also implicitely define the set of samples required in the analysis
(unique sample identifiers usually set as rownames
of the
phenotypes).
The web-application accepts phenotypes stored in a text file, with the following requirements:
read.table
function).rownames
.colnames
.When provided, phenotypes will be used to import from VCF file(s) only genotypes for the corresponding samples identifiers. Moreover, an error message will be displayed if any of the sample identifiers present in the phenotypes is absent from the VCF file(s).
Note that the web-application does not absolutely require phenotype information. In the absence of phenotype information, all samples are imported from VCF file(s).
Action:
- Click on the Browse action button
- Navigate to the
extdata
folder of the TVTB installation directory- Select the file
integrated_samples.txt
Alternatively: click the Sample file button
Notes
Genomic ranges are critical to import only variants in targeted genomic regions or features (e.g. genes, transcripts, exons), as well as to limit memory usage and duration of calculations.
The Shiny Variant Explorer currently supports three types of input to define genomic ranges:
EnsDb
annotation packagesCurrently, the web-application uses genomic ranges solely to query the corresponding variants from VCF file(s). In the future, those genomic ranges may also be used to produce faceted summary statistics and plots.
Notes:
If a BED file is supplied, the web-application parses it using the
rtracklayer
import.bed
method. Therefore the file must respect the BED file
format guidelines.
Action:
- Click on the Browse action button
- Navigate to the
extdata
folder of the TVTB installation directory- Select the file
SLC24A5.bed
Alternatively: click the Sample file button
Notes:
Sequence names (i.e. chromosomes), start, and end positions
of one or more genomic ranges may be defined in the text field, with
individual regions separated by ";"
.
Action:
- Paste
15:48,413,169-48,434,869
in the text fieldAlternatively: click the Sample input button
Notes:
","
characters
from the text input, before coercing the start and end positions to
numeric
1:123-456;2:234-345;2:456-789
)Currently, genomic ranges encoding only gene-coding regions may be retrieved from an Ensembl-based database. This feature was adapted from the web-application implemented in the ensembldb package.
Action:
- Paste
SLC24A5
in the text fieldAlternatively: click the Sample input button
At the core of the TVTB package, variants must be imported from one or more VCF file(s) annotated by the Ensembl Variant Effect Predictor (VEP) script (McLaren et al. 2010).
Considering the large size of most VCF file(s), it is common practice to split genetic variants into multiple files, each file used to store variants located on a single chromosome (more generally; a single sequence). The Shiny Variant Explorer supports two situations:
seqnames
slot of the genomic ranges described above (“Multi-VCF mode”).In addition, VCF files can store a plethora of information in their
various fields. It is often useful to select only a subset of fields
relevant for a particular analysis, to limit memory usage. The
web-application uses the VariantAnnotation
scanVcfHeader
to parse the header of the VCF file
(Single-VCF mode) or the first VCF file (Multi-VCF
mode), to display the list of available fields that users may choose to
import. A few considerations must be made:
"GT"
key be
present in the FORMAT field.This mode display an action button that must be used to select the VCF file from which to import variants.
Action:
- Click on the Browse action button
- Navigate to the
extdata
folder of the TVTB installation directory- Select the file
chr15.phase3_integrated.vcf.gz
Alternatively: click the Sample file button
This mode requires two pieces of information:
"%s"
to declare the
emplacement of the sequence (i.e. chromosome) name in the
pattern.Note that a summary of VCF file(s) detected using the given the folder and pattern is displayed on the right, to help users determine whether the parameters are correct. In addition, the content of the given folder is displayed at the bottom of the page, beside the same content filtered for the VCF file naming pattern.
Action:
None. The text fields should already be filled with default values, pointing to the single example VCF file (
chr15.phase3_integrated.vcf.gz
).
This panel allows users to select the INFO and FORMAT fields to
import (in the info
and geno
slots of the
VCF
object, respectively).
It is important to note that the FORMAT/GT and INFO/<vep>
stands for the INFO key where
Ensembl VEP predictions are stored—are implicitely imported from the
VCF. Similarly, the mandatory FIXED fields CHROM
,
POS
, ID
, REF
, ALT
,
QUAL
, and FILTER
are automatically imported to
populate the rowRanges
slot of the VCF
object.
Action:
- Click the Deselect all action button under the INFO fields selection input to import only the INFO/CSQ and FORMAT/GT fields.
- Click the Import variants action button
A summary of variants, phenotypes, and samples imported will appear beside the action button.
This panel allows users to select a pre-installed annotation package.
Currently, only EnsDb
annotation packages are supported,
and only gene-coding regions may be queried.
Action:
- If none of the
EnsDb
packages are installed, it will simply not be possible to use theensembl
interface of the Genomic ranges input tab.- If the
EnsDb.Hsapiens.v75
package is the onlyEnsDb
packages installed, no action is required; the package should already be pre-selected.- If the
EnsDb.Hsapiens.v75
package is not the onlyEnsDb
packages installed, users should select it in the list of choices.
This panel demonstrates the use of three methods implemented in the
TVTB
package, namely addFrequencies
,
addOverallFrequencies
, and
addPhenoLevelFrequencies
.
This panel allows users to Add and Remove INFO fields that contain genotype counts (i.e. homozygote reference, heterozygote, homozygote alternate) and allele frequencies (i.e. alternate allele frequency, minor allele frequency) calculated across all the samples and variants imported. The web-application uses the homozygote reference, heterozygote, and homozygote alternate genotypes defined in the Advanced settings panel.
Importantly, the name of the INFO keys that are used to store the calculated values can be defined in the Advanced settings panel.
Action:
- Click the Add action button
- See the Latest changes message update at the top of the screen.
- Optionally, the Views panel can be used to examine the new fields
This panel allows users to Refresh the list of INFO fields that contain genotype counts and allele frequencies calculated within groups of samples associated with various levels of a given phenotype.
Action:
- Select
super_pop
in the list of phenotypes- Click the Select all action button
- Click the Refresh action button
- See the Latest changes message update at the top of the screen.
- Optionally, the Views panel can be used to examine the new fields
One of the flagship features of the TVTB package
are the VCF filter rules, extending the S4Vectors
FilterRules
class to new classes of filter rules that can
be evaluated within environments defined by the various slots of
VCF
objects.
Generally speaking, FilterRules
greatly facilitate the
design and combination of powerful filter rules for table-like objects,
such as the fixed
and info
slots of VariantAnnotation
VCF
objects, as well as Ensembl VEP predictions stored in
the meta-columns of GRanges
returned by the ensemblVEP
parseCSQToGRanges
method.
A separate vignette describes in greater detail the use of classes that contain VCF filter rules. A simple example is shown below.
Action:
- Select
VEP
as the Type of filter- Paste
grepl("missense",Consequence)
in the text field- Leave the Active? checkbox ticked
- Click the Add filter action button
- See the list of rules update at the bottom of the screen
- Click the Apply filters action button
- See the summary of filtered variants update beside the action button
- Optionally, the Views panel can be used to examine the new fields
Alternatively: click the Sample input button
This panel offers the chance to examine the main objects of the session, namely:
rowRanges
and selected meta-columns of the filtered
variants.info
slot (of the filtered
variants).ggplot
).Action:
- In the various panels, select fields to examine each object
- In particular, note the INFO fields that contain genotype counts and allele frequencies calculated earlier
- Go to the Heatmap tab of the Genotypes panel
- Click the Go! action button to calculate and display the heatmap
This panel demonstrates the use of two methods implemented in the
TVTB
package, namely tabulateVepByPhenotype
and
densityVepByPhenotype
.
This panel stores more advanced settings that users may not need to edit as frequently, if at all. Those settings are divided in two sub-panels:
It is critical to accurately identify and define how the different
genotypes—homozygote reference, heterozygote, and homozygote
alternate—are encoded in the VCF file, to produce accurate genotypes counts and frequencies, for instance.
This generally requires examining the content of the FORMAT/GT field
outside of the web-application. For instance, the functions
unique
and table
may be used to identify (and
count) all the distinct genotype codes in the geno
slot
("GT"
key) of a VCF
object.
The default selected values are immediately compatible with the demonstration data set. Users who wish to select genotypes codes not yet available among the current choices may either contact the package maintainer to add them in a future release, or edit the Global configuration file of the web-application locally.
Currently, the three calculated genotypes counts and two allele frequencies require five INFO fields to store their respective values.
Considering that TVTB offers the possibility to calculate counts and frequencies for the overall data set, and for each level of each phenotype, it is important to define a clear and consistent naming mechanism that does not conflict with INFO keys imported from the VCF file(s). In the TVTB package, a suffix is required for each type of genotype and frequency calculated, to generate INFO as follows:
<suffix>
<phenotype>_<level>_<suffix>
Again, the default values are immediately compatible with the demonstration data set. For other data sets, it may be necessary to change those values, either by preference, or to avoid conflict with INFO keys imported from the VCF file(s).
Other rarely used settings in this panel include:
Several functionalities of the TVTB package are applied to independent subsets of data (e.g. counting genotypes in various levels of a given phenotype). Such processes can benefit from multi-threaded calculations. Multi-threading settings in the Shiny web-application are somewhat experimental, as they have been validated only on a small set of operating systems, while some issues have been reported for others.
Report | Operating System | Cluster Class | Cluster type | # Cores |
---|---|---|---|---|
OK | Ubuntu 14.04 | Multicore | FORK | 2 |
OK | Scientific Linux 6.7 | Multicore | FORK | 2 |
Hang1 | OS X El Capitan | Snow | SOCK | 2 |
The last panel of the Shiny Variant Explorer offers detailed views of objects and settings in the current session, including:
sessionInfo()
valueVCF
objectGRanges
that store the Ensembl
VEP predictionsgeno
slot ("GT"
key) of the raw variantsMost default values are stored in the global.R
file of
the web-application. All the files of the web-application are stored in
the extdata/shinyApp
folder of the TVTB
installation directory (see an earlier
section to identify this directory).
Users who wish to change the default values of certain input widgets
(e.g. genotype codes) may edit the global.R
file
accordingly. However, the file will be reset at each package update.
Here is the output of sessionInfo()
on the system on
which this document was compiled:
## R version 4.4.2 (2024-10-31)
## Platform: x86_64-pc-linux-gnu
## Running under: Ubuntu 24.04.1 LTS
##
## Matrix products: default
## BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
## LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.26.so; LAPACK version 3.12.0
##
## locale:
## [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
## [3] LC_TIME=en_US.UTF-8 LC_COLLATE=C
## [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
## [7] LC_PAPER=en_US.UTF-8 LC_NAME=C
## [9] LC_ADDRESS=C LC_TELEPHONE=C
## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
##
## time zone: Etc/UTC
## tzcode source: system (glibc)
##
## attached base packages:
## [1] stats graphics grDevices utils datasets methods base
##
## other attached packages:
## [1] TVTB_1.33.0 knitr_1.49 BiocStyle_2.35.0
##
## loaded via a namespace (and not attached):
## [1] RColorBrewer_1.1-3 rstudioapi_0.17.1
## [3] sys_3.4.3 jsonlite_1.8.9
## [5] magrittr_2.0.3 GenomicFeatures_1.59.1
## [7] farver_2.1.2 rmarkdown_2.29
## [9] BiocIO_1.17.0 zlibbioc_1.52.0
## [11] vctrs_0.6.5 memoise_2.0.1
## [13] Rsamtools_2.23.0 RCurl_1.98-1.16
## [15] base64enc_0.1-3 htmltools_0.5.8.1
## [17] S4Arrays_1.7.1 progress_1.2.3
## [19] curl_6.0.1 SparseArray_1.7.2
## [21] Formula_1.2-5 sass_0.4.9
## [23] bslib_0.8.0 htmlwidgets_1.6.4
## [25] plyr_1.8.9 Gviz_1.51.0
## [27] httr2_1.0.6 cachem_1.1.0
## [29] buildtools_1.0.0 GenomicAlignments_1.43.0
## [31] lifecycle_1.0.4 pkgconfig_2.0.3
## [33] Matrix_1.7-1 R6_2.5.1
## [35] fastmap_1.2.0 GenomeInfoDbData_1.2.13
## [37] MatrixGenerics_1.19.0 digest_0.6.37
## [39] colorspace_2.1-1 GGally_2.2.1
## [41] AnnotationDbi_1.69.0 S4Vectors_0.45.2
## [43] Hmisc_5.2-0 GenomicRanges_1.59.0
## [45] RSQLite_2.3.8 labeling_0.4.3
## [47] filelock_1.0.3 fansi_1.0.6
## [49] httr_1.4.7 abind_1.4-8
## [51] compiler_4.4.2 withr_3.0.2
## [53] bit64_4.5.2 pander_0.6.5
## [55] htmlTable_2.4.3 backports_1.5.0
## [57] BiocParallel_1.41.0 DBI_1.2.3
## [59] ggstats_0.7.0 biomaRt_2.63.0
## [61] rappdirs_0.3.3 DelayedArray_0.33.2
## [63] rjson_0.2.23 tools_4.4.2
## [65] foreign_0.8-87 nnet_7.3-19
## [67] glue_1.8.0 restfulr_0.0.15
## [69] grid_4.4.2 checkmate_2.3.2
## [71] reshape2_1.4.4 cluster_2.1.6
## [73] generics_0.1.3 gtable_0.3.6
## [75] BSgenome_1.75.0 ensembldb_2.31.0
## [77] tidyr_1.3.1 data.table_1.16.2
## [79] hms_1.1.3 xml2_1.3.6
## [81] utf8_1.2.4 XVector_0.47.0
## [83] BiocGenerics_0.53.3 pillar_1.9.0
## [85] stringr_1.5.1 limma_3.63.2
## [87] dplyr_1.1.4 BiocFileCache_2.15.0
## [89] lattice_0.22-6 deldir_2.0-4
## [91] rtracklayer_1.67.0 bit_4.5.0
## [93] EnsDb.Hsapiens.v75_2.99.0 biovizBase_1.55.0
## [95] tidyselect_1.2.1 maketools_1.3.1
## [97] Biostrings_2.75.1 gridExtra_2.3
## [99] ProtGenerics_1.39.0 IRanges_2.41.1
## [101] SummarizedExperiment_1.37.0 stats4_4.4.2
## [103] xfun_0.49 Biobase_2.67.0
## [105] statmod_1.5.0 matrixStats_1.4.1
## [107] stringi_1.8.4 UCSC.utils_1.3.0
## [109] lazyeval_0.2.2 yaml_2.3.10
## [111] evaluate_1.0.1 codetools_0.2-20
## [113] interp_1.1-6 tibble_3.2.1
## [115] BiocManager_1.30.25 cli_3.6.3
## [117] rpart_4.1.23 munsell_0.5.1
## [119] jquerylib_0.1.4 dichromat_2.0-0.1
## [121] Rcpp_1.0.13-1 GenomeInfoDb_1.43.1
## [123] dbplyr_2.5.0 png_0.1-8
## [125] XML_3.99-0.17 parallel_4.4.2
## [127] ggplot2_3.5.1 blob_1.2.4
## [129] prettyunits_1.2.0 jpeg_0.1-10
## [131] latticeExtra_0.6-30 AnnotationFilter_1.31.0
## [133] bitops_1.0-9 VariantAnnotation_1.53.0
## [135] scales_1.3.0 purrr_1.0.2
## [137] crayon_1.5.3 rlang_1.1.4
## [139] KEGGREST_1.47.0