Skip to content

sriramlab/FastKAST

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

92 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DOI

icon

Fast Model-X Kernel-based Set Testing Toolkits

https://pypi.org/project/fast-kernel-set-test

This folder has been updated with both the FastKAST and QuadKAST

Please check sub-branch for detailed instruction on each specific method.

Table of contents:

  1. Installation
  2. Basic usage
    1. FastKAST
    2. QuadKAST
  3. Useful functions

Installation

  1. You need python >= 3.60 in order to run the code (anaconda3 recommended)
  2. pip install fast-kernel-set-test or install from source

You can either follow the standard pipeline FastKAST_annot.py and QuadKAST_annot.py, or import the neccessary function to build based on your own I/O.

Basic usage

FastKAST

To run the demo FastKAST code with a customized window size, you can generate a annotation file with "start_index end_index" as a row, and run

python FastKAST_annot.py --bfile ./example/sim --phen ./example/sim.pheno --annot ./example/sim.new.annot

Or directly run

sh run_rbf_annot.sh

QuadKAST

To run the demo QuadKAST code with a customized window size, you can generate a annotation file with "start_index end_index" as a row, and run

python QuadKAST_annot.py --bfile ./example/sim --phen ./example/sim.pheno --annot ./example/sim.new.annot

Or directly run

sh run_quad_annot.sh

Useful functions

  • Single trait analysis
## Given covariates c: (NxM), input Z: (NxD), and output y: (Nx1)
from FastKAST import getfullComponentPerm
results = getfullComponentPerm(c,Z,y,Perm=10)
## results: {'pval': [obs_pval, perm_pval1, ..., perm_pval10]}     
  • Multi-traits analysis
## Given covariates c: (NxM), input Z: (NxD), and output y: (NxK)
from FastKAST import getfullComponentMulti
results = getfullComponentMulti(c,Z,y)
## results: {'pval': [obs_pval1, obs_pval2, ..., obs_pvalK]}     

Data availability

The detailed statistics used to generate the main table and the Venn diagram of the paper are provided in the Data folder

✅ Efficient multi-traits analysis (Sep 30, 2024)