Skip to content

Commit

Permalink
update cran to 0.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
shajoezhu committed Jul 24, 2017
1 parent 3cae090 commit e094eae
Show file tree
Hide file tree
Showing 21 changed files with 101 additions and 23 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ Suggests:
SystemRequirements: C++11
VignetteBuilder: knitr
LinkingTo: Rcpp
RoxygenNote: 5.0.1
RoxygenNote: 6.0.1
Date: 2017-07-19
4 changes: 4 additions & 0 deletions R/DEploidR.R
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ extractPLAF <- function ( plafFileName ){
#' @export
#'
#' @examples
#' \dontrun{
#' 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")
Expand All @@ -135,6 +136,7 @@ extractPLAF <- function ( plafFileName ){
#' PG0390CoverageTxt.deconv = dEploid(paste("-ref", refFile, "-alt", altFile,
#' "-plaf", plafFile, "-noPanel"))
#' plotProportions( PG0390CoverageTxt.deconv$Proportions, "PG0390-C proportions" )
#' }
#'
plotProportions <- function (proportions, title = "Components",
cex.lab = 1, cex.main = 1, cex.axis = 1 ){
Expand Down Expand Up @@ -338,6 +340,7 @@ plotWSAFvsPLAF <- function ( plaf, obsWSAF, expWSAF = c(),
#' @export
#'
#' @examples
#' \dontrun{
#' vcfFile = system.file("extdata", "PG0390-C.test.vcf.gz", package = "DEploid")
#' PG0390CoverageVcf = extractCoverageFromVcf(vcfFile)
#' obsWSAF = computeObsWSAF( PG0390CoverageVcf$altCount, PG0390CoverageVcf$refCount )
Expand All @@ -346,6 +349,7 @@ plotWSAFvsPLAF <- function ( plaf, obsWSAF, expWSAF = c(),
#' prop = PG0390CoverageVcf.deconv$Proportions[dim(PG0390CoverageVcf.deconv$Proportions)[1],]
#' expWSAF = t(PG0390CoverageVcf.deconv$Haps) %*% prop
#' plotObsExpWSAF(obsWSAF, expWSAF)
#' }
#'
plotObsExpWSAF <- function (obsWSAF, expWSAF,
title = "WSAF(observed vs expected)",
Expand Down
10 changes: 6 additions & 4 deletions R/RcppExports.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,26 @@
#' @export
#'
#' @examples
#' \dontrun{
#' 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"))
#' }
#'
dEploid <- function(args) {
.Call('DEploid_dEploid', PACKAGE = 'DEploid', args)
.Call(`_DEploid_dEploid`, args)
}

test_RRG_sample <- function() {
.Call('DEploid_test_RRG_sample', PACKAGE = 'DEploid')
.Call(`_DEploid_test_RRG_sample`)
}

test_RRG_sampleUnitExpo <- function() {
.Call('DEploid_test_RRG_sampleUnitExpo', PACKAGE = 'DEploid')
.Call(`_DEploid_test_RRG_sampleUnitExpo`)
}

test_RRG_sampleExpoExpoLimit <- function(lambda, b, limit) {
.Call('DEploid_test_RRG_sampleExpoExpoLimit', PACKAGE = 'DEploid', lambda, b, limit)
.Call(`_DEploid_test_RRG_sampleExpoExpoLimit`, lambda, b, limit)
}

23 changes: 23 additions & 0 deletions R/dEploid.R
Original file line number Diff line number Diff line change
@@ -1 +1,24 @@
#' Deconvolute Mixed Genomes with Unknown Proportions
#'
#' 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.
#'
#' @author
#' Zhu Sha
#'
#' Maintainer: Joe Zhu \email{sha.joe.zhu@gmail.com}
#'
#' @name DEploid-package
#' @docType package
#'
#' @importFrom Rcpp evalCpp
#' @useDynLib _DEploid_dEploid
NULL
2 changes: 1 addition & 1 deletion buildLocally.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

PKG_NAME=$( cat DESCRIPTION | grep "Package:" | sed -e "s/Package: //g")
Rscript -e "roxygen2::roxygenize(\"../${PKG_NAME}\")"
Rscript -e "roxygen2::roxygenize(\"../${PKG_NAME}-r\")"

# Building package
R CMD build .
Expand Down
23 changes: 23 additions & 0 deletions man/DEploid-package.Rd

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

1 change: 0 additions & 1 deletion man/computeObsWSAF.Rd

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

4 changes: 3 additions & 1 deletion man/dEploid.Rd

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

1 change: 0 additions & 1 deletion man/extractCoverageFromTxt.Rd

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

1 change: 0 additions & 1 deletion man/extractCoverageFromVcf.Rd

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

1 change: 0 additions & 1 deletion man/extractPLAF.Rd

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

1 change: 0 additions & 1 deletion man/haplotypePainter.Rd

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

1 change: 0 additions & 1 deletion man/histWSAF.Rd

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

1 change: 0 additions & 1 deletion man/plotAltVsRef.Rd

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

3 changes: 2 additions & 1 deletion man/plotObsExpWSAF.Rd

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

3 changes: 2 additions & 1 deletion man/plotProportions.Rd

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

1 change: 0 additions & 1 deletion man/plotWSAFvsPLAF.Rd

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

4 changes: 2 additions & 2 deletions src/Makevars.win
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
OBJECTS.dEploidr = dEploidr.o test_exports.o RcppExports.o
OBJECTS.dEploidr = dEploidr.o test_exports.o RcppExports.o init.o

OBJECTS.dEploid = DEploid/panel.o \
DEploid/ibd.o \
Expand All @@ -18,5 +18,5 @@ OBJECTS.dEploid = DEploid/panel.o \

OBJECTS = $(OBJECTS.dEploidr) $(OBJECTS.dEploid)
CXX_STD = CXX11
PKG_CXXFLAGS = -IDEploid/ -IDEploid/codeCogs/ -IDEploid/random/ -IDEploid/gzstream/ -DVERSION="\"R\"" -DRBUILD
PKG_CXXFLAGS = -I/usr/share/R/include/ -IDEploid/ -IDEploid/codeCogs/ -IDEploid/random/ -IDEploid/gzstream/ -DVERSION="\"R\"" -DRBUILD
PKG_LIBS = -lz
8 changes: 4 additions & 4 deletions src/RcppExports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ using namespace Rcpp;

// dEploid
List dEploid(std::string args);
RcppExport SEXP DEploid_dEploid(SEXP argsSEXP) {
RcppExport SEXP _DEploid_dEploid(SEXP argsSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Expand All @@ -18,7 +18,7 @@ END_RCPP
}
// test_RRG_sample
double test_RRG_sample();
RcppExport SEXP DEploid_test_RRG_sample() {
RcppExport SEXP _DEploid_test_RRG_sample() {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Expand All @@ -28,7 +28,7 @@ END_RCPP
}
// test_RRG_sampleUnitExpo
double test_RRG_sampleUnitExpo();
RcppExport SEXP DEploid_test_RRG_sampleUnitExpo() {
RcppExport SEXP _DEploid_test_RRG_sampleUnitExpo() {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Expand All @@ -38,7 +38,7 @@ END_RCPP
}
// test_RRG_sampleExpoExpoLimit
double test_RRG_sampleExpoExpoLimit(double lambda, double b, double limit);
RcppExport SEXP DEploid_test_RRG_sampleExpoExpoLimit(SEXP lambdaSEXP, SEXP bSEXP, SEXP limitSEXP) {
RcppExport SEXP _DEploid_test_RRG_sampleExpoExpoLimit(SEXP lambdaSEXP, SEXP bSEXP, SEXP limitSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Expand Down
2 changes: 2 additions & 0 deletions src/dEploidr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,12 @@ class RMcmcSample {
//' @export
//'
//' @examples
//' \dontrun{
//' 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"))
//' }
//'
// [[Rcpp::export]]
List dEploid(std::string args) {
Expand Down
28 changes: 28 additions & 0 deletions src/init.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#include <R.h>
#include <Rinternals.h>
#include <stdlib.h> // for NULL
#include <R_ext/Rdynload.h>

/* FIXME:
Check these declarations against the C/Fortran source code.
*/

/* .Call calls */
extern SEXP _DEploid_dEploid(SEXP);
extern SEXP _DEploid_test_RRG_sample();
extern SEXP _DEploid_test_RRG_sampleExpoExpoLimit(SEXP, SEXP, SEXP);
extern SEXP _DEploid_test_RRG_sampleUnitExpo();

static const R_CallMethodDef CallEntries[] = {
{"_DEploid_dEploid", (DL_FUNC) &_DEploid_dEploid, 1},
{"_DEploid_test_RRG_sample", (DL_FUNC) &_DEploid_test_RRG_sample, 0},
{"_DEploid_test_RRG_sampleExpoExpoLimit", (DL_FUNC) &_DEploid_test_RRG_sampleExpoExpoLimit, 3},
{"_DEploid_test_RRG_sampleUnitExpo", (DL_FUNC) &_DEploid_test_RRG_sampleUnitExpo, 0},
{NULL, NULL, 0}
};

void R_init_DEploid(DllInfo *dll)
{
R_registerRoutines(dll, NULL, CallEntries, NULL, NULL);
R_useDynamicSymbols(dll, FALSE);
}

0 comments on commit e094eae

Please sign in to comment.