Skip to main content

PySnpTools

Project description

## PySnpTools
-------------------------------------

PySnpTools is a library for reading and manipulating genetic data.

Main Features:

snpreader: Efficiently read genetic PLINK formats including *.bed/bim/fam files.
Also, efficiently read parts of files and standardize data.

util: In one line, intersect and re-order IIDs from snpreader and other sources.
Also, efficiently extract a submatrix from an ndarray.

util.IntRangeSet: Efficiently manipulate ranges of integers - for example, genetic position
- with set operators including union, intersection, and set difference.

util.pheno: Read the PLINK pheno type file format.

Find the PySnpTools documentation
http://research.microsoft.com/en-us/um/redmond/projects/MSCompBio/PySnpTools/


We originally created it for FaST-LMM, a program for performing genome-wide association studies (GWAS) on large data sets.
http://research.microsoft.com/en-us/um/redmond/projects/MicrosoftGenomics/Fastlmm/



### Quick install:


If you have pip installed, installation is as easy as:

```
pip install pysnptools
```


### Detailed Package Install Instructions:


pysnptools has the following dependencies:

python 2.7

Packages:

* numpy
* scipy
* pandas
* cython


#### (1) Installation of dependent packages

We highly recommend using a python distribution such as
Anaconda (https://store.continuum.io/cshop/anaconda/)
or Enthought (https://www.enthought.com/products/epd/free/).
Both these distributions can be used on linux and Windows, are free
for non-commercial use, and optionally include an MKL-compiled distribution
for optimal speed. This is the easiest way to get all the required package
dependencies.


#### (2) Installing from source

Go to the directory where you copied the source code for fastlmm.

On linux:

At the shell, type:
```
sudo python setup.py install
```

On Windows:

At the OS command prompt, type
```
python setup.py install
```


### For developers (and also to run regression tests)

When working on the developer version, first add the src directory of the package to your PYTHONPATH
environment variable.

For building C-extensions, first make sure all of the above dependencies are installed (including cython)

To build extension (from .\src dir), type the following at the OS prompt:
```
python setup.py build_ext --inplace
```

Note, if this fails with a gcc permission denied error, then specifying the correct compiler will
likely fix the problem, e.g.
```
python setup.py build_ext --inplace --compiler=msvc
```

Don't forget to set your PYTHONPATH to point to the directory above the one named pysnptools in
the pysnptools source code. For e.g. if pysnptools is in the [somedir] directory, then
in the unix shell use:
```
export PYTHONPATH=$PYTHONPATH:[somedir]
```
Or in the Windows DOS terminal,
one can use:
```
set PYTHONPATH=%PYTHONPATH%;[somedir]
```
(or use the Windows GUI for env variables).

**Note for Windows: You must have Visual Studio installed. If you have VisualStudio2008 installed
(which was used to build python2.7) you need to nothing more. Otherwise, follow these instructions:

If you have Visual Studio 2010 installed, execute:
```
SET VS90COMNTOOLS=%VS100COMNTOOLS%
```

or with Visual Studio 2012 installed:
```
SET VS90COMNTOOLS=%VS110COMNTOOLS%
```

or with Visual Studio 2013 installed:
```
SET VS90COMNTOOLS=%VS120COMNTOOLS%
```

#### Running regression tests

From the directory tests at the top level, run:
```
python test.py
```
This will run a
series of regression tests, reporting "." for each one that passes, "F" for each
one that does not match up, and "E" for any which produce a run-time error. After
they have all run, you should see the string "............" indicating that they
all passed, or if they did not, something such as "....F...E......", after which
you can see the specific errors.

Note that you must use "python setup.py build_ext --inplace" to run the
regression tests, and not "python setup.py install".

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pysnptools-0.2.13.zip (166.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pysnptools-0.2.13.win-amd64-py2.7.exe (398.5 kB view details)

Uploaded Source

File details

Details for the file pysnptools-0.2.13.zip.

File metadata

  • Download URL: pysnptools-0.2.13.zip
  • Upload date:
  • Size: 166.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pysnptools-0.2.13.zip
Algorithm Hash digest
SHA256 2b9a97f2bccd3ec454202b1f69b72ab3f5dd9e58978445d0bda26dc7372eeee7
MD5 0bf360b79f5fdc3a905d6e0ea2d35079
BLAKE2b-256 75f92ddb6ef2f05b63920bc06f80e772d7565442d1d52b042c3ad4f4abf252a0

See more details on using hashes here.

File details

Details for the file pysnptools-0.2.13.win-amd64-py2.7.exe.

File metadata

File hashes

Hashes for pysnptools-0.2.13.win-amd64-py2.7.exe
Algorithm Hash digest
SHA256 1bea51ec8a61b6fe093e4d4b208368f7fe87bfe83c7a2be0a37347adff874876
MD5 e1d28cd61c9dfe4c0960548687e5fd1b
BLAKE2b-256 779bf3506a7795c28d1008268d2ee4bba583a13af8666f8efdb1ccf06681d200

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page