Title: | Deconvolute Mixed Genomes with Unknown Proportions |
---|---|
Description: | Traditional phasing programs are limited to diploid organisms. Our method modifies Li and Stephens algorithm with Markov chain Monte Carlo (MCMC) approaches, and builds a generic framework that allows haplotype searches in a multiple infection setting. This package is primarily developed as part of the Pf3k project, which is a global collaboration using the latest sequencing technologies to provide a high-resolution view of natural variation in the malaria parasite Plasmodium falciparum. Parasite DNA are extracted from patient blood sample, which often contains more than one parasite strain, with unknown proportions. This package is used for deconvoluting mixed haplotypes, and reporting the mixture proportions from each sample. |
Authors: | Joe Zhu [aut, cre, cph], Jacob Almagro-Garcia [aut], Gil McVean [aut], University of Oxford [cph], Yinghan Liu [ctb], CodeCogs Zyba Ltd [com, cph], Deepak Bandyopadhyay [com, cph], Lutz Kettner [com, cph] |
Maintainer: | Joe Zhu <[email protected]> |
License: | GPL (>= 3) |
Version: | 0.5.4 |
Built: | 2024-11-14 06:17:31 UTC |
Source: | CRAN |
Compute observed allele frequency within sample from the allele counts.
computeObsWSAF(alt, ref)
computeObsWSAF(alt, ref)
alt |
Numeric array of alternative allele count. |
ref |
Numeric array of reference allele count. |
Numeric array of observed allele frequency within sample.
histWSAF
for histogram.
# Example 1 refFile = system.file("extdata", "PG0390-C.test.ref", package = "DEploid") altFile = system.file("extdata", "PG0390-C.test.alt", package = "DEploid") PG0390CoverageT = extractCoverageFromTxt(refFile, altFile) obsWSAF = computeObsWSAF(PG0390CoverageT$altCount, PG0390CoverageT$refCount) # Example 2 vcfFile = system.file("extdata", "PG0390-C.test.vcf.gz", package = "DEploid") PG0390CoverageV = extractCoverageFromVcf(vcfFile) obsWSAF = computeObsWSAF(PG0390CoverageV$altCount, PG0390CoverageV$refCount)
# Example 1 refFile = system.file("extdata", "PG0390-C.test.ref", package = "DEploid") altFile = system.file("extdata", "PG0390-C.test.alt", package = "DEploid") PG0390CoverageT = extractCoverageFromTxt(refFile, altFile) obsWSAF = computeObsWSAF(PG0390CoverageT$altCount, PG0390CoverageT$refCount) # Example 2 vcfFile = system.file("extdata", "PG0390-C.test.vcf.gz", package = "DEploid") PG0390CoverageV = extractCoverageFromVcf(vcfFile) obsWSAF = computeObsWSAF(PG0390CoverageV$altCount, PG0390CoverageV$refCount)
Deconvolute mixed haplotypes, and reporting the mixture proportions from each sample
This function provieds an interface for calling dEploid from R.
The command line options are passed via the args
argument
dEploid(args)
dEploid(args)
args |
String of dEploid input. |
A list with members of haplotypes, proportions and log likelihood of the MCMC chain.
Haps
Haplotypes at the final iteration in plain text file.
Proportions
MCMC updates of the proportion estimates.
llks
Log likelihood of the MCMC chain.
The R version of DEploid uses random number from R's random generator. Therefore, the '-seed' argument of the command line version will be ignored, and no seed is given in the output. Use the R function 'set.seed' prior to calling this function to ensure reproduciblity of results.
vignette('dEploid-Arguments')
for an overview of commandline arguments
## Not run: vcfFile = system.file("extdata", "PG0390-C.test.vcf.gz", package = "DEploid") plafFile = system.file("extdata", "labStrains.test.PLAF.txt", package = "DEploid") set.seed(1234) PG0390.deconv = dEploid(paste("-vcf", vcfFile, "-plaf", plafFile, "-noPanel")) ## End(Not run)
## Not run: vcfFile = system.file("extdata", "PG0390-C.test.vcf.gz", package = "DEploid") plafFile = system.file("extdata", "labStrains.test.PLAF.txt", package = "DEploid") set.seed(1234) PG0390.deconv = dEploid(paste("-vcf", vcfFile, "-plaf", plafFile, "-noPanel")) ## End(Not run)
Extract read counts from tab-delimited text files of a single sample.
extractCoverageFromTxt(refFileName, altFileName)
extractCoverageFromTxt(refFileName, altFileName)
refFileName |
Path of the reference allele count file. |
altFileName |
Path of the alternative allele count file. |
A data.frame contains four columns: chromosomes, positions, reference allele count, alternative allele count.
The allele count files must be tab-delimited. The allele count files contain three columns: chromosomes, positions and allele count.
refFile = system.file("extdata", "PG0390-C.test.ref", package = "DEploid") altFile = system.file("extdata", "PG0390-C.test.alt", package = "DEploid") PG0390 = extractCoverageFromTxt(refFile, altFile)
refFile = system.file("extdata", "PG0390-C.test.ref", package = "DEploid") altFile = system.file("extdata", "PG0390-C.test.alt", package = "DEploid") PG0390 = extractCoverageFromTxt(refFile, altFile)
Extract read counts from VCF file of a single sample.
extractCoverageFromVcf(vcfFileName, ADFieldIndex = 2)
extractCoverageFromVcf(vcfFileName, ADFieldIndex = 2)
vcfFileName |
Path of the VCF file. |
ADFieldIndex |
Index of the AD field of the sample field. For example, if the format is "GT:AD:DP:GQ:PL", the AD index is 2 (by default). |
A data.frame contains four columns: chromosomes, positions, reference allele count, alternative allele count.
The VCF file should only contain one sample. If more samples present in the VCF, it only returns coverage for of the first sample.
vcfFile = system.file("extdata", "PG0390-C.test.vcf.gz", package = "DEploid") PG0390 = extractCoverageFromVcf(vcfFile)
vcfFile = system.file("extdata", "PG0390-C.test.vcf.gz", package = "DEploid") PG0390 = extractCoverageFromVcf(vcfFile)
Extract population level allele frequency (PLAF) from text file.
extractPLAF(plafFileName)
extractPLAF(plafFileName)
plafFileName |
Path of the PLAF text file. |
A numeric array of PLAF
The text file must have header, and population level allele frequency recorded in the "PLAF" field.
plafFile = system.file("extdata", "labStrains.test.PLAF.txt", package = "DEploid") plaf = extractPLAF(plafFile)
plafFile = system.file("extdata", "labStrains.test.PLAF.txt", package = "DEploid") plaf = extractPLAF(plafFile)
Extract VCF information
extractVcf(filename)
extractVcf(filename)
filename |
VCF file name. |
A dataframe list with members of haplotypes, proportions and log likelihood of the MCMC chain.
CHROM
SNP chromosomes.
POS
SNP positions.
refCount
reference allele count.
altCount
alternative allele count.
extractCoverageFromVcf
extractCoverageFromTxt
vcfFile = system.file("extdata", "PG0390-C.test.vcf.gz", package = "DEploid") vcf = extractVcf(vcfFile)
vcfFile = system.file("extdata", "PG0390-C.test.vcf.gz", package = "DEploid") vcf = extractVcf(vcfFile)
Plot the posterior probabilities of a haplotype given the refernece panel.
haplotypePainter( posteriorProbabilities, title = "", labelScaling, numberOfInbreeding = 0 )
haplotypePainter( posteriorProbabilities, title = "", labelScaling, numberOfInbreeding = 0 )
posteriorProbabilities |
Posterior probabilities matrix with the size of number of loci by the number of reference strain. |
title |
Figure title. |
labelScaling |
Scaling parameter for plotting. |
numberOfInbreeding |
Number of inbreeding strains copying from. |
Produce histogram of the allele frequency within sample.
histWSAF( obsWSAF, exclusive = TRUE, title = "Histogram 0<WSAF<1", cex.lab = 1, cex.main = 1, cex.axis = 1 )
histWSAF( obsWSAF, exclusive = TRUE, title = "Histogram 0<WSAF<1", cex.lab = 1, cex.main = 1, cex.axis = 1 )
obsWSAF |
Observed allele frequency within sample |
exclusive |
When TRUE 0 < WSAF < 1; otherwise 0 <= WSAF <= 1. |
title |
Histogram title |
cex.lab |
Label size. |
cex.main |
Title size. |
cex.axis |
Axis text size. |
histogram
# Example 1 refFile = system.file("extdata", "PG0390-C.test.ref", package = "DEploid") altFile = system.file("extdata", "PG0390-C.test.alt", package = "DEploid") PG0390Coverage = extractCoverageFromTxt(refFile, altFile) obsWSAF = computeObsWSAF(PG0390Coverage$altCount, PG0390Coverage$refCount) histWSAF(obsWSAF) myhist = histWSAF(obsWSAF, FALSE) # Example 2 vcfFile = system.file("extdata", "PG0390-C.test.vcf.gz", package = "DEploid") PG0390CoverageV = extractCoverageFromVcf(vcfFile) obsWSAF = computeObsWSAF(PG0390CoverageV$altCount, PG0390CoverageV$refCount) histWSAF(obsWSAF) myhist = histWSAF(obsWSAF, FALSE)
# Example 1 refFile = system.file("extdata", "PG0390-C.test.ref", package = "DEploid") altFile = system.file("extdata", "PG0390-C.test.alt", package = "DEploid") PG0390Coverage = extractCoverageFromTxt(refFile, altFile) obsWSAF = computeObsWSAF(PG0390Coverage$altCount, PG0390Coverage$refCount) histWSAF(obsWSAF) myhist = histWSAF(obsWSAF, FALSE) # Example 2 vcfFile = system.file("extdata", "PG0390-C.test.vcf.gz", package = "DEploid") PG0390CoverageV = extractCoverageFromVcf(vcfFile) obsWSAF = computeObsWSAF(PG0390CoverageV$altCount, PG0390CoverageV$refCount) histWSAF(obsWSAF) myhist = histWSAF(obsWSAF, FALSE)
Plot alternative allele count vs reference allele count at each site.
plotAltVsRef( ref, alt, title = "Alt vs Ref", exclude.ref = c(), exclude.alt = c(), potentialOutliers = c(), cex.lab = 1, cex.main = 1, cex.axis = 1 )
plotAltVsRef( ref, alt, title = "Alt vs Ref", exclude.ref = c(), exclude.alt = c(), potentialOutliers = c(), cex.lab = 1, cex.main = 1, cex.axis = 1 )
ref |
Numeric array of reference allele count. |
alt |
Numeric array of alternative allele count. |
title |
Figure title, "Alt vs Ref" by default |
exclude.ref |
Numeric array of reference allele count at sites that are not deconvoluted. |
exclude.alt |
Numeric array of alternative allele count at sites that are not deconvoluted |
potentialOutliers |
Index of potential outliers. |
cex.lab |
Label size. |
cex.main |
Title size. |
cex.axis |
Axis text size. |
# Example 1 refFile = system.file("extdata", "PG0390-C.test.ref", package = "DEploid") altFile = system.file("extdata", "PG0390-C.test.alt", package = "DEploid") PG0390CoverageT = extractCoverageFromTxt(refFile, altFile) plotAltVsRef(PG0390CoverageT$refCount, PG0390CoverageT$altCount) # Example 2 vcfFile = system.file("extdata", "PG0390-C.test.vcf.gz", package = "DEploid") PG0390CoverageV = extractCoverageFromVcf(vcfFile) plotAltVsRef(PG0390CoverageV$refCount, PG0390CoverageV$altCount)
# Example 1 refFile = system.file("extdata", "PG0390-C.test.ref", package = "DEploid") altFile = system.file("extdata", "PG0390-C.test.alt", package = "DEploid") PG0390CoverageT = extractCoverageFromTxt(refFile, altFile) plotAltVsRef(PG0390CoverageT$refCount, PG0390CoverageT$altCount) # Example 2 vcfFile = system.file("extdata", "PG0390-C.test.vcf.gz", package = "DEploid") PG0390CoverageV = extractCoverageFromVcf(vcfFile) plotAltVsRef(PG0390CoverageV$refCount, PG0390CoverageV$altCount)
Plot alternative allele count vs reference allele count at each site.
plotAltVsRefPlotly(ref, alt, title = "Alt vs Ref", potentialOutliers = c())
plotAltVsRefPlotly(ref, alt, title = "Alt vs Ref", potentialOutliers = c())
ref |
Numeric array of reference allele count. |
alt |
Numeric array of alternative allele count. |
title |
Figure title, "Alt vs Ref" by default |
potentialOutliers |
Index of potential outliers. |
# Example 1 refFile = system.file("extdata", "PG0390-C.test.ref", package = "DEploid") altFile = system.file("extdata", "PG0390-C.test.alt", package = "DEploid") PG0390CoverageT = extractCoverageFromTxt(refFile, altFile) plotAltVsRefPlotly(PG0390CoverageT$refCount, PG0390CoverageT$altCount) # Example 2 vcfFile = system.file("extdata", "PG0390-C.test.vcf.gz", package = "DEploid") PG0390CoverageV = extractCoverageFromVcf(vcfFile) plotAltVsRefPlotly(PG0390CoverageV$refCount, PG0390CoverageV$altCount)
# Example 1 refFile = system.file("extdata", "PG0390-C.test.ref", package = "DEploid") altFile = system.file("extdata", "PG0390-C.test.alt", package = "DEploid") PG0390CoverageT = extractCoverageFromTxt(refFile, altFile) plotAltVsRefPlotly(PG0390CoverageT$refCount, PG0390CoverageT$altCount) # Example 2 vcfFile = system.file("extdata", "PG0390-C.test.vcf.gz", package = "DEploid") PG0390CoverageV = extractCoverageFromVcf(vcfFile) plotAltVsRefPlotly(PG0390CoverageV$refCount, PG0390CoverageV$altCount)
Produce histogram of the allele frequency within sample.
plotHistWSAFPlotly(obsWSAF, exclusive = TRUE, title = "Histogram 0<WSAF<1")
plotHistWSAFPlotly(obsWSAF, exclusive = TRUE, title = "Histogram 0<WSAF<1")
obsWSAF |
Observed allele frequency within sample |
exclusive |
When TRUE 0 < WSAF < 1; otherwise 0 <= WSAF <= 1. |
title |
Figure title, "Histogram 0<WSAF<1" by default |
histogram
# Example 1 refFile = system.file("extdata", "PG0390-C.test.ref", package = "DEploid") altFile = system.file("extdata", "PG0390-C.test.alt", package = "DEploid") PG0390Coverage = extractCoverageFromTxt(refFile, altFile) obsWSAF = computeObsWSAF(PG0390Coverage$altCount, PG0390Coverage$refCount) plotHistWSAFPlotly(obsWSAF) myhist = plotHistWSAFPlotly(obsWSAF) # Example 2 vcfFile = system.file("extdata", "PG0390-C.test.vcf.gz", package = "DEploid") PG0390CoverageV = extractCoverageFromVcf(vcfFile) obsWSAF = computeObsWSAF(PG0390CoverageV$altCount, PG0390CoverageV$refCount) plotHistWSAFPlotly(obsWSAF) myhist = plotHistWSAFPlotly(obsWSAF)
# Example 1 refFile = system.file("extdata", "PG0390-C.test.ref", package = "DEploid") altFile = system.file("extdata", "PG0390-C.test.alt", package = "DEploid") PG0390Coverage = extractCoverageFromTxt(refFile, altFile) obsWSAF = computeObsWSAF(PG0390Coverage$altCount, PG0390Coverage$refCount) plotHistWSAFPlotly(obsWSAF) myhist = plotHistWSAFPlotly(obsWSAF) # Example 2 vcfFile = system.file("extdata", "PG0390-C.test.vcf.gz", package = "DEploid") PG0390CoverageV = extractCoverageFromVcf(vcfFile) obsWSAF = computeObsWSAF(PG0390CoverageV$altCount, PG0390CoverageV$refCount) plotHistWSAFPlotly(obsWSAF) myhist = plotHistWSAFPlotly(obsWSAF)
Plot observed alternative allele frequency within sample against expected WSAF.
plotObsExpWSAF( obsWSAF, expWSAF, title = "WSAF(observed vs expected)", cex.lab = 1, cex.main = 1, cex.axis = 1 )
plotObsExpWSAF( obsWSAF, expWSAF, title = "WSAF(observed vs expected)", cex.lab = 1, cex.main = 1, cex.axis = 1 )
obsWSAF |
Numeric array of observed WSAF. |
expWSAF |
Numeric array of expected WSAF. |
title |
Figure title. |
cex.lab |
Label size. |
cex.main |
Title size. |
cex.axis |
Axis text size. |
## Not run: vcfFile = system.file("extdata", "PG0390-C.test.vcf.gz", package = "DEploid") PG0390CoverageV = extractCoverageFromVcf(vcfFile) obsWSAF = computeObsWSAF(PG0390CoverageV$altCount, PG0390CoverageV$refCount) plafFile = system.file("extdata", "labStrains.test.PLAF.txt", package = "DEploid") PG0390.deconv = dEploid(paste("-vcf", vcfFile, "-plaf", plafFile, "-noPanel")) prop = PG0390.deconv$Proportions[dim(PG0390.deconv$Proportions)[1],] expWSAF = t(PG0390.deconv$Haps) %*% prop plotObsExpWSAF(obsWSAF, expWSAF) ## End(Not run)
## Not run: vcfFile = system.file("extdata", "PG0390-C.test.vcf.gz", package = "DEploid") PG0390CoverageV = extractCoverageFromVcf(vcfFile) obsWSAF = computeObsWSAF(PG0390CoverageV$altCount, PG0390CoverageV$refCount) plafFile = system.file("extdata", "labStrains.test.PLAF.txt", package = "DEploid") PG0390.deconv = dEploid(paste("-vcf", vcfFile, "-plaf", plafFile, "-noPanel")) prop = PG0390.deconv$Proportions[dim(PG0390.deconv$Proportions)[1],] expWSAF = t(PG0390.deconv$Haps) %*% prop plotObsExpWSAF(obsWSAF, expWSAF) ## End(Not run)
Plot observed alternative allele frequency within sample against expected WSAF.
plotObsExpWSAFPlotly(obsWSAF, expWSAF, title = "WSAF(observed vs expected)")
plotObsExpWSAFPlotly(obsWSAF, expWSAF, title = "WSAF(observed vs expected)")
obsWSAF |
Numeric array of observed WSAF. |
expWSAF |
Numeric array of expected WSAF. |
title |
Figure title, "WSAF(observed vs expected)" by default |
## Not run: vcfFile = system.file("extdata", "PG0390-C.test.vcf.gz", package = "DEploid") PG0390CoverageV = extractCoverageFromVcf(vcfFile) obsWSAF = computeObsWSAF(PG0390CoverageV$altCount, PG0390CoverageV$refCount) plafFile = system.file("extdata", "labStrains.test.PLAF.txt", package = "DEploid") PG0390CoverageV.deconv = dEploid(paste("-vcf", vcfFile, "-plaf", plafFile, "-noPanel")) prop = PG0390CoverageV.deconv$Proportions[dim(PG0390CoverageV.deconv $Proportions)[1],] expWSAF = t(PG0390CoverageV.deconv$Haps) %*% prop plotObsExpWSAFPlotly(obsWSAF, expWSAF) ## End(Not run)
## Not run: vcfFile = system.file("extdata", "PG0390-C.test.vcf.gz", package = "DEploid") PG0390CoverageV = extractCoverageFromVcf(vcfFile) obsWSAF = computeObsWSAF(PG0390CoverageV$altCount, PG0390CoverageV$refCount) plafFile = system.file("extdata", "labStrains.test.PLAF.txt", package = "DEploid") PG0390CoverageV.deconv = dEploid(paste("-vcf", vcfFile, "-plaf", plafFile, "-noPanel")) prop = PG0390CoverageV.deconv$Proportions[dim(PG0390CoverageV.deconv $Proportions)[1],] expWSAF = t(PG0390CoverageV.deconv$Haps) %*% prop plotObsExpWSAFPlotly(obsWSAF, expWSAF) ## End(Not run)
Plot the MCMC samples of the proportion, indexed by the MCMC chain.
plotProportions( proportions, title = "Components", cex.lab = 1, cex.main = 1, cex.axis = 1 )
plotProportions( proportions, title = "Components", cex.lab = 1, cex.main = 1, cex.axis = 1 )
proportions |
Matrix of the MCMC proportion samples. The matrix size is number of the MCMC samples by the number of strains. |
title |
Figure title. |
cex.lab |
Label size. |
cex.main |
Title size. |
cex.axis |
Axis text size. |
## Not run: plafFile = system.file("extdata", "labStrains.test.PLAF.txt", package = "DEploid") panelFile = system.file("extdata", "labStrains.test.panel.txt", package = "DEploid") refFile = system.file("extdata", "PG0390-C.test.ref", package = "DEploid") altFile = system.file("extdata", "PG0390-C.test.alt", package = "DEploid") PG0390CoverageT = extractCoverageFromTxt(refFile, altFile) PG0390Coverage.deconv = dEploid(paste("-ref", refFile, "-alt", altFile, "-plaf", plafFile, "-noPanel")) plotProportions(PG0390Coverage.deconv$Proportions, "PG0390-C proportions") ## End(Not run)
## Not run: plafFile = system.file("extdata", "labStrains.test.PLAF.txt", package = "DEploid") panelFile = system.file("extdata", "labStrains.test.panel.txt", package = "DEploid") refFile = system.file("extdata", "PG0390-C.test.ref", package = "DEploid") altFile = system.file("extdata", "PG0390-C.test.alt", package = "DEploid") PG0390CoverageT = extractCoverageFromTxt(refFile, altFile) PG0390Coverage.deconv = dEploid(paste("-ref", refFile, "-alt", altFile, "-plaf", plafFile, "-noPanel")) plotProportions(PG0390Coverage.deconv$Proportions, "PG0390-C proportions") ## End(Not run)
Plot allele frequencies within sample against population level.
plotWSAFvsPLAF( plaf, obsWSAF, expWSAF = c(), potentialOutliers = c(), title = "WSAF vs PLAF", cex.lab = 1, cex.main = 1, cex.axis = 1 )
plotWSAFvsPLAF( plaf, obsWSAF, expWSAF = c(), potentialOutliers = c(), title = "WSAF vs PLAF", cex.lab = 1, cex.main = 1, cex.axis = 1 )
plaf |
Numeric array of population level allele frequency. |
obsWSAF |
Numeric array of observed altenative allele frequencies within sample. |
expWSAF |
Numeric array of expected WSAF from model. |
potentialOutliers |
Index of potential outliers. |
title |
Figure title, "WSAF vs PLAF" by default |
cex.lab |
Label size. |
cex.main |
Title size. |
cex.axis |
Axis text size. |
# Example 1 refFile = system.file("extdata", "PG0390-C.test.ref", package = "DEploid") altFile = system.file("extdata", "PG0390-C.test.alt", package = "DEploid") PG0390CoverageT = extractCoverageFromTxt(refFile, altFile) obsWSAF = computeObsWSAF(PG0390CoverageT$altCount, PG0390CoverageT$refCount) plafFile = system.file("extdata", "labStrains.test.PLAF.txt", package = "DEploid") plaf = extractPLAF(plafFile) plotWSAFvsPLAF(plaf, obsWSAF) # Example 2 vcfFile = system.file("extdata", "PG0390-C.test.vcf.gz", package = "DEploid") PG0390CoverageV = extractCoverageFromVcf(vcfFile) obsWSAF = computeObsWSAF(PG0390CoverageV$altCount, PG0390CoverageV$refCount) plafFile = system.file("extdata", "labStrains.test.PLAF.txt", package = "DEploid") plaf = extractPLAF(plafFile) plotWSAFvsPLAF(plaf, obsWSAF)
# Example 1 refFile = system.file("extdata", "PG0390-C.test.ref", package = "DEploid") altFile = system.file("extdata", "PG0390-C.test.alt", package = "DEploid") PG0390CoverageT = extractCoverageFromTxt(refFile, altFile) obsWSAF = computeObsWSAF(PG0390CoverageT$altCount, PG0390CoverageT$refCount) plafFile = system.file("extdata", "labStrains.test.PLAF.txt", package = "DEploid") plaf = extractPLAF(plafFile) plotWSAFvsPLAF(plaf, obsWSAF) # Example 2 vcfFile = system.file("extdata", "PG0390-C.test.vcf.gz", package = "DEploid") PG0390CoverageV = extractCoverageFromVcf(vcfFile) obsWSAF = computeObsWSAF(PG0390CoverageV$altCount, PG0390CoverageV$refCount) plafFile = system.file("extdata", "labStrains.test.PLAF.txt", package = "DEploid") plaf = extractPLAF(plafFile) plotWSAFvsPLAF(plaf, obsWSAF)
Plot allele frequencies within sample against population level.
plotWSAFVsPLAFPlotly( plaf, obsWSAF, ref, alt, title = "WSAF vs PLAF", potentialOutliers = c() )
plotWSAFVsPLAFPlotly( plaf, obsWSAF, ref, alt, title = "WSAF vs PLAF", potentialOutliers = c() )
plaf |
Numeric array of population level allele frequency. |
obsWSAF |
Numeric array of observed altenative allele frequencies within sample. |
ref |
Numeric array of reference allele count. |
alt |
Numeric array of alternative allele count. |
title |
Figure title, "WSAF vs PLAF" by default |
potentialOutliers |
Index of potential outliers. |
# Example 1 refFile = system.file("extdata", "PG0390-C.test.ref", package = "DEploid") altFile = system.file("extdata", "PG0390-C.test.alt", package = "DEploid") PG0390CoverageT = extractCoverageFromTxt(refFile, altFile) obsWSAF = computeObsWSAF(PG0390CoverageT$altCount, PG0390CoverageT$refCount) plafFile = system.file("extdata", "labStrains.test.PLAF.txt", package = "DEploid") plaf = extractPLAF(plafFile) plotWSAFVsPLAFPlotly(plaf, obsWSAF, PG0390CoverageT$refCount, PG0390CoverageT$altCount) # Example 2 vcfFile = system.file("extdata", "PG0390-C.test.vcf.gz", package = "DEploid") PG0390CoverageV = extractCoverageFromVcf(vcfFile) obsWSAF = computeObsWSAF(PG0390CoverageV$altCount, PG0390CoverageV$refCount) plafFile = system.file("extdata", "labStrains.test.PLAF.txt", package = "DEploid") plaf = extractPLAF(plafFile) plotWSAFVsPLAFPlotly(plaf, obsWSAF, PG0390CoverageV$refCount, PG0390CoverageV$altCount)
# Example 1 refFile = system.file("extdata", "PG0390-C.test.ref", package = "DEploid") altFile = system.file("extdata", "PG0390-C.test.alt", package = "DEploid") PG0390CoverageT = extractCoverageFromTxt(refFile, altFile) obsWSAF = computeObsWSAF(PG0390CoverageT$altCount, PG0390CoverageT$refCount) plafFile = system.file("extdata", "labStrains.test.PLAF.txt", package = "DEploid") plaf = extractPLAF(plafFile) plotWSAFVsPLAFPlotly(plaf, obsWSAF, PG0390CoverageT$refCount, PG0390CoverageT$altCount) # Example 2 vcfFile = system.file("extdata", "PG0390-C.test.vcf.gz", package = "DEploid") PG0390CoverageV = extractCoverageFromVcf(vcfFile) obsWSAF = computeObsWSAF(PG0390CoverageV$altCount, PG0390CoverageV$refCount) plafFile = system.file("extdata", "labStrains.test.PLAF.txt", package = "DEploid") plaf = extractPLAF(plafFile) plotWSAFVsPLAFPlotly(plaf, obsWSAF, PG0390CoverageV$refCount, PG0390CoverageV$altCount)