knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
hsvdrg is a R package to enable antiviral drug resistance genotyping, with Herpes Simplex Virus 1 sequencing data. Accepted inputs are FASTA (whole genomes & fragments) which will be mapped to RefSeq NC_001806.2. NGS variant data assembled to NC_001806.2 is accepted in VCF >= ver4.0 & Varscan2 tab formats.
All data extracted from https://academic.oup.com/jac/article/71/1/6/2363653 and contains the relationships between:
A user-friendly Shiny Applications has been bundled with this package. The same application is available over the internet here http://cmv-resistance.ucl.ac.uk/hsvdrg/ where the terms of use are contained.
You can install the current version from GitHub with:
# install.packages("devtools") devtools::install_github("ojcharles/hsvdrg")
Dependencies for FASTA file handling are MAFFT and SNP-Sites available preferably via conda. snp-sites >= 2.3 has been tested. ```{bash, eval=FALSE} conda config --add channels bioconda conda install snp-sites conda install mafft
## Usage ### vcf data ```r library("hsvdrg") ## call resistant variants my_sample = system.file("testdata", "F716L.vcf", package = "hsvdrg") data = call_resistance(infile = my_sample, all_mutations = F) data[ , c("change", "freq", "Aciclovir", "Pencyclovir", "Foscarnet")] ## call all variants mutations_all = call_resistance(infile = my_sample, all_mutations = T) #to view all mutations in resistance genes we can filter mutations_res = mutations_all[mutations_all$GENEID %in% c("UL30"),] head(mutations_res[,c(1,8,21,32:40)]) ## call nonsynonymous variants # are there any non-synonymous (DNA variants that result in a change of amino acid) variants in resistance genes mutations_res_nonsyn = mutations_res[mutations_res$CONSEQUENCE == "nonsynonymous",] # here the top 3 mutations are nonsynonymous, with no identified resistance effect. head(mutations_res_nonsyn[,c(1,8,21,32:40)])
# hsvdrg accepts sequence fragments or whole-genomes, one fasta sequence at a time. # load example data my_sequence = system.file("testdata", "F716L.fasta", package = "hsvdrg") dat = call_resistance(infile = my_sequence, all_mutations = T) head(dat)
## view the full database db = hsvdrg_data() head(db$aa_change) ## run the shiny application # runShinyHSV()
If you encounter a clear bug, please file an issue with a minimal reproducible example on the GitHub Issues page. For questions and other discussions feel free to contact. Oscar Charles - maintainer
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.