Skip to content

Commit 6840971

Browse files
committed
export Unified_getOneMarker
1 parent 0c9aa2c commit 6840971

File tree

4 files changed

+37
-6
lines changed

4 files changed

+37
-6
lines changed

NAMESPACE

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ importFrom(RcppParallel, RcppParallelLibs)
44
import(Matrix)
55
exportPattern("^[[:alpha:]]+")
66
import(data.table)
7+
export(Unified_getOneMarker)

R/RcppExports.R

+4
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ mainMarkerInCPP <- function(t_genoType, t_traitType, t_genoIndex_prev, t_genoInd
5353
invisible(.Call('_SAIGE_mainMarkerInCPP', PACKAGE = 'SAIGE', t_genoType, t_traitType, t_genoIndex_prev, t_genoIndex, t_isMoreOutput, t_isImputation, t_isFirth))
5454
}
5555

56+
Unified_getOneMarker <- function(t_genoType, t_gIndex_prev, t_gIndex, t_ref, t_alt, t_marker, t_pd, t_chr, t_altFreq, t_altCounts, t_missingRate, t_imputeInfo, t_isOutputIndexForMissing, t_indexForMissing, t_isOnlyOutputNonZero, t_indexForNonZero, t_GVec, t_isImputation) {
57+
.Call('_SAIGE_Unified_getOneMarker', PACKAGE = 'SAIGE', t_genoType, t_gIndex_prev, t_gIndex, t_ref, t_alt, t_marker, t_pd, t_chr, t_altFreq, t_altCounts, t_missingRate, t_imputeInfo, t_isOutputIndexForMissing, t_indexForMissing, t_isOnlyOutputNonZero, t_indexForNonZero, t_GVec, t_isImputation)
58+
}
59+
5660
processMale_XnonPAR <- function(t_GVec, t_pd, t_XPARregion) {
5761
invisible(.Call('_SAIGE_processMale_XnonPAR', PACKAGE = 'SAIGE', t_GVec, t_pd, t_XPARregion))
5862
}

