Skip to content

Commit

Permalink
STAARpipeline v0.9.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
xihaoli committed Oct 25, 2024
1 parent e871c66 commit 297e3bd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
21 changes: 10 additions & 11 deletions R/fit_nullmodel.R
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,11 @@ fit_nullmodel <- function(fixed, data = parent.frame(), kins, use_sparse = NULL,

if(use_SPA)
{
# generate XW
X <- obj_nullmodel$X
working <- obj_nullmodel$weights

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
# generate XSigma_i
obj_nullmodel$XSigma_i <- as.matrix(crossprod(X,obj_nullmodel$Sigma_i))
obj_nullmodel$XXSigma_iX_inv <- as.matrix(X%*%obj_nullmodel$cov)
}

}else if(!inherits(kins, "matrix") && !inherits(kins, "Matrix")){
Expand All @@ -109,7 +105,7 @@ fit_nullmodel <- function(fixed, data = parent.frame(), kins, use_sparse = NULL,
{
X <- obj_nullmodel$X

## generate XSigma_iX
## generate XSigma_i
obj_nullmodel$XSigma_i <- crossprod(X,obj_nullmodel$Sigma_i)
obj_nullmodel$XXSigma_iX_inv <- X%*%obj_nullmodel$cov
}
Expand All @@ -133,7 +129,7 @@ fit_nullmodel <- function(fixed, data = parent.frame(), kins, use_sparse = NULL,
{
X <- obj_nullmodel$X

## generate Sigma_i
## generate XSigma_i
obj_nullmodel$XSigma_i <- crossprod(X,obj_nullmodel$Sigma_i)
obj_nullmodel$XXSigma_iX_inv <- X%*%obj_nullmodel$cov
}
Expand All @@ -151,9 +147,12 @@ fit_nullmodel <- function(fixed, data = parent.frame(), kins, use_sparse = NULL,
if(use_SPA)
{
X <- obj_nullmodel$X
muhat <- obj_nullmodel$fitted.values
working <- muhat*(1-muhat)

obj_nullmodel$XW <- as.matrix(crossprod(X,obj_nullmodel$Sigma_i))
obj_nullmodel$XXWX_inv <- as.matrix(X%*%obj_nullmodel$cov)
## generate XW
obj_nullmodel$XW <- t(X*working)
obj_nullmodel$XXWX_inv <- X%*%solve(t(X*working)%*%X)
}
}
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 @@ -31,7 +31,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.1 (August 9, 2024).
The current version is 0.9.7.1 (October 25, 2024).
## Citation
If you use **STAARpipeline** and **STAARpipelineSummary** for your work, please cite:

Expand Down

0 comments on commit 297e3bd

Please sign in to comment.