Skip to content

Commit

Permalink
STAARpipeline v0.9.7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
xihaoli committed Nov 17, 2024
1 parent 2f60ed5 commit 7213664
Show file tree
Hide file tree
Showing 74 changed files with 662 additions and 276 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Package: STAARpipeline
Type: Package
Title: STAARpipeline for Analyzing Whole-Genome/Whole-Exome Sequencing Data
Version: 0.9.7.2
Date: 2024-11-14
Date: 2024-11-17
Author: Xihao Li [aut, cre], Zilin Li [aut, cre], Sheila M. Gaynor [aut], Han Chen [aut]
Maintainer: Xihao Li <[email protected]>, Zilin Li <[email protected]>
Description: An R package for performing STAARpipeline in analyzing whole-genome/whole-exome sequencing data.
Expand Down
31 changes: 21 additions & 10 deletions R/Gene_Centric_Coding.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
#' a given variant-set (default = 2).
#' @param rv_num_cutoff_max the cutoff of maximum number of variants of analyzing
#' a given variant-set (default = 1e+09).
#' @param rv_num_cutoff_max_prefilter the cutoff of maximum number of variants
#' before extracting the genotype matrix (default = 1e+09).
#' @param QC_label channel name of the QC label in the GDS/aGDS file (default = "annotation/filter").
#' @param variant_type type of variant included in the analysis. Choices include "SNV", "Indel", or "variant" (default = "SNV").
#' @param geno_missing_imputation method of handling missing genotypes. Either "mean" or "minor" (default = "mean").
Expand All @@ -47,7 +49,7 @@
#' @export

