Skip to content

Commit

Permalink
simple utility functions
Browse files Browse the repository at this point in the history
  • Loading branch information
dcgerard committed Dec 7, 2017
1 parent 4f30cb6 commit eb750ff
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 1 deletion.
11 changes: 11 additions & 0 deletions R/RcppExports.R
@@ -0,0 +1,11 @@
# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#' Adjusts allele dosage \code{p} by the sequencing error rate \code{eps}.
#'
#' @param p The allele dosage.
#' @param eps The sequencing error rate.
eta_fun <- function(p, eps) {
.Call('_mupdog_eta_fun', PACKAGE = 'mupdog', p, eps)
}

2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -3,7 +3,7 @@
mupdog
======

[![Travis-CI Build Status](https://travis-ci.org/dcgerard/mupdog.svg?branch=master)](https://travis-ci.org/dcgerard/mupdog)
[![Travis-CI Build Status](https://travis-ci.org/dcgerard/mupdog.svg?branch=master)](https://travis-ci.org/dcgerard/mupdog) [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/dcgerard/mupdog?branch=master&svg=true)](https://ci.appveyor.com/project/dcgerard/mupdog) [![Coverage Status](https://img.shields.io/codecov/c/github/dcgerard/mupdog/master.svg)](https://codecov.io/github/dcgerard/mupdog?branch=master)

Mupdog is a multivariate extension of updog.

Expand Down
16 changes: 16 additions & 0 deletions man/eta_fun.Rd

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

29 changes: 29 additions & 0 deletions src/RcppExports.cpp
@@ -0,0 +1,29 @@
// Generated by using Rcpp::compileAttributes() -> do not edit by hand
// Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#include <Rcpp.h>

using namespace Rcpp;

// eta_fun
NumericVector eta_fun(double p, double eps);
RcppExport SEXP _mupdog_eta_fun(SEXP pSEXP, SEXP epsSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< double >::type p(pSEXP);
Rcpp::traits::input_parameter< double >::type eps(epsSEXP);
rcpp_result_gen = Rcpp::wrap(eta_fun(p, eps));
return rcpp_result_gen;
END_RCPP
}

static const R_CallMethodDef CallEntries[] = {
{"_mupdog_eta_fun", (DL_FUNC) &_mupdog_eta_fun, 2},
{NULL, NULL, 0}
};

RcppExport void R_init_mupdog(DllInfo *dll) {
R_registerRoutines(dll, NULL, CallEntries, NULL, NULL);
R_useDynamicSymbols(dll, FALSE);
}
11 changes: 11 additions & 0 deletions src/util_funs.cpp
@@ -0,0 +1,11 @@
#include <Rcpp.h>
using namespace Rcpp;

//' Adjusts allele dosage \code{p} by the sequencing error rate \code{eps}.
//'
//' @param p The allele dosage.
//' @param eps The sequencing error rate.
// [[Rcpp::export]]
NumericVector eta_fun(double p, double eps) {
return p * (1 - eps) + (1 - p) * eps;
}

0 comments on commit eb750ff

Please sign in to comment.