본문 바로가기
Tools

PyHLA

by wycho 2021. 5. 11.

Python for HLA analysis: summary, association analysis, zygosity test and interaction test.

- Paper : https://bmcbioinformatics.biomedcentral.com/articles/10.1186/s12859-017-1496-0

- Github : https://github.com/felixfan/PyHLA

 

Installation

$ pip install pandas numpy scipy statsmodels
$ sudo apt-get install python-qt4 # for GUI
$ git clone https://github.com/felixfan/PyHLA.git

# PyHLA runs on python2. If you want to use it on python3.x, then
$ pip install 2to3
$ 2to3 -w PyHLA.py

 

Input

# columns=[IID, Phenotype(1=unaff, 2=aff), HLA types for genes(e.g. HLA-A HLA-B HLA-C HLA-DQA1)]
001 2 A*02:07:01 A*11:01:01 B*51:01:01 B*51:01:01 C*14:02:01 C*14:02:01 DQA1*01:04:01 DQA1*01:04:01 
0002 1 A*24:02:01 A*33:03:01 B*15:25:01 B*58:01:01 C*03:02:02 C*04:03 NA NA 

 

Options

--exclude exc.txt
$ cat exc.txt
A*01:01:02
C*01:03

--covar covar.txt --covar-name sex,bmi # for logistic and linear regression only
$ cat covar.txt
IID  age sex bmi
0001 28  1   20.70
0002 23  0   16.29

--digit 4 (default) or 6

--test {chisq, fisher, logistic, linear}

--model {allelic, dom, rec}

--freq 0.05 (default) # Minimal allele/allele group frequency

--adjust {Bonferroni, Holm, FDR, FDR_BY} # Adjustment for multiple testing

--out output.txt (default)

--print # Print output to screen

--perm int
# Number of permutation will be performed.
# For each permutation run, a simulated dataset is constructed from the original dataset by randomizing the assignment of phenotype status among individuals. The same individuals are used, maintaining the same LD structure and the original case/control ratio.
# Only simulated dataset with the same common alleles between cases and controls as the original dataset will be used. So assign a greater than zero value to --freq can speed up the permutation.

--seed S # Random seed for permutation.

 

 

 

Reference

- IPD-IMGT/HLA, https://www.ebi.ac.uk/ipd/imgt/hla/

 

 

 

 

'Tools' 카테고리의 다른 글

Excel to tsv  (0) 2021.05.19
PyHLA form  (0) 2021.05.13
PRSice-2  (0) 2021.05.10
Talos  (0) 2021.05.07
Nextflow for pipelines  (0) 2021.05.05

댓글