knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(cmvdrg)

Call resistance mutations from cmvdrg

# load some test data, bundled in the package. also included: A10.fasta A10.tab A10_fragment.fasta
my_sample = system.file("testdata", "A10.vcf", package = "cmvdrg")

# call variants from the file also present in the cmvdrg database.
data = call_resistance(infile = my_sample, all_mutations = F)

# highlight resistance to Ganciclovir
print(data[,c("change", "freq", "Ganciclovir")])

View all mutations

It may be the case that your sequences contain nonsynonymous mutations in resistance genes, that may confer changes in resultant protein. Although there are many mutations accounted for in this database, of course there is a possibility to observe something novel. The call_resistance function allows for these sorts of questions.

# returns all variants, with any resistance data, with annotation of protein coded for & if it coded for a change in protein sequence.
mutations_all = call_resistance(infile = my_sample, all_mutations = T)


# to view all mutations in resistance genes we can use base R to filter.
mutations_res = mutations_all[mutations_all$GENEID %in% c("UL54", "UL97", "UL27", "UL51", "UL56", "UL89"),]


# 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)

## view the full database
db = cmvdrg_data()
head(db$aa_change)

as you can see, there are a number of variants in resistance genes that result in a change of protein sequence, and may deserve attention.

Visualise

# Generate a condensed output for the sample
make_clin_table(data)

Run the shiny app

# runShinyCMV()


ucl-pathgenomics/cmvdrg documentation built on Dec. 8, 2020, 2:36 a.m.