forked from dosorio/Peptides
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
205 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
.travis.yml | ||
^.*\.Rproj$ | ||
^\.Rproj\.user$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.Rproj.user | ||
.Rhistory | ||
.RData | ||
.Ruserdata | ||
src/*.o | ||
src/*.so | ||
src/*.dll |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
Version: 1.0 | ||
|
||
RestoreWorkspace: Default | ||
SaveWorkspace: Default | ||
AlwaysSaveHistory: Default | ||
|
||
EnableCodeIndexing: Yes | ||
UseSpacesForTab: Yes | ||
NumSpacesForTab: 2 | ||
Encoding: UTF-8 | ||
|
||
RnwWeave: Sweave | ||
LaTeX: pdfLaTeX | ||
|
||
BuildType: Package | ||
PackageUseDevtools: Yes | ||
PackageInstallArgs: --no-multiarch --with-keep.source | ||
PackageCheckArgs: --as-cran |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#' @useDynLib Peptides | ||
#' @useDynLib Peptides, .registration = TRUE | ||
#' @importFrom Rcpp sourceCpp | ||
NULL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Generated by using Rcpp::compileAttributes() -> do not edit by hand | ||
// Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 | ||
|
||
#ifndef RCPP_Peptides_H_GEN_ | ||
#define RCPP_Peptides_H_GEN_ | ||
|
||
#include "Peptides_RcppExports.h" | ||
|
||
#endif // RCPP_Peptides_H_GEN_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
// Generated by using Rcpp::compileAttributes() -> do not edit by hand | ||
// Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 | ||
|
||
#ifndef RCPP_Peptides_RCPPEXPORTS_H_GEN_ | ||
#define RCPP_Peptides_RCPPEXPORTS_H_GEN_ | ||
|
||
#include <Rcpp.h> | ||
|
||
namespace Peptides { | ||
|
||
using namespace Rcpp; | ||
|
||
namespace { | ||
void validateSignature(const char* sig) { | ||
Rcpp::Function require = Rcpp::Environment::base_env()["require"]; | ||
require("Peptides", Rcpp::Named("quietly") = true); | ||
typedef int(*Ptr_validate)(const char*); | ||
static Ptr_validate p_validate = (Ptr_validate) | ||
R_GetCCallable("Peptides", "Peptides_RcppExport_validate"); | ||
if (!p_validate(sig)) { | ||
throw Rcpp::function_not_exported( | ||
"C++ function with signature '" + std::string(sig) + "' not found in Peptides"); | ||
} | ||
} | ||
} | ||
|
||
inline Rcpp::List chargeList(std::vector< std::string > seq, NumericVector pH, std::string pKscale = "Lehninger") { | ||
typedef SEXP(*Ptr_chargeList)(SEXP,SEXP,SEXP); | ||
static Ptr_chargeList p_chargeList = NULL; | ||
if (p_chargeList == NULL) { | ||
validateSignature("Rcpp::List(*chargeList)(std::vector< std::string >,NumericVector,std::string)"); | ||
p_chargeList = (Ptr_chargeList)R_GetCCallable("Peptides", "Peptides_chargeList"); | ||
} | ||
RObject rcpp_result_gen; | ||
{ | ||
RNGScope RCPP_rngScope_gen; | ||
rcpp_result_gen = p_chargeList(Rcpp::wrap(seq), Rcpp::wrap(pH), Rcpp::wrap(pKscale)); | ||
} | ||
if (rcpp_result_gen.inherits("interrupted-error")) | ||
throw Rcpp::internal::InterruptedException(); | ||
if (rcpp_result_gen.inherits("try-error")) | ||
throw Rcpp::exception(as<std::string>(rcpp_result_gen).c_str()); | ||
return Rcpp::as<Rcpp::List >(rcpp_result_gen); | ||
} | ||
|
||
inline double absoluteCharge(std::string seq, double pH = 7, std::string pKscale = "Lehninger") { | ||
typedef SEXP(*Ptr_absoluteCharge)(SEXP,SEXP,SEXP); | ||
static Ptr_absoluteCharge p_absoluteCharge = NULL; | ||
if (p_absoluteCharge == NULL) { | ||
validateSignature("double(*absoluteCharge)(std::string,double,std::string)"); | ||
p_absoluteCharge = (Ptr_absoluteCharge)R_GetCCallable("Peptides", "Peptides_absoluteCharge"); | ||
} | ||
RObject rcpp_result_gen; | ||
{ | ||
RNGScope RCPP_rngScope_gen; | ||
rcpp_result_gen = p_absoluteCharge(Rcpp::wrap(seq), Rcpp::wrap(pH), Rcpp::wrap(pKscale)); | ||
} | ||
if (rcpp_result_gen.inherits("interrupted-error")) | ||
throw Rcpp::internal::InterruptedException(); | ||
if (rcpp_result_gen.inherits("try-error")) | ||
throw Rcpp::exception(as<std::string>(rcpp_result_gen).c_str()); | ||
return Rcpp::as<double >(rcpp_result_gen); | ||
} | ||
|
||
} | ||
|
||
#endif // RCPP_Peptides_RCPPEXPORTS_H_GEN_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
*.o | ||
*.so | ||
*.dll |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,92 @@ | ||
// Generated by using Rcpp::compileAttributes() -> do not edit by hand | ||
// Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 | ||
|
||
#include "../inst/include/Peptides.h" | ||
#include <Rcpp.h> | ||
#include <string> | ||
#include <set> | ||
|
||
using namespace Rcpp; | ||
|
||
// chargeList | ||
Rcpp::List chargeList(std::vector< std::string > seq, NumericVector pH, std::string pKscale); | ||
RcppExport SEXP Peptides_chargeList(SEXP seqSEXP, SEXP pHSEXP, SEXP pKscaleSEXP) { | ||
static SEXP Peptides_chargeList_try(SEXP seqSEXP, SEXP pHSEXP, SEXP pKscaleSEXP) { | ||
BEGIN_RCPP | ||
Rcpp::RObject rcpp_result_gen; | ||
Rcpp::RNGScope rcpp_rngScope_gen; | ||
Rcpp::traits::input_parameter< std::vector< std::string > >::type seq(seqSEXP); | ||
Rcpp::traits::input_parameter< NumericVector >::type pH(pHSEXP); | ||
Rcpp::traits::input_parameter< std::string >::type pKscale(pKscaleSEXP); | ||
rcpp_result_gen = Rcpp::wrap(chargeList(seq, pH, pKscale)); | ||
return rcpp_result_gen; | ||
END_RCPP | ||
END_RCPP_RETURN_ERROR | ||
} | ||
RcppExport SEXP Peptides_chargeList(SEXP seqSEXP, SEXP pHSEXP, SEXP pKscaleSEXP) { | ||
SEXP rcpp_result_gen; | ||
{ | ||
Rcpp::RNGScope rcpp_rngScope_gen; | ||
rcpp_result_gen = PROTECT(Peptides_chargeList_try(seqSEXP, pHSEXP, pKscaleSEXP)); | ||
} | ||
Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error"); | ||
if (rcpp_isInterrupt_gen) { | ||
UNPROTECT(1); | ||
Rf_onintr(); | ||
} | ||
Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error"); | ||
if (rcpp_isError_gen) { | ||
SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen); | ||
UNPROTECT(1); | ||
Rf_error(CHAR(rcpp_msgSEXP_gen)); | ||
} | ||
UNPROTECT(1); | ||
return rcpp_result_gen; | ||
} | ||
// absoluteCharge | ||
double absoluteCharge(std::string seq, double pH, std::string pKscale); | ||
RcppExport SEXP Peptides_absoluteCharge(SEXP seqSEXP, SEXP pHSEXP, SEXP pKscaleSEXP) { | ||
static SEXP Peptides_absoluteCharge_try(SEXP seqSEXP, SEXP pHSEXP, SEXP pKscaleSEXP) { | ||
BEGIN_RCPP | ||
Rcpp::RObject rcpp_result_gen; | ||
Rcpp::RNGScope rcpp_rngScope_gen; | ||
Rcpp::traits::input_parameter< std::string >::type seq(seqSEXP); | ||
Rcpp::traits::input_parameter< double >::type pH(pHSEXP); | ||
Rcpp::traits::input_parameter< std::string >::type pKscale(pKscaleSEXP); | ||
rcpp_result_gen = Rcpp::wrap(absoluteCharge(seq, pH, pKscale)); | ||
return rcpp_result_gen; | ||
END_RCPP | ||
END_RCPP_RETURN_ERROR | ||
} | ||
RcppExport SEXP Peptides_absoluteCharge(SEXP seqSEXP, SEXP pHSEXP, SEXP pKscaleSEXP) { | ||
SEXP rcpp_result_gen; | ||
{ | ||
Rcpp::RNGScope rcpp_rngScope_gen; | ||
rcpp_result_gen = PROTECT(Peptides_absoluteCharge_try(seqSEXP, pHSEXP, pKscaleSEXP)); | ||
} | ||
Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error"); | ||
if (rcpp_isInterrupt_gen) { | ||
UNPROTECT(1); | ||
Rf_onintr(); | ||
} | ||
Rboolean rcpp_isError_gen = Rf_inherits(rcpp_result_gen, "try-error"); | ||
if (rcpp_isError_gen) { | ||
SEXP rcpp_msgSEXP_gen = Rf_asChar(rcpp_result_gen); | ||
UNPROTECT(1); | ||
Rf_error(CHAR(rcpp_msgSEXP_gen)); | ||
} | ||
UNPROTECT(1); | ||
return rcpp_result_gen; | ||
} | ||
|
||
// validate (ensure exported C++ functions exist before calling them) | ||
static int Peptides_RcppExport_validate(const char* sig) { | ||
static std::set<std::string> signatures; | ||
if (signatures.empty()) { | ||
signatures.insert("Rcpp::List(*chargeList)(std::vector< std::string >,NumericVector,std::string)"); | ||
signatures.insert("double(*absoluteCharge)(std::string,double,std::string)"); | ||
} | ||
return signatures.find(sig) != signatures.end(); | ||
} | ||
|
||
// registerCCallable (register entry points for exported C++ functions) | ||
RcppExport SEXP Peptides_RcppExport_registerCCallable() { | ||
R_RegisterCCallable("Peptides", "Peptides_chargeList", (DL_FUNC)Peptides_chargeList_try); | ||
R_RegisterCCallable("Peptides", "Peptides_absoluteCharge", (DL_FUNC)Peptides_absoluteCharge_try); | ||
R_RegisterCCallable("Peptides", "Peptides_RcppExport_validate", (DL_FUNC)Peptides_RcppExport_validate); | ||
return R_NilValue; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#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 Peptides_absoluteCharge(SEXP, SEXP, SEXP); | ||
extern SEXP Peptides_chargeList(SEXP, SEXP, SEXP); | ||
extern SEXP Peptides_RcppExport_registerCCallable(); | ||
|
||
static const R_CallMethodDef CallEntries[] = { | ||
{"Peptides_absoluteCharge", (DL_FUNC) &Peptides_absoluteCharge, 3}, | ||
{"Peptides_chargeList", (DL_FUNC) &Peptides_chargeList, 3}, | ||
{"Peptides_RcppExport_registerCCallable", (DL_FUNC) &Peptides_RcppExport_registerCCallable, 0}, | ||
{NULL, NULL, 0} | ||
}; | ||
|
||
void R_init_Peptides(DllInfo *dll) | ||
{ | ||
R_registerRoutines(dll, NULL, CallEntries, NULL, NULL); | ||
R_useDynamicSymbols(dll, FALSE); | ||
} |