Giter Site home page Giter Site logo

mikedacre / lddirection Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 115 KB

Get information about direction of agreement for any two lists of SNPs, based on LDlink and plink

License: MIT License

Python 100.00%
linkage-disequilibrium plink genome snps

lddirection's Introduction

LD_Direction

Get information about direction of agreement for any two lists of SNPs, based on LDlink and plink

Compares every SNP in one list to each SNP in another:

LD_Direction_graphic.png

Pairs are the filtered by distance on the genome and linkage disequilibrium. The filtered list includes phasing information, allowing instant lookup of the allele in one SNP given an allele in the other. Lookup for a single pair is also possible.

The software works best used as a python library, but two scripts are provided also:

  • ldlists : allows comparison of two SNP lists as described above
  • ldpair : allows comparison of just one pair with a more detailed report than given by ldlists

To run this code, you will need a copy of a dbSNP sqlite database and a copy of all the 1000genomes VCF files.

Note: Currently under development and unstable/unusable.

The code can be used as

Requirments

Code

To run ldlists you will need a funtional version of PLINK 1.9: https://www.cog-genomics.org/plink, to run ldpair you will need a functional version of tabix htslib

I recommend installing both of these tools.

Python Requirements

All python requirements will be automatically downloaded when installing using the setup.py file.

Essential requirements:

Required for table handling in ldlists:

Recommended for progress bars:

Recommended if you have access to a torque or slurm cluster:

All of the above except fyrd will be installed automatically, if you want to parallelize on a cluster, install and configure fyrd on your system.

Data

To run this code you will need the 1000genomes data in plink format and a copy of dbSNP. It could hypothetically be generalized to run on any plink file and without dbSNP.

1000genomes

To get the 1000genomes data, download all the ALL.chr*vcf.gz files on ftp://ftp.1000genomes.ebi.ac.uk/vol1/ftp/release/20130502.

To convert to plink, you will need to run the following commands on every file:

i=ALL.chr6.phase3_shapeit2_mvncall_integrated_v5a.20130502.genotypes.vcf.gz;
j=$(echo $i | sed 's/.vcf.gz//');
vftools --gzvcf $i --plink-tped --out $j &&
plink --tped $j.tped --tfam $j.tfam --out $j

To run these on every file:

for i in ALL.chr*.vcf.gz; do
  j=$(echo $i | sed 's/.vcf.gz//');
  vftools --gzvcf $i --plink-tped --out $j &&
  plink --tped $j.tped --tfam $j.tfam --out $j
done

dbSNP

We use a dbSNP database interface that I wrote for position lookup: https://github.com/MikeDacre/dbSNP You can download any version of dbSNP you want and build a database using that code. However, this is a very slow process. You can find pre-built databases at sftp [email protected]/dbSNP, password is 'givemethedb'. Note that we support sftp only, not regular FTP, and this is just my personal machine at Stanford, if there are too many downloads I will have to stop providing data.

lddirection's People

Contributors

mikedacre avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

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.