Skip to content

Commit

Permalink
Merge pull request #74 from DEploid-dev/68_new_version
Browse files Browse the repository at this point in the history
68 new version
  • Loading branch information
shajoezhu authored Oct 19, 2024
2 parents 9688e99 + d5b2425 commit e93ab4d
Show file tree
Hide file tree
Showing 19 changed files with 104 additions and 46 deletions.
2 changes: 1 addition & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
^.*\.Rproj$
^\.Rproj\.user$
^\.Rhistory$
^tmp$
^tmp.*
^NEWS\.md$

# bash scripts
Expand Down
Empty file modified .github/.gitignore
100644 → 100755
Empty file.
Empty file modified .github/workflows/R-CMD-check.yaml
100644 → 100755
Empty file.
Empty file modified .github/workflows/pr-commands.yaml
100644 → 100755
Empty file.
Empty file modified .github/workflows/test-coverage.yaml
100644 → 100755
Empty file.
12 changes: 6 additions & 6 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Package: DEploid
Type: Package
Title: Deconvolute Mixed Genomes with Unknown Proportions
Version: 0.5.3
Version: 0.5.4
Authors@R: c(
person("Joe", "Zhu", role=c("aut", "cre", "cph"), email="[email protected]"),
person('Jacob', 'Almagro-Garcia', role=c('aut', 'cph')),
person('Gil', 'McVean', role=c('aut', 'cph')),
person('Jacob', 'Almagro-Garcia', role=c('aut')),
person('Gil', 'McVean', role=c('aut')),
person('University of Oxford', '', role=c('cph')),
person('Yinghan', 'Liu', role=c('ctb')),
person('CodeCogs', 'Zyba Ltd', role=c('com', "cph")),
Expand Down Expand Up @@ -37,8 +37,8 @@ Imports:
Suggests:
knitr,
testthat (>= 0.9.0)
SystemRequirements: C++11
VignetteBuilder: knitr
LinkingTo: Rcpp
RoxygenNote: 7.1.0
Date: 2020-04-21
RoxygenNote: 7.3.2
Encoding: UTF-8
Date: 2024-10-8
49 changes: 30 additions & 19 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,26 +1,37 @@
importFrom("scales", "alpha")
importFrom("grDevices", "rainbow", "colorRampPalette")
importFrom("graphics", "abline", "barplot", "hist", "plot", "points", "axis", "legend")
importFrom("utils", "read.table")
importFrom(Rcpp,evalCpp)
importFrom("magrittr", "%>%")
importFrom("plotly", "plot_ly", "layout", "add_trace")
importFrom("rmarkdown", "pandoc_available")
importFrom("htmlwidgets", "saveWidget")
useDynLib(DEploid, .registration = TRUE)
# Generated by roxygen2: do not edit by hand

export(computeObsWSAF)
export(dEploid)
export(extractVcf)
export(plotProportions)
export(extractCoverageFromVcf)
export(extractCoverageFromTxt)
export(extractCoverageFromVcf)
export(extractPLAF)
export(extractVcf)
export(haplotypePainter)
export(plotAltVsRef)
export(computeObsWSAF)
export(histWSAF)
export(extractPLAF)
export(plotWSAFvsPLAF)
export(plotObsExpWSAF)
export(plotAltVsRef)
export(plotAltVsRefPlotly)
export(plotHistWSAFPlotly)
export(plotWSAFVsPLAFPlotly)
export(plotObsExpWSAF)
export(plotObsExpWSAFPlotly)
export(plotProportions)
export(plotWSAFVsPLAFPlotly)
export(plotWSAFvsPLAF)
importFrom(Rcpp,evalCpp)
importFrom(grDevices,colorRampPalette)
importFrom(grDevices,rainbow)
importFrom(graphics,abline)
importFrom(graphics,axis)
importFrom(graphics,barplot)
importFrom(graphics,hist)
importFrom(graphics,legend)
importFrom(graphics,plot)
importFrom(graphics,points)
importFrom(htmlwidgets,saveWidget)
importFrom(magrittr,"%>%")
importFrom(plotly,add_trace)
importFrom(plotly,layout)
importFrom(plotly,plot_ly)
importFrom(rmarkdown,pandoc_available)
importFrom(scales,alpha)
importFrom(utils,read.table)
useDynLib(DEploid, .registration = TRUE)
16 changes: 13 additions & 3 deletions R/dEploid.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#' @keywords internal
"_PACKAGE"

#' Deconvolute Mixed Genomes with Unknown Proportions
#'
#' Traditional phasing programs are limited to diploid organisms.
Expand All @@ -18,9 +21,16 @@
#' Maintainer: Joe Zhu \email{[email protected]}
#'
#' @name DEploid-package
#' @docType package
#'
#' @importFrom Rcpp evalCpp
#' @useDynLib _DEploid_dEploid
#' @useDynLib _DEploid_extractVcf
#' @importFrom scales alpha
#' @importFrom grDevices rainbow colorRampPalette
#' @importFrom graphics abline barplot hist plot points axis legend
#' @importFrom utils read.table
#' @importFrom magrittr %>%
#' @importFrom plotly plot_ly layout add_trace
#' @importFrom rmarkdown pandoc_available
#' @importFrom htmlwidgets saveWidget
#' @useDynLib DEploid, .registration = TRUE
NULL

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<img src="inst/extdata/deploid.png" width="180">

[![License (GPL version 3)](https://img.shields.io/badge/license-GPL%20version%203-brightgreen.svg)](http://opensource.org/licenses/GPL-3.0)
[![Build Status](https://travis-ci.org/DEploid-dev/DEploid-r.svg?branch=master)](https://travis-ci.org/DEploid-dev/DEploid-r)
[![Build Status](https://travis-ci.org/DEploid-dev/DEploid-r.svg?branch=master)](https://app.travis-ci.com/DEploid-dev/DEploid-r)
[![Build Status](https://ci.appveyor.com/api/projects/status/hi1nq97d5l68qs4r?svg=true)](https://ci.appveyor.com/project/shajoezhu/deploid-r)
[![Coverage Status](https://coveralls.io/repos/github/DEploid-dev/DEploid-r/badge.svg?branch=master)](https://coveralls.io/github/DEploid-dev/DEploid-r?branch=master)
[![codecov](https://codecov.io/gh/DEploid-dev/DEploid-r/branch/master/graph/badge.svg)](https://codecov.io/gh/DEploid-dev/DEploid-r)
[![codecov](https://codecov.io/gh/DEploid-dev/DEploid-r/branch/master/graph/badge.svg)](https://app.codecov.io/gh/DEploid-dev/DEploid-r)
[![CRAN RStudio Mirror Downloads](http://cranlogs.r-pkg.org/badges/DEploid)](https://cran.r-project.org/package=DEploid)

DEploid R package -- Deconvolute Mixed Genomes with Unknown Proportions
Expand Down
2 changes: 1 addition & 1 deletion inst/CITATION
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ bibentry(
journal = 'bioRxiv',
doi = '10.1101/099499',
publisher = 'Cold Spring Harbor Labs Journals',
url = 'http://www.biorxiv.org/content/early/2017/01/10/099499'
url = 'https://www.biorxiv.org/content/10.1101/099499v1'
)
32 changes: 31 additions & 1 deletion man/DEploid-package.Rd

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

6 changes: 3 additions & 3 deletions src/DEploid/dEploidIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ void DEploidIO::reInit() {


void DEploidIO::finalize() {
if ( this->doIbdPainting() | this->doComputeLLK() | this->doIbdViterbiPainting() ) {
if ( this->doIbdPainting() || this->doComputeLLK() || this->doIbdViterbiPainting() ) {
if (!initialPropWasGiven()) {
throw InitialPropUngiven("");
}
Expand Down Expand Up @@ -541,7 +541,7 @@ void DEploidIO::checkInput() {
// set k strain by proportion length
}
}
if (this->useBestPractice() & (!this->usePanel())){
if (this->useBestPractice() && (!this->usePanel())){
throw FlagsConflict("-best" , string("-noPanel. Reference panel is") +
string("required for using best-practices."));
}
Expand Down Expand Up @@ -764,7 +764,7 @@ void DEploidIO::readPanel() {
if ( this->usePanel() == false ) {
return;
}
if ( this->doIbdPainting() | this->doComputeLLK() ) {
if ( this->doIbdPainting() || this->doComputeLLK() ) {
return;
}

Expand Down
6 changes: 4 additions & 2 deletions src/DEploid/exceptions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ struct ShouldNotBeCalled : std::exception{
ShouldNotBeCalled() { }
virtual ~ShouldNotBeCalled() throw() {}
virtual const char* what() const noexcept {
return string("Should not reach here").c_str();
static const std::string msg = "Should not reach here";
return msg.c_str();
}
};

Expand Down Expand Up @@ -75,7 +76,8 @@ struct OutOfVectorSize : std::exception{
OutOfVectorSize() { }
virtual ~OutOfVectorSize() throw() {}
virtual const char* what() const noexcept {
return string("Out of vector size!").c_str();
static const std::string msg = "Out of vector size!";
return msg.c_str();
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/DEploid/mcmc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ void McmcMachinery::runMcmcChain( bool showProgress, bool useIBD, bool notInR )
this->mcmcSample_->siteOfOneMissCopyOne[atSiteI] /= (double)this->maxIteration_;
}

if ( notInR & ((jobbrief == "lassoK") | (jobbrief == "ibd") | (jobbrief == "classic")) ) { // notInPython
if ( notInR & ((jobbrief == "lassoK") || (jobbrief == "ibd") || (jobbrief == "classic")) ) { // notInPython
this->dEploidIO_->writeMcmcRelated(this->mcmcSample_, jobbrief, useIBD);
}

Expand Down
5 changes: 3 additions & 2 deletions src/DEploid/random/fastfunc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <iostream>
#include <cmath>
#include <vector>
#include <cstdint>


// Number of interpolation points. If this is changed, several constants in fastlog must also be changed.
Expand Down Expand Up @@ -85,8 +86,8 @@ inline double FastFunc::fastexp_lo(double y) {

inline double FastFunc::fastlog(double x) {
const float offset = 2047; // as int64_t: 0x409ffc00000....
double y = x;
int64_t* yint = (int64_t*)(&y);
//double y = x; int64_t* yint = reinterpret_cast<int64_t*>(&y);
int64_t* yint = reinterpret_cast<int64_t*>(&x);
int expon = ((*yint) >> 52) - 1023; // base-2 exponent of float
int index = ((*yint) >> (52-10)) & 1023; // upper 10 bits of mantissa
*yint |= 0x7ffffc0000000000; // convert float into remainder of mantissa; and
Expand Down
1 change: 0 additions & 1 deletion src/Makevars.win
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,5 @@ OBJECTS.dEploid = DEploid/dEploidIO.o \


OBJECTS = $(OBJECTS.dEploidr) $(OBJECTS.dEploid)
CXX_STD = CXX11
PKG_CXXFLAGS = -I/usr/share/R/include/ -IDEploid/ -IDEploid/codeCogs/ -IDEploid/random/ -IDEploid/gzstream/ -IDEploid/lasso/ -DVERSION="\"R\"" -DRBUILD -DSTRICT_R_HEADERS
PKG_LIBS = -lz
5 changes: 5 additions & 0 deletions src/RcppExports.cpp
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@

using namespace Rcpp;

#ifdef RCPP_USE_GLOBAL_ROSTREAM
Rcpp::Rostream<true>& Rcpp::Rcout = Rcpp::Rcpp_cout_get();
Rcpp::Rostream<false>& Rcpp::Rcerr = Rcpp::Rcpp_cerr_get();
#endif

// dEploid
List dEploid(std::string args);
RcppExport SEXP _DEploid_dEploid(SEXP argsSEXP) {
Expand Down
4 changes: 2 additions & 2 deletions src/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
/* .Call calls */
extern SEXP _DEploid_dEploid(SEXP);
extern SEXP _DEploid_extractVcf(SEXP);
extern SEXP _DEploid_test_RRG_sample();
extern SEXP _DEploid_test_RRG_sample(void);
extern SEXP _DEploid_test_RRG_sampleExpoExpoLimit(SEXP, SEXP, SEXP);
extern SEXP _DEploid_test_RRG_sampleUnitExpo();
extern SEXP _DEploid_test_RRG_sampleUnitExpo(void);

static const R_CallMethodDef CallEntries[] = {
{"_DEploid_dEploid", (DL_FUNC) &_DEploid_dEploid, 1},
Expand Down
4 changes: 2 additions & 2 deletions vignettes/dEploid-Arguments.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ Bibtex record::
year = {2018},
doi = {10.1101/387266},
publisher = {Cold Spring Harbor Laboratory},
URL = {https://www.biorxiv.org/content/early/2018/08/09/387266},
eprint = {https://www.biorxiv.org/content/early/2018/08/09/387266.full.pdf},
URL = {https://www.biorxiv.org/content/10.1101/387266v1},
eprint = {https://www.biorxiv.org/content/biorxiv/early/2018/08/09/387266.full.pdf},
journal = {bioRxiv}
}

Expand Down

0 comments on commit e93ab4d

Please sign in to comment.