Skip to content

Commit c372e13

Browse files
committed
MultiSTAAR v0.9.7.1
1 parent 203ee49 commit c372e13

11 files changed

+51
-8
lines changed

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Package: MultiSTAAR
22
Type: Package
33
Title: Multi-Trait STAAR (MultiSTAAR) Procedure for Dynamic Incorporation of Multiple Functional Annotations in Whole-Genome Sequencing Studies
4-
Version: 0.9.7
5-
Date: 2024-10-19
4+
Version: 0.9.7.1
5+
Date: 2024-11-14
66
Author: Xihao Li [aut, cre], Zilin Li [aut, cre], Han Chen [aut], Zhonghua Liu [aut]
77
Maintainer: Xihao Li <xihaoli@unc.edu>, Zilin Li <lizl@nenu.edu.cn>
88
Description: An R package for performing MultiSTAAR procedure in whole-genome sequencing studies.

R/Indiv_Score_Test_Region_multi.R

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
#' defining rare variants (default = 0.01).
1414
#' @param rv_num_cutoff the cutoff of minimum number of variants of analyzing
1515
#' a given variant-set (default = 2).
16+
#' @param rv_num_cutoff_max the cutoff of maximum number of variants of analyzing
17+
#' a given variant-set (default = 1e+09).
1618
#' @return a data frame with p rows corresponding to the p genetic variants in the given variant-set
1719
#' and (k+1) columns: \code{Score1},...,\code{Scorek} (the score test statistics for each phenotype)
1820
#' and \code{pvalue} (the multivariate score test p-value).
@@ -25,7 +27,8 @@
2527
#' @export
2628

