Skip to content

Commit

Permalink
STAARpipeline v0.9.7
Browse files Browse the repository at this point in the history
  • Loading branch information
xihaoli committed Jan 22, 2024
1 parent 3732f62 commit ee8b071
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
16 changes: 9 additions & 7 deletions R/fit_nullmodel.R
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,14 @@ fit_nullmodel <- function(fixed, data = parent.frame(), kins, use_sparse = NULL,
if(use_SPA)
{
# generate XW
X <- model.matrix(obj_nullmodel)
X <- obj_nullmodel$X
working <- obj_nullmodel$weights

obj_nullmodel$XW <- t(X)%*%diag(working)
obj_nullmodel$XXWX_inv <- X%*%solve(t(X)%*%diag(working)%*%X)
obj_nullmodel$XW <- as.matrix(crossprod(X,obj_nullmodel$Sigma_i))
obj_nullmodel$XXWX_inv <- as.matrix(X%*%obj_nullmodel$cov)

obj_nullmodel$XSigma_i <- obj_nullmodel$XW
obj_nullmodel$XXSigma_iX_inv <- obj_nullmodel$XXWX_inv
}

}else if(!inherits(kins, "matrix") && !inherits(kins, "Matrix")){
Expand Down Expand Up @@ -147,11 +150,10 @@ fit_nullmodel <- function(fixed, data = parent.frame(), kins, use_sparse = NULL,

if(use_SPA)
{
X <- model.matrix(obj_nullmodel)
working <- obj_nullmodel$weights
X <- obj_nullmodel$X

obj_nullmodel$XW <- t(X)%*%diag(working)
obj_nullmodel$XXWX_inv <- X%*%solve(t(X)%*%diag(working)%*%X)
obj_nullmodel$XW <- as.matrix(crossprod(X,obj_nullmodel$Sigma_i))
obj_nullmodel$XXWX_inv <- as.matrix(X%*%obj_nullmodel$cov)
}
}
obj_nullmodel$relatedness <- TRUE
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Please see the <a href="docs/STAARpipeline_manual.pdf">**STAARpipeline** user ma
## Data Availability
The whole-genome functional annotation data assembled from a variety of sources and the precomputed annotation principal components are available at the [Functional Annotation of Variant - Online Resource (FAVOR)](https://favor.genohub.org) site and [FAVOR Essential Database](https://doi.org/10.7910/DVN/1VGTJI).
## Version
The current version is 0.9.7 (November 9, 2023).
The current version is 0.9.7 (January 22, 2024).
## Citation
If you use **STAARpipeline** and **STAARpipelineSummary** for your work, please cite:

Expand Down

0 comments on commit ee8b071

Please sign in to comment.