Learn R Programming

CovidMutations

A feasible framework for mutation analysis and reverse transcription polymerase chain reaction (RT-PCR) assay evaluation of COVID-19, including mutation profile visualization, statistics and mutation ratio of each assay. The mutation ratio is conducive to evaluating the coverage of RT-PCR assays in large-sized samples.

Installation

devtools::install_github("MSQ-123/CovidMutations")

Usage

mergeEvents

Merge neighboring events of SNP, insertion and deletion.

#The example data:
data("nucmer")

#The input nucmer object can be made by the comment below:
#options(stringsAsFactors = FALSE)
#nucmer<-read.delim("nucmer.snps",as.is=TRUE,skip=4,header=FALSE)
#colnames(nucmer)<-c("rpos","rvar","qvar","qpos","","","","","rlength","qlength","","","rname","qname")
#rownames(nucmer)<-paste0("var",1:nrow(nucmer))

# Fix IUPAC codes
nucmer<-nucmer[!nucmer$qvar%in%c("B","D","H","K","M","N","R","S","V","W","Y"),]
nucmer<- mergeEvents(nucmer = nucmer)## This will update the nucmer object

indelSNP

Provide effects of each SNP, insertion and deletion in virus genome.

data("refseq")
data("gff3")
annot <- setNames(gff3[,10],gff3[,9])  #annot: subset the gene and its product.
outdir <- tempdir()
indelSNP(nucmer = nucmer,
         saveRda = FALSE,
         refseq = refseq,
         gff3 = gff3,
         annot = annot,
         outdir = outdir)

plotMutAnno

Plot the mutation statistics after annotating the “nucmer” object by “indelSNP” function.

data("covid_annot")
covid_annot <- as.data.frame(covid_annot)
#outdir <- tempdir()
plotMutAnno(results = covid_annot,figureType = "MostMut", outdir = outdir)

nucmerRMD

Preprocess “nucmer” object to add group information.

data("nucmer")
data("chinalist")
outdir <- tempdir()
nucmerRMD(nucmer = nucmer, outdir = outdir, chinalist = chinalist)

globalSNPprofile

Global SNP profiling in virus genome

Note: In order to get a better global SNP profile, the “nucmerr” data is obtained from 150000 mutation sites downsampled from the “nucmer” object(which is for 37527 samples, not for 5465 samples in the “nucmer” example data).

data("nucmerr")
outdir <- tempdir()
globalSNPprofile(nucmerr = nucmerr, outdir = outdir, figure_Type = "heatmap")

mutStat

Plot mutation statistics for nucleiotide.

If the figure type is “TopCountryMut”, “mutpos” can specify a range of genomic position(eg. 28831:28931) for plot.

outdir <- tempdir()
mutStat(nucmerr = nucmerr,
        outdir = ".",
        figure_Type = "TopMuSample",
        type_top = 10,
        country = FALSE,
        mutpos = NULL)

AssayMutRatio

Calculate the mutation detection rate using different assays

data("assays")
Total <- 11000 ## Total Cleared GISAID fasta data, sekitseq
outdir <- tempdir()
#Output the results
AssayMutRatio(nucmerr = nucmerr,
              assays = assays,
              totalsample = Total,
              plotType = "logtrans",
              outdir = outdir)

MutByGene

Plot mutation counts for certain genes

data("gene_position")
outdir <- tempdir()
MutByGene(nucmerr = nucmerr, gff3 = gene_position, figurelist = TRUE, outdir = outdir)
#if figurelist = TRUE, the recommendation for figure display(in pixel)is: width=1650, height=1300

=======

Further

Other functions usage: globalProteinMut, LastfiveNrMutation. etc. Please refer to the vignettes.

Copy Link

Version

Install

install.packages('CovidMutations')

Monthly Downloads

213

Version

0.1.3

License

Artistic-2.0

Issues

Pull Requests

Stars

Forks

Maintainer

Shaoqian Ma

Last Published

September 18th, 2020

Functions in CovidMutations (0.1.3)

covid_annot

Mutation annotation results produced by "indelSNP" function
AssayMutRatio

Calculate the mutation detection rate using different assays
doubleAssay

Detection of co-occurring mutations using double-assay information
MutByGene

Plot mutation counts for certain genes
globalProteinMut

Global mutational events profiling of proteins
LastfiveNrMutation

Bacth assay analysis for last five Nr of primers
gff3

"GFF3" format annotation data for SARS-Cov-2
gene_position

"GFF3" format gene position data for SARS-Cov-2
assays

Assays for mutation detection using different primers and probes
chinalist

A list of places in China
nucmer

Mutation information derived from "nucmer" SNP analysis
mergeEvents

Merge neighboring events of single nucleotide polymorphism (SNP), insertion and deletion.
plotMutAnno

Plot the mutation statistics after annotating the "nucmer" object by "indelSNP" function
plotMutProteins

Plot the most frequent mutational events for proteins in the SARS-CoV-2 genome
nucmerr

Preprocessed "nucmer.snps" file using "nucmerRMD" function
refseq

SARS-Cov-2 genomic reference sequence from NCBI
nucmerRMD

Preprocess "nucmer" object to add group information
mutStat

Plot mutation statistics for nucleiotide
indelSNP

Provide effects of each single nucleotide polymorphism (SNP), insertion and deletion in virus genome
globalSNPprofile

Global single nucleotide polymorphism (SNP) profiling in virus genome