2729
Indiv_Score_Test_Region_multi <- function(genotype,obj_nullmodel,
28-
rare_maf_cutoff=0.01,rv_num_cutoff=2){
30+
rare_maf_cutoff=0.01,rv_num_cutoff=2,
31+
rv_num_cutoff_max=1e9){
2932

3033
if(class(genotype)[1] != "matrix" && !(!is.null(attr(class(genotype), "package")) && attr(class(genotype), "package") == "Matrix")){
3134
stop("genotype is not a matrix!")
@@ -49,6 +52,10 @@ Indiv_Score_Test_Region_multi <- function(genotype,obj_nullmodel,
4952
rm(genotype,MAF)
5053
gc()
5154

55+
if(sum(RV_label) >= rv_num_cutoff_max){
56+
stop(paste0("Number of rare variant in the set is more than ",rv_num_cutoff_max,"!"))
57+
}
58+
5259
if(sum(RV_label) >= rv_num_cutoff){
5360
G <- as(Geno_rare,"dgCMatrix")
5461
G <- Diagonal(n = obj_nullmodel$n.pheno) %x% G

R/Indiv_Score_Test_Region_multi_cond.R

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
#' defining rare variants (default = 0.01).
2020
#' @param rv_num_cutoff the cutoff of minimum number of variants of analyzing
2121
#' a given variant-set (default = 2).
22+
#' @param rv_num_cutoff_max the cutoff of maximum number of variants of analyzing
23+
#' a given variant-set (default = 1e+09).
2224
#' @param method_cond a character value indicating the method for conditional analysis.
2325
#' \code{optimal} refers to regressing residuals from the null model on \code{genotype_adj}
2426
#' as well as all covariates used in fitting the null model (fully adjusted) and taking the residuals;
@@ -40,6 +42,7 @@
4042

4143
Indiv_Score_Test_Region_multi_cond <- function(genotype,genotype_adj,obj_nullmodel,
4244
rare_maf_cutoff=0.01,rv_num_cutoff=2,
45+
rv_num_cutoff_max=1e9,
4346
method_cond=c("optimal","naive")){
4447

4548
method_cond <- match.arg(method_cond) # evaluate choices
@@ -73,6 +76,10 @@ Indiv_Score_Test_Region_multi_cond <- function(genotype,genotype_adj,obj_nullmod
7376
rm(genotype,MAF)
7477
gc()
7578

79+
if(sum(RV_label) >= rv_num_cutoff_max){
80+
stop(paste0("Number of rare variant in the set is more than ",rv_num_cutoff_max,"!"))
81+
}
82+
7683
if(sum(RV_label) >= rv_num_cutoff){
7784
G <- as(Geno_rare,"dgCMatrix")
7885
G <- Diagonal(n = obj_nullmodel$n.pheno) %x% G

R/MultiSTAAR.R

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
#' defining rare variants (default = 0.01).
2626
#' @param rv_num_cutoff the cutoff of minimum number of variants of analyzing
2727
#' a given variant-set (default = 2).
28+
#' @param rv_num_cutoff_max the cutoff of maximum number of variants of analyzing
29+
#' a given variant-set (default = 1e+09).
2830
#' @return a list with the following members:
2931
#' @return \code{num_variant}: the number of variants with minor allele frequency > 0 and less than
3032
#' \code{rare_maf_cutoff} in the given variant-set that are used for performing the
@@ -85,7 +87,8 @@
8587
#' @export
8688

8789
MultiSTAAR <- function(genotype,obj_nullmodel,annotation_phred=NULL,
88-
rare_maf_cutoff=0.01,rv_num_cutoff=2){
90+
rare_maf_cutoff=0.01,rv_num_cutoff=2,
91+
rv_num_cutoff_max=1e9){
8992

9093
if(!inherits(genotype, "matrix") && !inherits(genotype, "Matrix")){
9194
stop("genotype is not a matrix!")
@@ -112,6 +115,10 @@ MultiSTAAR <- function(genotype,obj_nullmodel,annotation_phred=NULL,
112115
gc()
113116
annotation_phred <- annotation_phred[RV_label,,drop=FALSE]
114117

118+
if(sum(RV_label) >= rv_num_cutoff_max){
119+
stop(paste0("Number of rare variant in the set is more than ",rv_num_cutoff_max,"!"))
120+
}
121+
115122
if(sum(RV_label) >= rv_num_cutoff){
116123
G <- as(Geno_rare,"dgCMatrix")
117124
cMAC <- sum(G)

R/MultiSTAAR_cond.R

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
#' defining rare variants (default = 0.01).
3232
#' @param rv_num_cutoff the cutoff of minimum number of variants of analyzing
3333
#' a given variant-set (default = 2).
34+
#' @param rv_num_cutoff_max the cutoff of maximum number of variants of analyzing
35+
#' a given variant-set (default = 1e+09).
3436
#' @param method_cond a character value indicating the method for conditional analysis.
3537
#' \code{optimal} refers to regressing residuals from the null model on \code{genotype_adj}
3638
#' as well as all covariates used in fitting the null model (fully adjusted) and taking the residuals;
@@ -99,7 +101,7 @@
99101
#' @export
100102

101103
MultiSTAAR_cond <- function(genotype,genotype_adj,obj_nullmodel,annotation_phred=NULL,
102-
rare_maf_cutoff=0.01,rv_num_cutoff=2,
104+
rare_maf_cutoff=0.01,rv_num_cutoff=2,rv_num_cutoff_max=1e9,
103105
method_cond=c("optimal","naive")){
104106

105107
method_cond <- match.arg(method_cond) # evaluate choices
@@ -136,6 +138,10 @@ MultiSTAAR_cond <- function(genotype,genotype_adj,obj_nullmodel,annotation_phred
136138
gc()
137139
annotation_phred <- annotation_phred[RV_label,,drop=FALSE]
138140

141+
if(sum(RV_label) >= rv_num_cutoff_max){
142+
stop(paste0("Number of rare variant in the set is more than ",rv_num_cutoff_max,"!"))
143+
}
144+
139145
if(sum(RV_label) >= rv_num_cutoff){
140146
G <- as(Geno_rare,"dgCMatrix")
141147
cMAC <- sum(G)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Please see the <a href="docs/MultiSTAAR_manual.pdf">**MultiSTAAR** user manual</
2929
## Data Availability
3030
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).
3131
## Version
32-
The current version is 0.9.7 (October 19, 2024).
32+
The current version is 0.9.7.1 (November 14, 2024).
3333
## License
3434
This software is licensed under GPLv3.
3535

docs/MultiSTAAR_manual.pdf

540 Bytes
Binary file not shown.

man/Indiv_Score_Test_Region_multi.Rd

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/Indiv_Score_Test_Region_multi_cond.Rd

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/MultiSTAAR.Rd

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)