Learn R Programming

vanquish

The goal of vanquish is to detect whether a sample with variant information is contaminated by another sample from the same species.

Example

This is a basic example which shows you how to detect whether vcf_example is contaminated:

## basic example code
library('vanquish')
data(vcf_example)
result <- defcon(file = vcf_example)
print(result$stat)
#>               Name       LOH       HomVar     HetVar  HomRate   HighRate
#> 1 sssc_test.vcf.gz 0.7248322 0.0001565125 0.02757586 0.536965 0.05350195
#>     HetRate    LowRate    AvgLL
#> 1 0.3608949 0.04669261 -2.01978
print(result$result)
#>               Name Class Regression
#> 1 sssc_test.vcf.gz     1  0.7131992

Given class = 1, vcf_example is considered to be contaminated.

Copy Link

Version

Install

install.packages('vanquish')

Monthly Downloads

18

Version

1.0.0

License

GPL-2

Maintainer

Tao Jiang

Last Published

September 5th, 2018

Functions in vanquish (1.0.0)

locateFile

Check input filename
vcf_example

VCF example file.
readVarDict

Read in input vcf data in VarDict format for Contamination detection
summary_vcf

VCF Data Summary
rmChangePoint

Remove CNV regions within VCF files by change point method
readStrelka

Read in input vcf data in strelka2 format for Contamination detection
negll

Negative Log Likelihood
readGATK

Read in input vcf data in GATK format for Contamination detection
svm_class_model

Default svm classification model.
svm_regression_model

Default svm regression model.
getRatio

Get the ratio of allele frequencies with a region
getLowDepth

Low depth percentage
rho_est

Estimate Rho for Alternative Allele Frequency
rmCNVinVCF

Remove CNV regions within VCF files given cnv file
read_vcf

VCF Data Input
readVarPROWL

Read in input vcf data in VarPROWL format
update_vcf

Remove CNV regions within VCF files
train_ct

Train Contamination Detection Model
getAvgLL

Calculate average log-likelihood
getSkewness

Get absolute value of skewness
getAnnoRate

Annotation rate
config_df

Default parameters of config.
getAlt2

Second alternative allele percentage
generate_feature

Feature Generation for Contamination Detection Model
defcon

DEtection of Frequency CONtamination
getSNVRate

SNV percentage
getVar

Calculate zygosity variable