Skip to content

Commit

Permalink
STAAR v0.9.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
xihaoli committed Jan 25, 2022
2 parents 5179faf + df263f8 commit 623ee2a
Show file tree
Hide file tree
Showing 7 changed files with 78 additions and 8 deletions.
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: STAAR
Type: Package
Title: STAAR Procedure for Dynamic Incorporation of Multiple Functional Annotations in Whole-Genome Sequencing Studies
Version: 0.9.6
Date: 2021-08-16
Version: 0.9.6.1
Date: 2022-01-24
Author: Xihao Li [aut, cre], Zilin Li [aut, cre], Han Chen [aut]
Maintainer: Xihao Li <xihaoli@g.harvard.edu>, Zilin Li <li@hsph.harvard.edu>
Description: An R package for performing STAAR procedure in whole-genome sequencing studies.
Expand All @@ -13,6 +13,6 @@ Encoding: UTF-8
LazyData: true
Depends: R (>= 3.2.0)
LinkingTo: Rcpp, RcppArmadillo
RoxygenNote: 7.1.1
RoxygenNote: 7.1.2
Suggests: knitr, rmarkdown
VignetteBuilder: knitr
4 changes: 4 additions & 0 deletions R/RcppExports.R
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ matrix_flip <- function(G) {
.Call(`_STAAR_matrix_flip`, G)
}

matrix_impute <- function(G) {
.Call(`_STAAR_matrix_impute`, G)
}

