Skip to content

Commit

Permalink
updateing namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
shajoezhu committed Dec 7, 2024
1 parent c33b07d commit 6e5eeae
Show file tree
Hide file tree
Showing 14 changed files with 86 additions and 48 deletions.
4 changes: 4 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
^DEploid-Utilities\.Rproj$
^\.Rproj\.user$
^LICENSE\.md$
LICENSE
.github
\*\.o
vcf/vcfReader.o
26 changes: 26 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,31 @@ export(plotObsExpWSAF)
export(plotProportions)
export(plotWSAFvsPLAF)
importFrom(Rcpp,evalCpp)
importFrom(grDevices,adjustcolor)
importFrom(grDevices,colorRampPalette)
importFrom(grDevices,dev.off)
importFrom(grDevices,heat.colors)
importFrom(grDevices,pdf)
importFrom(grDevices,png)
importFrom(grDevices,rainbow)
importFrom(graphics,abline)
importFrom(graphics,axis)
importFrom(graphics,barplot)
importFrom(graphics,hist)
importFrom(graphics,image)
importFrom(graphics,layout)
importFrom(graphics,legend)
importFrom(graphics,lines)
importFrom(graphics,par)
importFrom(graphics,points)
importFrom(graphics,rect)
importFrom(magrittr,"%>%")
importFrom(scales,alpha)
importFrom(stats,cor)
importFrom(stats,cov)
importFrom(stats,quantile)
importFrom(stats,sd)
importFrom(stats,var)
importFrom(utils,read.table)
importFrom(utils,write.table)
useDynLib(DEploid.utils, .registration = TRUE)
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# DEploid.utils 0.0.0.9000