src/Main.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -607,8 +607,10 @@ void mainMarkerInCPP(
607607

608608

609609

610-
611610
// a unified function to get single marker from genotype file
611+
612+
613+
// [[Rcpp::export]]
612614
bool Unified_getOneMarker(std::string & t_genoType, // "PLINK", "BGEN", "Vcf"
613615
uint64_t & t_gIndex_prev, // different meanings for different genoType
614616
uint64_t & t_gIndex, // different meanings for different genoType

src/RcppExports.cpp

+29-5
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@
77

88
using namespace Rcpp;
99

10-
#ifdef RCPP_USE_GLOBAL_ROSTREAM
11-
Rcpp::Rostream<true>& Rcpp::Rcout = Rcpp::Rcpp_cout_get();
12-
Rcpp::Rostream<false>& Rcpp::Rcerr = Rcpp::Rcpp_cerr_get();
13-
#endif
14-
1510
// CCT_cpp
1611
double CCT_cpp(arma::vec& pval);
1712
RcppExport SEXP _SAIGE_CCT_cpp(SEXP pvalSEXP) {
@@ -181,6 +176,34 @@ BEGIN_RCPP
181176
return R_NilValue;
182177
END_RCPP
183178
}
179+
// Unified_getOneMarker
180+
bool Unified_getOneMarker(std::string& t_genoType, uint64_t& t_gIndex_prev, uint64_t& t_gIndex, std::string& t_ref, std::string& t_alt, std::string& t_marker, uint32_t& t_pd, std::string& t_chr, double& t_altFreq, double& t_altCounts, double& t_missingRate, double& t_imputeInfo, bool& t_isOutputIndexForMissing, std::vector<uint>& t_indexForMissing, bool& t_isOnlyOutputNonZero, std::vector<uint>& t_indexForNonZero, arma::vec& t_GVec, bool t_isImputation);
181+
RcppExport SEXP _SAIGE_Unified_getOneMarker(SEXP t_genoTypeSEXP, SEXP t_gIndex_prevSEXP, SEXP t_gIndexSEXP, SEXP t_refSEXP, SEXP t_altSEXP, SEXP t_markerSEXP, SEXP t_pdSEXP, SEXP t_chrSEXP, SEXP t_altFreqSEXP, SEXP t_altCountsSEXP, SEXP t_missingRateSEXP, SEXP t_imputeInfoSEXP, SEXP t_isOutputIndexForMissingSEXP, SEXP t_indexForMissingSEXP, SEXP t_isOnlyOutputNonZeroSEXP, SEXP t_indexForNonZeroSEXP, SEXP t_GVecSEXP, SEXP t_isImputationSEXP) {
182+
BEGIN_RCPP
183+
Rcpp::RObject rcpp_result_gen;
184+
Rcpp::RNGScope rcpp_rngScope_gen;
185+
Rcpp::traits::input_parameter< std::string& >::type t_genoType(t_genoTypeSEXP);
186+
Rcpp::traits::input_parameter< uint64_t& >::type t_gIndex_prev(t_gIndex_prevSEXP);
187+
Rcpp::traits::input_parameter< uint64_t& >::type t_gIndex(t_gIndexSEXP);
188+
Rcpp::traits::input_parameter< std::string& >::type t_ref(t_refSEXP);
189+
Rcpp::traits::input_parameter< std::string& >::type t_alt(t_altSEXP);
190+
Rcpp::traits::input_parameter< std::string& >::type t_marker(t_markerSEXP);
191+
Rcpp::traits::input_parameter< uint32_t& >::type t_pd(t_pdSEXP);
192+
Rcpp::traits::input_parameter< std::string& >::type t_chr(t_chrSEXP);
193+
Rcpp::traits::input_parameter< double& >::type t_altFreq(t_altFreqSEXP);
194+
Rcpp::traits::input_parameter< double& >::type t_altCounts(t_altCountsSEXP);
195+
Rcpp::traits::input_parameter< double& >::type t_missingRate(t_missingRateSEXP);
196+
Rcpp::traits::input_parameter< double& >::type t_imputeInfo(t_imputeInfoSEXP);
197+
Rcpp::traits::input_parameter< bool& >::type t_isOutputIndexForMissing(t_isOutputIndexForMissingSEXP);
198+
Rcpp::traits::input_parameter< std::vector<uint>& >::type t_indexForMissing(t_indexForMissingSEXP);
199+
Rcpp::traits::input_parameter< bool& >::type t_isOnlyOutputNonZero(t_isOnlyOutputNonZeroSEXP);
200+
Rcpp::traits::input_parameter< std::vector<uint>& >::type t_indexForNonZero(t_indexForNonZeroSEXP);
201+
Rcpp::traits::input_parameter< arma::vec& >::type t_GVec(t_GVecSEXP);
202+
Rcpp::traits::input_parameter< bool >::type t_isImputation(t_isImputationSEXP);
203+
rcpp_result_gen = Rcpp::wrap(Unified_getOneMarker(t_genoType, t_gIndex_prev, t_gIndex, t_ref, t_alt, t_marker, t_pd, t_chr, t_altFreq, t_altCounts, t_missingRate, t_imputeInfo, t_isOutputIndexForMissing, t_indexForMissing, t_isOnlyOutputNonZero, t_indexForNonZero, t_GVec, t_isImputation));
204+
return rcpp_result_gen;
205+
END_RCPP
206+
}
184207
// processMale_XnonPAR
185208
void processMale_XnonPAR(arma::vec& t_GVec, uint32_t& t_pd, arma::umat& t_XPARregion);
186209
RcppExport SEXP _SAIGE_processMale_XnonPAR(SEXP t_GVecSEXP, SEXP t_pdSEXP, SEXP t_XPARregionSEXP) {
@@ -2242,6 +2265,7 @@ static const R_CallMethodDef CallEntries[] = {
22422265
{"_SAIGE_setMarker_GlobalVarsInCPP", (DL_FUNC) &_SAIGE_setMarker_GlobalVarsInCPP, 2},
22432266
{"_SAIGE_setRegion_GlobalVarsInCPP", (DL_FUNC) &_SAIGE_setRegion_GlobalVarsInCPP, 4},
22442267
{"_SAIGE_mainMarkerInCPP", (DL_FUNC) &_SAIGE_mainMarkerInCPP, 7},
2268+
{"_SAIGE_Unified_getOneMarker", (DL_FUNC) &_SAIGE_Unified_getOneMarker, 18},
22452269
{"_SAIGE_processMale_XnonPAR", (DL_FUNC) &_SAIGE_processMale_XnonPAR, 3},
22462270
{"_SAIGE_Unified_getSampleSizeinGeno", (DL_FUNC) &_SAIGE_Unified_getSampleSizeinGeno, 1},
22472271
{"_SAIGE_Unified_getSampleSizeinAnalysis", (DL_FUNC) &_SAIGE_Unified_getSampleSizeinAnalysis, 1},

0 commit comments

Comments
 (0)