# Register entry points for exported C++ functions
methods::setLoadAction(function(ns) {
.Call('_STAAR_RcppExport_registerCCallable', PACKAGE = 'STAAR')
Expand Down
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,23 @@ STAAR links to R packages <a href="https://cran.r-project.org/web/packages/Rcpp/
library(devtools)
devtools::install_github("xihaoli/STAAR")
```
## Docker Image
A [docker image for STAAR](https://hub.docker.com/repository/docker/zilinli/staarpipeline), including R (version 3.6.1) built with Intel MKL and all STAAR-related packages (STAAR, STAARpipeline, STAARpipelineSummary) pre-installed, is located in the Docker Hub. The docker image can be pulled using
```
docker pull zilinli/staarpipeline
```
## Usage
Please see the <a href="docs/STAAR_manual.pdf">**STAAR** user manual</a> for detailed usage of STAAR package. Please see the <a href="https://htmlpreview.github.io/?https://github.com/xihaoli/STAAR/blob/master/docs/STAAR_vignette.html">**STAAR** tutorial</a> for an example of analyzing sequencing data using STAAR procedure.
Please see the <a href="docs/STAAR_manual.pdf">**STAAR** user manual</a> for detailed usage of STAAR package. Please see the <a href="https://htmlpreview.github.io/?https://github.com/xihaoli/STAAR/blob/master/docs/STAAR_vignette.html">**STAAR** tutorial</a> for an example of analyzing sequencing data using STAAR procedure. Please see the <a href="https://github.com/xihaoli/STAARpipeline-Tutorial">**STAARpipeline** tutorial</a> for a detailed example of analyzing sequencing data using STAAR and STAARpipeline.
## Data Availability
The whole-genome individual functional annotation data assembled from a variety of sources and the computed annotation principal components are available at the [Functional Annotation of Variant - Online Resource (FAVOR)](http://favor.genohub.org) site.
## Version
The current version is 0.9.6 (August 16, 2021).
The current version is 0.9.6.1 (January 24, 2022).
## Citation
If you use **STAAR** for your work, please cite:

Xihao Li*, Zilin Li*, Hufeng Zhou, Sheila M. Gaynor, Yaowu Liu, Han Chen, Ryan Sun, Rounak Dey, Donna K. Arnett, Stella Aslibekyan, Christie M. Ballantyne, Lawrence F. Bielak, John Blangero, Eric Boerwinkle, Donald W. Bowden, Jai G. Broome, Matthew P. Conomos, Adolfo Correa, L. Adrienne Cupples, Joanne E. Curran, Barry I. Freedman, Xiuqing Guo, George Hindy, Marguerite R. Irvin, Sharon L. R. Kardia, Sekar Kathiresan, Alyna T. Khan, Charles L. Kooperberg, Cathy C. Laurie, X. Shirley Liu, Michael C. Mahaney, Ani W. Manichaikul, Lisa W. Martin, Rasika A. Mathias, Stephen T. McGarvey, Braxton D. Mitchell, May E. Montasser, Jill E. Moore, Alanna C. Morrison, Jeffrey R. O'Connell, Nicholette D. Palmer, Akhil Pampana, Juan M. Peralta, Patricia A. Peyser, Bruce M. Psaty, Susan Redline, Kenneth M. Rice, Stephen S. Rich, Jennifer A. Smith, Hemant K. Tiwari, Michael Y. Tsai, Ramachandran S. Vasan, Fei Fei Wang, Daniel E. Weeks, Zhiping Weng, James G. Wilson, Lisa R. Yanek, NHLBI Trans-Omics for Precision Medicine (TOPMed) Consortium, TOPMed Lipids Working Group, Benjamin M. Neale, Shamil R. Sunyaev, Gonçalo R. Abecasis, Jerome I. Rotter, Cristen J. Willer, Gina M. Peloso, Pradeep Natarajan, & Xihong Lin. (2020). Dynamic incorporation of multiple in silico functional annotations empowers rare variant association analysis of large whole-genome sequencing studies at scale. _Nature Genetics_, _52_(9), 969-983. PMID: <a href="https://www.ncbi.nlm.nih.gov/pubmed/32839606">32839606</a>. PMCID: <a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7483769/">PMC7483769</a>. DOI: <a href="https://doi.org/10.1038/s41588-020-0676-4">10.1038/s41588-020-0676-4</a>.

Zilin Li*, Xihao Li*, Hufeng Zhou, Sheila M. Gaynor, Margaret S. Selvaraj, Theodore Arapoglou, Corbin Quick, Yaowu Liu, Han Chen, Ryan Sun, Rounak Dey, Donna K. Arnett, Lawrence F. Bielak, Joshua C. Bis, Thomas W. Blackwell, John Blangero, Eric Boerwinkle, Donald W. Bowden, Jennifer A. Brody, Brian E. Cade, Matthew P. Conomos, Adolfo Correa, L. Adrienne Cupples, Joanne E. Curran, Paul S. de Vries, Ravindranath Duggirala, Barry I. Freedman, Harald H. H. Göring, Xiuqing Guo, Rita R. Kalyani, Charles Kooperberg, Brian G. Kral, Leslie A. Lange, Ani Manichaikul, Lisa W. Martin, Braxton D. Mitchell, May E. Montasser, Alanna C. Morrison, Take Naseri, Jeffrey R. O’Connell, Nicholette D. Palmer, Patricia A. Peyser, Bruce M. Psaty, Laura M. Raffield, Susan Redline, Alexander P. Reiner, Muagututi‘a Sefuiva Reupena, Kenneth M. Rice, Stephen S. Rich, Jennifer A. Smith, Kent D. Taylor, Ramachandran S. Vasan, Daniel E. Weeks, James G. Wilson, Lisa R. Yanek, Wei Zhao, NHLBI Trans-Omics for Precision Medicine (TOPMed) Consortium, TOPMed Lipids Working Group, Jerome I. Rotter, Christen J. Willer, Pradeep Natarajan, Gina M. Peloso and Xihong Lin. (2021). **A framework for detecting noncoding rare variant associations of large-scale whole-genome sequencing studies**. _bioRxiv_. DOI: <a href="https://doi.org/10.1101/2021.11.05.467531">10.1101/2021.11.05.467531</a>.
## License
This software is licensed under GPLv3.

Expand Down
Binary file modified docs/STAAR_manual.pdf
Binary file not shown.
21 changes: 21 additions & 0 deletions inst/include/STAAR_RcppExports.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,27 @@ namespace STAAR {
return Rcpp::as<List >(rcpp_result_gen);
}

inline arma::mat matrix_impute(arma::mat G) {
typedef SEXP(*Ptr_matrix_impute)(SEXP);
static Ptr_matrix_impute p_matrix_impute = NULL;
if (p_matrix_impute == NULL) {
validateSignature("arma::mat(*matrix_impute)(arma::mat)");
p_matrix_impute = (Ptr_matrix_impute)R_GetCCallable("STAAR", "_STAAR_matrix_impute");
}
RObject rcpp_result_gen;
{
RNGScope RCPP_rngScope_gen;
rcpp_result_gen = p_matrix_impute(Shield<SEXP>(Rcpp::wrap(G)));
}
if (rcpp_result_gen.inherits("interrupted-error"))
throw Rcpp::internal::InterruptedException();
if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
throw Rcpp::LongjumpException(rcpp_result_gen);
if (rcpp_result_gen.inherits("try-error"))
throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
return Rcpp::as<arma::mat >(rcpp_result_gen);
}

}

#endif // RCPP_STAAR_RCPPEXPORTS_H_GEN_
7 changes: 4 additions & 3 deletions src/CCT_pval.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// [[Rcpp::depends(RcppArmadillo)]]
// [[Rcpp::interfaces(r, cpp)]]

#define STRICT_R_HEADERS
#include <RcppArmadillo.h>
#include <Rcpp.h>
using namespace Rcpp;
Expand All @@ -25,16 +26,16 @@ double CCT_pval(arma::vec x, arma::vec weights)
{
if(x(k) < 1e-16)
{
cct_stat = cct_stat + weights(k)/x(k)/PI;
cct_stat = cct_stat + weights(k)/x(k)/M_PI;
}else
{
cct_stat = cct_stat + weights(k)*tan((0.5-x(k))*PI);
cct_stat = cct_stat + weights(k)*tan((0.5-x(k))*M_PI);
}
}

if (cct_stat > 1e+15)
{
pval = (1/cct_stat)/PI;
pval = (1/cct_stat)/M_PI;
}else
{
pval = R::pcauchy(cct_stat,0.0,1.0,lower,logp);
Expand Down
37 changes: 37 additions & 0 deletions src/RcppExports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,40 @@ RcppExport SEXP _STAAR_matrix_flip(SEXP GSEXP) {
UNPROTECT(1);
return rcpp_result_gen;
}
// matrix_impute
arma::mat matrix_impute(arma::mat G);
static SEXP _STAAR_matrix_impute_try(SEXP GSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::traits::input_parameter< arma::mat >::type G(GSEXP);
rcpp_result_gen = Rcpp::wrap(matrix_impute(G));
return rcpp_result_gen;
END_RCPP_RETURN_ERROR
}
RcppExport SEXP _STAAR_matrix_impute(SEXP GSEXP) {
SEXP rcpp_result_gen;
{
Rcpp::RNGScope rcpp_rngScope_gen;
rcpp_result_gen = PROTECT(_STAAR_matrix_impute_try(GSEXP));
}
Rboolean rcpp_isInterrupt_gen = Rf_inherits(rcpp_result_gen, "interrupted-error");
if (rcpp_isInterrupt_gen) {
UNPROTECT(1);
Rf_onintr();
}
bool rcpp_isLongjump_gen = Rcpp::internal::isLongjumpSentinel(rcpp_result_gen);
if (rcpp_isLongjump_gen) {
Rcpp::internal::resumeJump(rcpp_result_gen);
}
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 _STAAR_RcppExport_validate(const char* sig) {
Expand All @@ -408,6 +442,7 @@ static int _STAAR_RcppExport_validate(const char* sig) {
signatures.insert("double(*K2)(double,arma::vec)");
signatures.insert("double(*Saddle)(double,arma::vec)");
signatures.insert("List(*matrix_flip)(arma::mat)");
signatures.insert("arma::mat(*matrix_impute)(arma::mat)");
}
return signatures.find(sig) != signatures.end();
}
Expand All @@ -421,6 +456,7 @@ RcppExport SEXP _STAAR_RcppExport_registerCCallable() {
R_RegisterCCallable("STAAR", "_STAAR_K2", (DL_FUNC)_STAAR_K2_try);
R_RegisterCCallable("STAAR", "_STAAR_Saddle", (DL_FUNC)_STAAR_Saddle_try);
R_RegisterCCallable("STAAR", "_STAAR_matrix_flip", (DL_FUNC)_STAAR_matrix_flip_try);
R_RegisterCCallable("STAAR", "_STAAR_matrix_impute", (DL_FUNC)_STAAR_matrix_impute_try);
R_RegisterCCallable("STAAR", "_STAAR_RcppExport_validate", (DL_FUNC)_STAAR_RcppExport_validate);
return R_NilValue;
}
Expand All @@ -441,6 +477,7 @@ static const R_CallMethodDef CallEntries[] = {
{"_STAAR_STAAR_O_SMMAT_sparse_cond", (DL_FUNC) &_STAAR_STAAR_O_SMMAT_sparse_cond, 11},
{"_STAAR_Saddle", (DL_FUNC) &_STAAR_Saddle, 2},
{"_STAAR_matrix_flip", (DL_FUNC) &_STAAR_matrix_flip, 1},
{"_STAAR_matrix_impute", (DL_FUNC) &_STAAR_matrix_impute, 1},
{"_STAAR_RcppExport_registerCCallable", (DL_FUNC) &_STAAR_RcppExport_registerCCallable, 0},
{NULL, NULL, 0}
};
Expand Down

0 comments on commit 623ee2a

Please sign in to comment.