Giter Club home page Giter Club logo

psyops's Introduction

PsyOPS

PsyOPS (short for Psychiatric Omnilocus Prioritization Score) is a software package for prioritizing causal genes from psychiatric genome-wide association studies (GWAS).

For a detailed description of PsyOPS, check out our paper!

Getting started

Download this repository, which contains the PsyOPS code (PsyOPS.py) and all necessary data files:

git clone https://github.com/Wainberg/PsyOPS
cd PsyOPS

PsyOPS requires Python >= 3.6 with the numpy, scipy, pandas, and scikit-learn packages. You can install Python and the required packages with Miniconda as follows:

wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh -bp ~/.anaconda3
rm Miniconda3-latest-Linux-x86_64.sh
export PATH="~/.anaconda3/bin:$PATH"
conda install -y numpy scipy pandas scikit-learn

Running PsyOPS

PsyOPS.py takes two arguments, both of which are mandatory:

  1. --GWAS-hit-file: a tab-separated file of lead variants. Must contain 3 columns: "rs" (the variant's rs number), "chrom" (the variant's chromosome; only autosomal variants will be analyzed), and "bp_hg19" (the variant's hg19/GRCh37 base pair coordinates). Chromosomes can be specified either with or without the "chr" prefix (e.g. both "1" and "chr1" are fine).
  2. --output-file: a tab-separated file where results will be output. Each row lists a gene within 500 kilobases of one of the lead variants. Columns denote the lead variant, the distance to the gene, the gene, the gene's chromosome, transcription start site and transcription end site (in hg19/GRCh37 coordinates), whether the gene has each of the three PsyOPS features (extreme pLI, brain-enriched expression, neurodevelopmental disorder), and the gene's PsyOPS score.

As an example, let's run PsyOPS on the 102 lead variants from a recent major depressive disorder (MDD) GWAS , provided in the file Howard_102_MDD.tsv in this repository:

python PsyOPS.py --GWAS-hit-file Howard_102_MDD.tsv --output-file PsyOPS_MDD.tsv

This takes about 5 seconds to run and prints the following output:

Loaded 102 autosomal GWAS hits from Howard_102_MDD.tsv

88 of 708 genes (12.4%) are positives (i.e. nearest genes)

Model coefficients (when trained without cross-validation):
                                   OR  lower_CI   upper_CI             p
Intercept                    0.071024  0.051358   0.098221  1.531120e-57
Extreme pLI                  2.710843  1.491015   4.928634  1.076882e-03
Brain-enriched expression    2.927626  1.661044   5.160004  2.033198e-04
Neurodevelopmental disorder  5.458068  2.909110  10.240418  1.249739e-07

WARNING: only one class represented for chromosome chr15; excluding from accuracy calculation

Average performance across chromosomes: AUC 0.71 +/- 0.05, AUPRC 0.53 +/- 0.07

Prioritized genes:
ADARB2, AGBL4, ASTN2, ATP2A2, BRINP2, CABP1, CACNA1D, CACNA1E, CDC42BPB, CELF4, CHD6, CNTLN, CRB1, CRYBA1, CTNND1, CTTNBP2, CYP7B1, DAAM1, DAGLA, DCC, DDX6, DNAH3, DOCK9, DPF2, DRD2, EIF3B, ELAVL2, EP300, ESR2, EYS, FHIT, GRIK2, GRIK3, GRM5, H4C12, HIVEP2, KCNG2, KIF2A, KIRREL3, KLF7, LHX2, LIN28B, LRFN5, MEF2C, MEIS2, MPPED2, MRTFB, MSANTD1, NCOA2, NEGR1, NR2F1, NR4A2, PAX5, PCDH8, PCDH9, PCLO, PHOX2B, PPFIA1, PROX2, QRICH1, RAB3B, RBFOX1, REEP1, RERE, RFX3, RSRC1, SEMA6D, SGIP1, SHISA9, SLC12A5, SORCS3, SOX5, SPRY2, STXBP5, TCF4, TEX26, THSD7A, TNR, TRPC3, TUSC1, VRK2, WDR17, ZNF445, ZNF536

Exported results to PsyOPS_MDD.tsv

We also provide lead variant files for the other two psychiatric GWAS analyzed in the PsyOPS paper, for bipolar disorder (Mullins_64_BIP.tsv) and schizophrenia (Pardinas_145_SCZ.tsv).

psyops's People

Contributors

wainberg avatar

Watchers

 avatar

Forkers

mja

psyops's Issues

Assertion error

Hello,

Thanks a lot for this interesting method. I tried it, but I keep getting assertion errors, even with your example file. Do you have any idea why?

Ran into issue while running the suggested example

home/testing tools/PsyOPS$ python PsyOPS.py --GWAS-hit-file Howard_102_MDD.tsv --output-file PsyOPS_Clust2_MDD.tsv
Loaded 102 autosomal GWAS hits from Howard_102_MDD.tsv
TypeError: unhashable type: 'set'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "PsyOPS.py", line 118, in
alias_to_gene = alias_to_gene[alias_to_gene.isin(genes.gene)]
File "/opt/conda/lib/python3.6/site-packages/pandas/core/series.py", line 4698, in isin
result = algorithms.isin(self, values)
File "/opt/conda/lib/python3.6/site-packages/pandas/core/algorithms.py", line 475, in isin
return f(comps, values)
File "pandas/_libs/hashtable_func_helper.pxi", line 454, in pandas._libs.hashtable.ismember_object
SystemError: <built-in method view of numpy.ndarray object at 0x7fb147995490> returned a result with an error set

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.