* First release.
5 changes: 5 additions & 0 deletions R/deploid_utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,10 @@
#'
#' @importFrom Rcpp evalCpp
#' @importFrom scales alpha
#' @importFrom magrittr %>%
#' @importFrom utils read.table write.table
#' @importFrom stats cor cov quantile sd var
#' @importFrom graphics abline axis barplot hist image layout legend lines par points rect
#' @importFrom grDevices adjustcolor colorRampPalette dev.off heat.colors pdf png rainbow
#' @useDynLib DEploid.utils, .registration = TRUE
NULL
48 changes: 24 additions & 24 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#' @export
#'
#' @examples
#' refFile = system.file("extdata", "PG0390-C.test.ref", package = "DEploid")
#' altFile = system.file("extdata", "PG0390-C.test.alt", package = "DEploid")
#' refFile = system.file("extdata", "PG0390-C.test.ref", package = "DEploid.utils")
#' altFile = system.file("extdata", "PG0390-C.test.alt", package = "DEploid.utils")
#' PG0390 = extractCoverageFromTxt(refFile, altFile)
#'
extractCoverageFromTxt <- function ( refFileName, altFileName ){
Expand Down Expand Up @@ -43,7 +43,7 @@ extractCoverageFromTxt <- function ( refFileName, altFileName ){
#' @export
#'
#' @examples
#' vcfFile = system.file("extdata", "PG0390-C.test.vcf.gz", package = "DEploid")
#' vcfFile = system.file("extdata", "PG0390-C.test.vcf.gz", package = "DEploid.utils")
#' PG0390 = extractCoverageFromVcf(vcfFile)
#'
extractCoverageFromVcf <- function ( vcfFileName, ADFieldIndex = 2 ){
Expand Down Expand Up @@ -102,7 +102,7 @@ extractCoverageFromVcf <- function ( vcfFileName, ADFieldIndex = 2 ){
#' @export
#'
#' @examples
#' plafFile = system.file("extdata", "labStrains.test.PLAF.txt", package = "DEploid")
#' plafFile = system.file("extdata", "labStrains.test.PLAF.txt", package = "DEploid.utils")
#' plaf = extractPLAF(plafFile)
#'
extractPLAF <- function ( plafFileName ){
Expand All @@ -127,10 +127,10 @@ extractPLAF <- function ( plafFileName ){
#' @export
#'
#' @examples
#' 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")
#' plafFile = system.file("extdata", "labStrains.test.PLAF.txt", package = "DEploid.utils")
#' panelFile = system.file("extdata", "labStrains.test.panel.txt", package = "DEploid.utils")
#' refFile = system.file("extdata", "PG0390-C.test.ref", package = "DEploid.utils")
#' altFile = system.file("extdata", "PG0390-C.test.alt", package = "DEploid.utils")
#' PG0390CoverageTxt = extractCoverageFromTxt(refFile, altFile)
#' PG0390CoverageTxt.deconv = dEploid(paste("-ref", refFile, "-alt", altFile,
#' "-plaf", plafFile, "-noPanel"))
Expand Down Expand Up @@ -170,13 +170,13 @@ plotProportions <- function (proportions, title = "Components",
#'
#' @examples
#' # Example 1
#' refFile = system.file("extdata", "PG0390-C.test.ref", package = "DEploid")
#' altFile = system.file("extdata", "PG0390-C.test.alt", package = "DEploid")
#' refFile = system.file("extdata", "PG0390-C.test.ref", package = "DEploid.utils")
#' altFile = system.file("extdata", "PG0390-C.test.alt", package = "DEploid.utils")
#' PG0390CoverageTxt = extractCoverageFromTxt(refFile, altFile)
#' plotAltVsRef( PG0390CoverageTxt$refCount, PG0390CoverageTxt$altCount )
#'
#' # Example 2
#' vcfFile = system.file("extdata", "PG0390-C.test.vcf.gz", package = "DEploid")
#' vcfFile = system.file("extdata", "PG0390-C.test.vcf.gz", package = "DEploid.utils")
#' PG0390CoverageVcf = extractCoverageFromVcf(vcfFile)
#' plotAltVsRef( PG0390CoverageVcf$refCount, PG0390CoverageVcf$altCount )
#'
Expand Down Expand Up @@ -230,15 +230,15 @@ plotAltVsRef <- function ( ref, alt, title = "Alt vs Ref",
#'
#' @examples
#' # Example 1
#' refFile = system.file("extdata", "PG0390-C.test.ref", package = "DEploid")
#' altFile = system.file("extdata", "PG0390-C.test.alt", package = "DEploid")
#' refFile = system.file("extdata", "PG0390-C.test.ref", package = "DEploid.utils")
#' altFile = system.file("extdata", "PG0390-C.test.alt", package = "DEploid.utils")
#' PG0390CoverageTxt = extractCoverageFromTxt(refFile, altFile)
#' obsWSAF = computeObsWSAF( PG0390CoverageTxt$altCount, PG0390CoverageTxt$refCount )
#' histWSAF(obsWSAF)
#' myhist = histWSAF(obsWSAF, FALSE)
#'
#' # Example 2
#' vcfFile = system.file("extdata", "PG0390-C.test.vcf.gz", package = "DEploid")
#' vcfFile = system.file("extdata", "PG0390-C.test.vcf.gz", package = "DEploid.utils")
#' PG0390CoverageVcf = extractCoverageFromVcf(vcfFile)
#' obsWSAF = computeObsWSAF( PG0390CoverageVcf$altCount, PG0390CoverageVcf$refCount )
#' histWSAF(obsWSAF)
Expand Down Expand Up @@ -280,19 +280,19 @@ histWSAF <- function ( obsWSAF, exclusive = TRUE,
#'
#' @examples
#' # Example 1
#' refFile = system.file("extdata", "PG0390-C.test.ref", package = "DEploid")
#' altFile = system.file("extdata", "PG0390-C.test.alt", package = "DEploid")
#' refFile = system.file("extdata", "PG0390-C.test.ref", package = "DEploid.utils")
#' altFile = system.file("extdata", "PG0390-C.test.alt", package = "DEploid.utils")
#' PG0390CoverageTxt = extractCoverageFromTxt(refFile, altFile)
#' obsWSAF = computeObsWSAF( PG0390CoverageTxt$altCount, PG0390CoverageTxt$refCount )
#' plafFile = system.file("extdata", "labStrains.test.PLAF.txt", package = "DEploid")
#' plafFile = system.file("extdata", "labStrains.test.PLAF.txt", package = "DEploid.utils")
#' plaf = extractPLAF(plafFile)
#' plotWSAFvsPLAF(plaf, obsWSAF)
#'
#' # Example 2
#' vcfFile = system.file("extdata", "PG0390-C.test.vcf.gz", package = "DEploid")
#' vcfFile = system.file("extdata", "PG0390-C.test.vcf.gz", package = "DEploid.utils")
#' PG0390CoverageVcf = extractCoverageFromVcf(vcfFile)
#' obsWSAF = computeObsWSAF( PG0390CoverageVcf$altCount, PG0390CoverageVcf$refCount )
#' plafFile = system.file("extdata", "labStrains.test.PLAF.txt", package = "DEploid")
#' plafFile = system.file("extdata", "labStrains.test.PLAF.txt", package = "DEploid.utils")
#' plaf = extractPLAF(plafFile)
#' plotWSAFvsPLAF(plaf, obsWSAF)
#'
Expand Down Expand Up @@ -331,10 +331,10 @@ plotWSAFvsPLAF <- function ( plaf, obsWSAF, expWSAF = c(), potentialOutliers = c
#' @export
#'
#' @examples
#' vcfFile = system.file("extdata", "PG0390-C.test.vcf.gz", package = "DEploid")
#' vcfFile = system.file("extdata", "PG0390-C.test.vcf.gz", package = "DEploid.utils")
#' PG0390CoverageVcf = extractCoverageFromVcf(vcfFile)
#' obsWSAF = computeObsWSAF( PG0390CoverageVcf$altCount, PG0390CoverageVcf$refCount )
#' plafFile = system.file("extdata", "labStrains.test.PLAF.txt", package = "DEploid")
#' plafFile = system.file("extdata", "labStrains.test.PLAF.txt", package = "DEploid.utils")
#' PG0390CoverageVcf.deconv = dEploid(paste("-vcf", vcfFile, "-plaf", plafFile, "-noPanel"))
#' prop = PG0390CoverageVcf.deconv$Proportions[dim(PG0390CoverageVcf.deconv$Proportions)[1],]
#' expWSAF = t(PG0390CoverageVcf.deconv$Haps) %*% prop
Expand Down Expand Up @@ -367,13 +367,13 @@ plotObsExpWSAF <- function (obsWSAF, expWSAF,
#'
#' @examples
#' # Example 1
#' refFile = system.file("extdata", "PG0390-C.test.ref", package = "DEploid")
#' altFile = system.file("extdata", "PG0390-C.test.alt", package = "DEploid")
#' refFile = system.file("extdata", "PG0390-C.test.ref", package = "DEploid.utils")
#' altFile = system.file("extdata", "PG0390-C.test.alt", package = "DEploid.utils")
#' PG0390CoverageTxt = extractCoverageFromTxt(refFile, altFile)
#' obsWSAF = computeObsWSAF( PG0390CoverageTxt$altCount, PG0390CoverageTxt$refCount )
#'
#' # Example 2
#' vcfFile = system.file("extdata", "PG0390-C.test.vcf.gz", package = "DEploid")
#' vcfFile = system.file("extdata", "PG0390-C.test.vcf.gz", package = "DEploid.utils")
#' PG0390CoverageVcf = extractCoverageFromVcf(vcfFile)
#' obsWSAF = computeObsWSAF( PG0390CoverageVcf$altCount, PG0390CoverageVcf$refCount )
#'
Expand Down
6 changes: 3 additions & 3 deletions man/computeObsWSAF.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/extractCoverageFromTxt.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/extractCoverageFromVcf.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/extractPLAF.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/histWSAF.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/plotAltVsRef.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/plotObsExpWSAF.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions man/plotProportions.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions man/plotWSAFvsPLAF.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6e5eeae

Please sign in to comment.