Gene_Centric_Coding <- function(chr,gene_name,category=c("all_categories","plof","plof_ds","missense","disruptive_missense","synonymous","ptv","ptv_ds","all_categories_incl_ptv"),
genofile,obj_nullmodel,rare_maf_cutoff=0.01,rv_num_cutoff=2,rv_num_cutoff_max=1e9,
genofile,obj_nullmodel,rare_maf_cutoff=0.01,rv_num_cutoff=2,rv_num_cutoff_max=1e9,rv_num_cutoff_max_prefilter=1e9,
QC_label="annotation/filter",variant_type=c("SNV","Indel","variant"),geno_missing_imputation=c("mean","minor"),
Annotation_dir="annotation/info/FunctionalAnnotation",Annotation_name_catalog,
Use_annotation_weights=c(TRUE,FALSE),Annotation_name=NULL,
Expand All @@ -63,7 +65,8 @@ Gene_Centric_Coding <- function(chr,gene_name,category=c("all_categories","plof"
if(category=="all_categories")
{
results <- coding(chr,gene_name,genofile,obj_nullmodel,genes,
rare_maf_cutoff=rare_maf_cutoff,rv_num_cutoff=rv_num_cutoff,rv_num_cutoff_max=rv_num_cutoff_max,
rare_maf_cutoff=rare_maf_cutoff,rv_num_cutoff=rv_num_cutoff,
rv_num_cutoff_max=rv_num_cutoff_max,rv_num_cutoff_max_prefilter=rv_num_cutoff_max_prefilter,
QC_label=QC_label,variant_type=variant_type,geno_missing_imputation=geno_missing_imputation,
Annotation_dir=Annotation_dir,Annotation_name_catalog=Annotation_name_catalog,
Use_annotation_weights=Use_annotation_weights,Annotation_name=Annotation_name,
Expand All @@ -73,7 +76,8 @@ Gene_Centric_Coding <- function(chr,gene_name,category=c("all_categories","plof"
if(category=="plof")
{
results <- plof(chr,gene_name,genofile,obj_nullmodel,genes,
rare_maf_cutoff=rare_maf_cutoff,rv_num_cutoff=rv_num_cutoff,rv_num_cutoff_max=rv_num_cutoff_max,
rare_maf_cutoff=rare_maf_cutoff,rv_num_cutoff=rv_num_cutoff,
rv_num_cutoff_max=rv_num_cutoff_max,rv_num_cutoff_max_prefilter=rv_num_cutoff_max_prefilter,
QC_label=QC_label,variant_type=variant_type,geno_missing_imputation=geno_missing_imputation,
Annotation_dir=Annotation_dir,Annotation_name_catalog=Annotation_name_catalog,
Use_annotation_weights=Use_annotation_weights,Annotation_name=Annotation_name,
Expand All @@ -83,7 +87,8 @@ Gene_Centric_Coding <- function(chr,gene_name,category=c("all_categories","plof"
if(category=="plof_ds")
{
results <- plof_ds(chr,gene_name,genofile,obj_nullmodel,genes,
rare_maf_cutoff=rare_maf_cutoff,rv_num_cutoff=rv_num_cutoff,rv_num_cutoff_max=rv_num_cutoff_max,
rare_maf_cutoff=rare_maf_cutoff,rv_num_cutoff=rv_num_cutoff,
rv_num_cutoff_max=rv_num_cutoff_max,rv_num_cutoff_max_prefilter=rv_num_cutoff_max_prefilter,
QC_label=QC_label,variant_type=variant_type,geno_missing_imputation=geno_missing_imputation,
Annotation_dir=Annotation_dir,Annotation_name_catalog=Annotation_name_catalog,
Use_annotation_weights=Use_annotation_weights,Annotation_name=Annotation_name,
Expand All @@ -93,7 +98,8 @@ Gene_Centric_Coding <- function(chr,gene_name,category=c("all_categories","plof"
if(category=="missense")
{
results <- missense(chr,gene_name,genofile,obj_nullmodel,genes,
rare_maf_cutoff=rare_maf_cutoff,rv_num_cutoff=rv_num_cutoff,rv_num_cutoff_max=rv_num_cutoff_max,
rare_maf_cutoff=rare_maf_cutoff,rv_num_cutoff=rv_num_cutoff,
rv_num_cutoff_max=rv_num_cutoff_max,rv_num_cutoff_max_prefilter=rv_num_cutoff_max_prefilter,
QC_label=QC_label,variant_type=variant_type,geno_missing_imputation=geno_missing_imputation,
Annotation_dir=Annotation_dir,Annotation_name_catalog=Annotation_name_catalog,
Use_annotation_weights=Use_annotation_weights,Annotation_name=Annotation_name,
Expand All @@ -103,7 +109,8 @@ Gene_Centric_Coding <- function(chr,gene_name,category=c("all_categories","plof"
if(category=="disruptive_missense")
{
results <- disruptive_missense(chr,gene_name,genofile,obj_nullmodel,genes,
rare_maf_cutoff=rare_maf_cutoff,rv_num_cutoff=rv_num_cutoff,rv_num_cutoff_max=rv_num_cutoff_max,
rare_maf_cutoff=rare_maf_cutoff,rv_num_cutoff=rv_num_cutoff,
rv_num_cutoff_max=rv_num_cutoff_max,rv_num_cutoff_max_prefilter=rv_num_cutoff_max_prefilter,
QC_label=QC_label,variant_type=variant_type,geno_missing_imputation=geno_missing_imputation,
Annotation_dir=Annotation_dir,Annotation_name_catalog=Annotation_name_catalog,
Use_annotation_weights=Use_annotation_weights,Annotation_name=Annotation_name,
Expand All @@ -113,7 +120,8 @@ Gene_Centric_Coding <- function(chr,gene_name,category=c("all_categories","plof"
if(category=="synonymous")
{
results <- synonymous(chr,gene_name,genofile,obj_nullmodel,genes,
rare_maf_cutoff=rare_maf_cutoff,rv_num_cutoff=rv_num_cutoff,rv_num_cutoff_max=rv_num_cutoff_max,
rare_maf_cutoff=rare_maf_cutoff,rv_num_cutoff=rv_num_cutoff,
rv_num_cutoff_max=rv_num_cutoff_max,rv_num_cutoff_max_prefilter=rv_num_cutoff_max_prefilter,
QC_label=QC_label,variant_type=variant_type,geno_missing_imputation=geno_missing_imputation,
Annotation_dir=Annotation_dir,Annotation_name_catalog=Annotation_name_catalog,
Use_annotation_weights=Use_annotation_weights,Annotation_name=Annotation_name,
Expand All @@ -124,7 +132,8 @@ Gene_Centric_Coding <- function(chr,gene_name,category=c("all_categories","plof"
if(category=="ptv")
{
results <- ptv(chr,gene_name,genofile,obj_nullmodel,genes,
rare_maf_cutoff=rare_maf_cutoff,rv_num_cutoff=rv_num_cutoff,rv_num_cutoff_max=rv_num_cutoff_max,
rare_maf_cutoff=rare_maf_cutoff,rv_num_cutoff=rv_num_cutoff,
rv_num_cutoff_max=rv_num_cutoff_max,rv_num_cutoff_max_prefilter=rv_num_cutoff_max_prefilter,
QC_label=QC_label,variant_type=variant_type,geno_missing_imputation=geno_missing_imputation,
Annotation_dir=Annotation_dir,Annotation_name_catalog=Annotation_name_catalog,
Use_annotation_weights=Use_annotation_weights,Annotation_name=Annotation_name,
Expand All @@ -135,7 +144,8 @@ Gene_Centric_Coding <- function(chr,gene_name,category=c("all_categories","plof"
if(category=="ptv_ds")
{
results <- ptv_ds(chr,gene_name,genofile,obj_nullmodel,genes,
rare_maf_cutoff=rare_maf_cutoff,rv_num_cutoff=rv_num_cutoff,rv_num_cutoff_max=rv_num_cutoff_max,
rare_maf_cutoff=rare_maf_cutoff,rv_num_cutoff=rv_num_cutoff,
rv_num_cutoff_max=rv_num_cutoff_max,rv_num_cutoff_max_prefilter=rv_num_cutoff_max_prefilter,
QC_label=QC_label,variant_type=variant_type,geno_missing_imputation=geno_missing_imputation,
Annotation_dir=Annotation_dir,Annotation_name_catalog=Annotation_name_catalog,
Use_annotation_weights=Use_annotation_weights,Annotation_name=Annotation_name,
Expand All @@ -146,7 +156,8 @@ Gene_Centric_Coding <- function(chr,gene_name,category=c("all_categories","plof"
if(category=="all_categories_incl_ptv")
{
results <- coding_incl_ptv(chr,gene_name,genofile,obj_nullmodel,genes,
rare_maf_cutoff=rare_maf_cutoff,rv_num_cutoff=rv_num_cutoff,rv_num_cutoff_max=rv_num_cutoff_max,
rare_maf_cutoff=rare_maf_cutoff,rv_num_cutoff=rv_num_cutoff,
rv_num_cutoff_max=rv_num_cutoff_max,rv_num_cutoff_max_prefilter=rv_num_cutoff_max_prefilter,
QC_label=QC_label,variant_type=variant_type,geno_missing_imputation=geno_missing_imputation,
Annotation_dir=Annotation_dir,Annotation_name_catalog=Annotation_name_catalog,
Use_annotation_weights=Use_annotation_weights,Annotation_name=Annotation_name,
Expand Down
26 changes: 18 additions & 8 deletions R/Gene_Centric_Coding_cond.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#' a given variant-set (default = 2).
#' @param rv_num_cutoff_max the cutoff of maximum number of variants of analyzing
#' a given variant-set (default = 1e+09).
#' @param rv_num_cutoff_max_prefilter the cutoff of maximum number of variants
#' before extracting the genotype matrix (default = 1e+09).
#' @param method_cond a character value indicating the method for conditional analysis.
#' \code{optimal} refers to regressing residuals from the null model on \code{known_loci}
#' as well as all covariates used in fitting the null model (fully adjusted) and taking the residuals;
Expand Down Expand Up @@ -53,7 +55,8 @@
#' @export

Gene_Centric_Coding_cond <- function(chr,gene_name,category=c("plof","plof_ds","missense","disruptive_missense","synonymous","ptv","ptv_ds"),
genofile,obj_nullmodel,known_loci=NULL,rare_maf_cutoff=0.01,rv_num_cutoff=2,rv_num_cutoff_max=1e9,
genofile,obj_nullmodel,known_loci=NULL,rare_maf_cutoff=0.01,rv_num_cutoff=2,
rv_num_cutoff_max=1e9,rv_num_cutoff_max_prefilter=1e9,
method_cond=c("optimal","naive"),
QC_label="annotation/filter",variant_type=c("SNV","Indel","variant"),geno_missing_imputation=c("mean","minor"),
Annotation_dir="annotation/info/FunctionalAnnotation",Annotation_name_catalog,
Expand All @@ -74,7 +77,8 @@ Gene_Centric_Coding_cond <- function(chr,gene_name,category=c("plof","plof_ds","
if(category=="plof")
{
results <- plof_cond(chr,gene_name,genofile,obj_nullmodel,genes,
known_loci,rare_maf_cutoff=rare_maf_cutoff,rv_num_cutoff=rv_num_cutoff,rv_num_cutoff_max=rv_num_cutoff_max,
known_loci,rare_maf_cutoff=rare_maf_cutoff,rv_num_cutoff=rv_num_cutoff,
rv_num_cutoff_max=rv_num_cutoff_max,rv_num_cutoff_max_prefilter=rv_num_cutoff_max_prefilter,
method_cond=method_cond,
QC_label=QC_label,variant_type=variant_type,geno_missing_imputation=geno_missing_imputation,
Annotation_dir=Annotation_dir,Annotation_name_catalog=Annotation_name_catalog,
Expand All @@ -84,7 +88,8 @@ Gene_Centric_Coding_cond <- function(chr,gene_name,category=c("plof","plof_ds","
if(category=="plof_ds")
{
results <- plof_ds_cond(chr,gene_name,genofile,obj_nullmodel,genes,
known_loci,rare_maf_cutoff=rare_maf_cutoff,rv_num_cutoff=rv_num_cutoff,rv_num_cutoff_max=rv_num_cutoff_max,
known_loci,rare_maf_cutoff=rare_maf_cutoff,rv_num_cutoff=rv_num_cutoff,
rv_num_cutoff_max=rv_num_cutoff_max,rv_num_cutoff_max_prefilter=rv_num_cutoff_max_prefilter,
method_cond=method_cond,
QC_label=QC_label,variant_type=variant_type,geno_missing_imputation=geno_missing_imputation,
Annotation_dir=Annotation_dir,Annotation_name_catalog=Annotation_name_catalog,
Expand All @@ -94,7 +99,8 @@ Gene_Centric_Coding_cond <- function(chr,gene_name,category=c("plof","plof_ds","
if(category=="missense")
{
results <- missense_cond(chr,gene_name,genofile,obj_nullmodel,genes,
known_loci,rare_maf_cutoff=rare_maf_cutoff,rv_num_cutoff=rv_num_cutoff,rv_num_cutoff_max=rv_num_cutoff_max,
known_loci,rare_maf_cutoff=rare_maf_cutoff,rv_num_cutoff=rv_num_cutoff,
rv_num_cutoff_max=rv_num_cutoff_max,rv_num_cutoff_max_prefilter=rv_num_cutoff_max_prefilter,
method_cond=method_cond,
QC_label=QC_label,variant_type=variant_type,geno_missing_imputation=geno_missing_imputation,
Annotation_dir=Annotation_dir,Annotation_name_catalog=Annotation_name_catalog,
Expand All @@ -104,7 +110,8 @@ Gene_Centric_Coding_cond <- function(chr,gene_name,category=c("plof","plof_ds","
if(category=="disruptive_missense")
{
results <- disruptive_missense_cond(chr,gene_name,genofile,obj_nullmodel,genes,
known_loci,rare_maf_cutoff=rare_maf_cutoff,rv_num_cutoff=rv_num_cutoff,rv_num_cutoff_max=rv_num_cutoff_max,
known_loci,rare_maf_cutoff=rare_maf_cutoff,rv_num_cutoff=rv_num_cutoff,
rv_num_cutoff_max=rv_num_cutoff_max,rv_num_cutoff_max_prefilter=rv_num_cutoff_max_prefilter,
method_cond=method_cond,
QC_label=QC_label,variant_type=variant_type,geno_missing_imputation=geno_missing_imputation,
Annotation_dir=Annotation_dir,Annotation_name_catalog=Annotation_name_catalog,
Expand All @@ -114,7 +121,8 @@ Gene_Centric_Coding_cond <- function(chr,gene_name,category=c("plof","plof_ds","
if(category=="synonymous")
{
results <- synonymous_cond(chr,gene_name,genofile,obj_nullmodel,genes,
known_loci,rare_maf_cutoff=rare_maf_cutoff,rv_num_cutoff=rv_num_cutoff,rv_num_cutoff_max=rv_num_cutoff_max,
known_loci,rare_maf_cutoff=rare_maf_cutoff,rv_num_cutoff=rv_num_cutoff,
rv_num_cutoff_max=rv_num_cutoff_max,rv_num_cutoff_max_prefilter=rv_num_cutoff_max_prefilter,
method_cond=method_cond,
QC_label=QC_label,variant_type=variant_type,geno_missing_imputation=geno_missing_imputation,
Annotation_dir=Annotation_dir,Annotation_name_catalog=Annotation_name_catalog,
Expand All @@ -124,7 +132,8 @@ Gene_Centric_Coding_cond <- function(chr,gene_name,category=c("plof","plof_ds","
if(category=="ptv")
{
results <- ptv_cond(chr,gene_name,genofile,obj_nullmodel,genes,
known_loci,rare_maf_cutoff=rare_maf_cutoff,rv_num_cutoff=rv_num_cutoff,rv_num_cutoff_max=rv_num_cutoff_max,
known_loci,rare_maf_cutoff=rare_maf_cutoff,rv_num_cutoff=rv_num_cutoff,
rv_num_cutoff_max=rv_num_cutoff_max,rv_num_cutoff_max_prefilter=rv_num_cutoff_max_prefilter,
method_cond=method_cond,
QC_label=QC_label,variant_type=variant_type,geno_missing_imputation=geno_missing_imputation,
Annotation_dir=Annotation_dir,Annotation_name_catalog=Annotation_name_catalog,
Expand All @@ -134,7 +143,8 @@ Gene_Centric_Coding_cond <- function(chr,gene_name,category=c("plof","plof_ds","
if(category=="ptv_ds")
{
results <- ptv_ds_cond(chr,gene_name,genofile,obj_nullmodel,genes,
known_loci,rare_maf_cutoff=rare_maf_cutoff,rv_num_cutoff=rv_num_cutoff,rv_num_cutoff_max=rv_num_cutoff_max,
known_loci,rare_maf_cutoff=rare_maf_cutoff,rv_num_cutoff=rv_num_cutoff,
rv_num_cutoff_max=rv_num_cutoff_max,rv_num_cutoff_max_prefilter=rv_num_cutoff_max_prefilter,
method_cond=method_cond,
QC_label=QC_label,variant_type=variant_type,geno_missing_imputation=geno_missing_imputation,
Annotation_dir=Annotation_dir,Annotation_name_catalog=Annotation_name_catalog,
Expand Down
Loading

0 comments on commit 7213664

Please sign in to comment.