Skip to content

Commit

Permalink
Merge pull request #74 from horta/develop
Browse files Browse the repository at this point in the history
Resyncing branchs develop and master
  • Loading branch information
horta committed Nov 30, 2018
2 parents f344935 + e0304ea commit e10df99
Show file tree
Hide file tree
Showing 172 changed files with 7,315 additions and 3,718 deletions.
13 changes: 13 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
build: off
clone_depth: 4
platform: x64
configuration: Release

environment:
PKG_NAME: limix
PYTHON: "C:\\Python36-x64"
ARCH: x64

build_script:
- set PATH=%PYTHON%;%PYTHON%\Scripts;%PATH%
- powershell -Command "(New-Object Net.WebClient).DownloadFile('https://raw.githubusercontent.com/horta/ci/master/appveyor.bat', 'appveyor.bat')" && appveyor.bat
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
*.jpg
*.raw
*.swp
.pytest_cache/
*.csv
*.bed
Expand Down
61 changes: 34 additions & 27 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,52 @@
language: python
sudo: required
dist: trusty
git:
depth: 5
matrix:
include:
- python: 2.7
- python: 3.6
- os: osx
language: generic
env: PYENV=py27
- os: osx
language: generic
env: PYENV=py36
python:
- 3.6
env:
- PKG_NAME=limix
HDF5_USE_FILE_LOCKING=FALSE
addons:
apt:
packages:
- libffi-dev
- libffi6
before_install:
- travis_retry bash <(curl -s https://raw.githubusercontent.com/limix/travis-tools/master/get-travis-tools.sh)
- travis_retry travis/before-install.sh
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh;
else
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
fi
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- hash -r
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
- conda info -a
- conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION numpy scipy setuptools pytest pip matplotlib cython netcdf4 ipython
- source activate test-environment
- conda update --all --yes
- pip install -U pip -q

install:
- travis_retry travis/install.sh
- source activate test-environment
- pip install -U setuptools pytest pytest-pycodestyle -q

script:
- travis_retry travis/script.sh
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then py.test --cov=limix; fi
after_success:
- travis_retry travis/after-success.sh
- codecov
- source activate test-environment
- bash <(curl -fsSL https://raw.githubusercontent.com/horta/ci/master/travis.sh)
notifications:
email:
recipients:
- danilo.horta@gmail.com
on_success: change
on_success: never
on_failure: always
env:
global:
- LIKNORM=true
- secure: TGjO9nGH88bYMoRG3nBKYZn1Xj43/DzBK6lqWAL+2D7rd6jryPTSMy9R0luuqOUubhPCI7BpQVLKYXsRi0T0EGeRm4WbjQa2AD9TZlrvgRSWftMZ0U5UEvAoONMAsXV3CpND6Ey5yynRALjvt/4kH4a1IjIOwvSepxIwN7bGEFIXGyFq/scl65DT/7TFsv7UKzIKaOO6U9dq0vFekciCX+uuNF5pX7A8SMFrO6ydRfUtO47o9M+ieoGHgkQw0KyjD8wjbMa/2TXvpY6tAf8BnyYH8XhqJ7Tztzzc9Hbpxqr8b4LjnGr3UEfz6c0benzLufYwoQyi6T6T4ur1H19i0OS9LO/v9HrWkhuzx/15HH5b2GEZJK8DcnoWc/1csX5W9M3TbWhOIiCW8fyujVwcOznah7GW9cwPFuWP7+JZiw5E2B+u8ukkio9QsG7BV4+YJZCBevOGe70QNiEwUhF9E9TRyCXuQvORYv8nKIMoQ8GnujSEoHLmYMbdYEM/bLcOVfsfDOEWJPUvtBJ+Mmhz1DyMcS4qpUtStSu5Io38l1ZD7AdZ8iGGPkeYfF7ke4ZWQgx9CGrXVgYmyj016p0Z0mXr7GSDkhyIo4nhHb2EoH1rdW29T+GbSyz4Q9AtZNghkvZbYeFyvqsoWqXLn27dG91t7CZ7hT25gSag49VTbnA=
deploy:
provider: pypi
server: https://upload.pypi.org/legacy/
user: dhorta
password:
secure: NS5ir5qJr4f9FcwVwJhNt8WIwOxDHyV4UJ6e01sZ2hPtW/afukFuCTgJ4duFJuYHWFlgMk1Kv3pEhQnTKwzi4MO7fqV7N0hg7e6L42OOL3BB0XamCtBnMY+76hPnXTSkGhA3wDrqBQ/dzBstN739qNPh3IeC8oax7otKh8QzyZfmIQHYqXQJqdTx6Cdap/gR4CF56h+VuNs7aGSRuvjVWV9lIOHsK/ZCKIE1QTq7aRnOAUU6fXtdE4uEqwOl4bzU1HauxElonSudaYiv+NTLNkB7YRR4Ur1VTa7HXNhs9y/RYId0R6xputp+ousutQg5mlGD/z2Qaez6hlwoCgAqIsVNeiLnNQinXx1Z+lJSLQfnw2AX5zi9HgAsgb6ts6gJm2vTCVuOBpcti0uJd9l+0LR0IuGLYwWz1lXQN7/hsAeQFpK/A4tzlDMGQV0wxNFvCq/hSe7LnVehnTOVmJ+HU51XAqF766HYyf+/KcKhaY8IDlpkuLxmTAvY5/vk/JPhmt8JtDP6q+afwSOiM47ciClRtXkRv4zrL/D8euDC1TtLb5Kqxwo59e7cPGB/kLaA9904i0FOcoclv0NZGxdRgXPNYS9ULofjGHzn0Cn5H4FVcYTS3YDYv6bSeNcodQ83zD4FBGvZLe1vuhRdwRbOWKcgeUJNeN0PTL7Txo7YchE=
on:
tags: true
repo: limix/limix
branch: master
python: 3.6
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Apache License
==============

_Version 2.0, January 2004_
_Version 2.0, January 2004_
_&lt;<http://www.apache.org/licenses/>&gt;_

### Terms and Conditions for use, reproduction, and distribution
Expand Down
19 changes: 10 additions & 9 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
include LICENSE.md
include limix/io/examples/data/csv/data.csv
include limix/io/examples/data/gen/example.gen
include limix/io/examples/data/gen/example.sample
include limix/io/examples/data/hdf5/data.h5
include limix/io/test/data/csv/pheno.csv
include limix/io/test/data/gen/example.gen
include limix/io/test/data/gen/example.sample
include limix/io/test/data/hdf5/data.h5
include limix/test/mtset/data/*.txt
include limix/example/data.csv
include limix/example/data.h5.bz2
include limix/example/example.gen
include limix/example/example.sample
include limix/example/pheno.csv
include limix/example/xarr.hdf5.bz2
include limix/example/ex0/data.bed
include limix/example/ex0/data.bim
include limix/example/ex0/data.fam
include limix/example/ex0/phenotype.gemma
include README.md
include version.py
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# limix

[![Travis](https://img.shields.io/travis/limix/limix.svg?style=flat-square&label=linux%20%2F%20macos%20build)](https://travis-ci.org/limix/limix) [![AppVeyor](https://img.shields.io/appveyor/ci/Horta/limix.svg?style=flat-square&label=windows%20build)](https://ci.appveyor.com/project/Horta/limix) [![Documentation](https://img.shields.io/readthedocs/limix.svg?style=flat-square&version=stable)](https://limix.readthedocs.io/)
[![Travis](https://img.shields.io/travis/limix/limix.svg?style=flat-square&label=linux%20%2F%20macos%20build)](https://travis-ci.org/limix/limix) [![AppVeyor](https://img.shields.io/appveyor/ci/Horta/limix.svg?style=flat-square&label=windows%20build)](https://ci.appveyor.com/project/Horta/limix) [![Documentation](https://readthedocs.org/projects/limix/badge/?version=2.0.0&style=flat-square)](https://limix.readthedocs.io/en/2.0.0)

Genomic analyses require flexible models that can be adapted to the needs of the user.

Expand All @@ -19,7 +19,7 @@ The documentation can be found at https://limix.readthedocs.io/en/develop.
The development version of limix can be installed on macOS and Linux via

```bash
bash <(curl -fsSL https://raw.githubusercontent.com/limix/limix/develop/install)
bash <(curl -fsSL https://raw.githubusercontent.com/limix/limix/2.0.0/install)
```

Stable versions of limix are installed via [conda](http://conda.pydata.org/docs/index.html) though
Expand All @@ -35,11 +35,11 @@ An alternative way would be via [pip](https://pypi.python.org/pypi/pip)
In this case, first you need to install [hcephes](https://github.com/limix/hcephes) and [liknorm](https://github.com/limix/liknorm) C libraries.
Then,

An alternative way would be via pip
```bash
pip install limix
```


## Running the tests

After installation, you can test it
Expand All @@ -59,4 +59,4 @@ as long as you have [pytest](https://docs.pytest.org/en/latest/).

## License

This project is licensed under the [Apache License License](https://raw.githubusercontent.com/limix/limix/develop/LICENSE.md).
This project is licensed under the [Apache License License](https://raw.githubusercontent.com/limix/limix/2.0.0/LICENSE.md).
55 changes: 55 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import os
import pytest


def pytest_sessionstart(session):
import doctest
import matplotlib as mpl

_compatibility()
import pandas as pd

mpl.use("agg")
doctest.ELLIPSIS_MARKER = "-ignore-"

pd.set_option("display.width", 88)
pd.set_option("display.max_columns", 79)
pd.set_option("display.max_rows", 60)
pd.set_option("display.large_repr", "truncate")
pd.set_option("display.float_format", "{:8.5f}".format)


@pytest.fixture(autouse=True)
def _docdir(request):

# Trigger ONLY for the doctests or doctestplus.
plug = request.config.pluginmanager.getplugin("doctest")
if plug is None:
plug = request.config.pluginmanager.getplugin("doctestplus")
if plug is None:
item = None
else:
item = plug._doctest_textfile_item_cls
else:
item = plug.DoctestItem

if isinstance(request.node, item):
# Get the fixture dynamically by its name.
tmpdir = request.getfixturevalue("tmpdir")

# Chdir only for the duration of the test.
olddir = os.getcwd()
tmpdir.chdir()
yield
os.chdir(olddir)

else:
# For normal tests, we have to yield, since this is a yield-fixture.
yield


def _compatibility():
import warnings

warnings.filterwarnings("ignore", message="numpy.dtype size changed")
warnings.filterwarnings("ignore", message="numpy.ufunc size changed")
2 changes: 2 additions & 0 deletions doc/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
generated/
_generated/
savefig/
10 changes: 10 additions & 0 deletions doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,17 @@ help:

.PHONY: help Makefile

clean: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
rm -rf _generated/

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
cd .. && python setup.py develop; cd doc
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

livehtml:
cd .. && python setup.py develop; cd doc
sphinx-autobuild -b html -r "(.*\.(bz2|hdf5|jpg|csv|gz)|_generated/.*)" $(SPHINXOPTS) . $(BUILDDIR)/html

125 changes: 125 additions & 0 deletions doc/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
*************
API reference
*************

I/O module
==========

.. autosummary::
:toctree: _generated/

limix.io.bgen.read
limix.io.bimbam.read_phenotype
limix.io.bimbam.see_phenotype
limix.io.csv.read
limix.io.csv.see
limix.io.gen.read
limix.io.hdf5.fetch
limix.io.hdf5.fetcher
limix.io.hdf5.read_limix
limix.io.hdf5.see
limix.io.npy.read
limix.io.npy.save
limix.io.npy.see
limix.io.plink.read
limix.io.plink.see_bed
limix.io.plink.see_kinship
limix.io.plink.fetch_dosage

Quality control
===============

.. autosummary::
:toctree: _generated/

limix.qc.boxcox
limix.qc.compute_maf
limix.qc.count_missingness
limix.qc.indep_pairwise
limix.qc.mean_impute
limix.qc.mean_standardize
limix.qc.normalise_covariance
limix.qc.quantile_gaussianize
limix.qc.regress_out
limix.qc.remove_dependent_cols
limix.qc.unique_variants

Statistics
==========

.. autosummary::
:toctree: _generated/

limix.stats.allele_expectation
limix.stats.allele_frequency
limix.stats.Chi2Mixture
limix.stats.compute_dosage
limix.stats.confusion_matrix
limix.stats.effsizes_se
limix.stats.empirical_pvalues
limix.stats.linear_kinship
limix.stats.lrt_pvalues
limix.stats.multipletests
limix.stats.pca

Heritability estimation
=======================

.. autosummary::
:toctree: _generated/

limix.her.estimate

Quantitative trait loci
=======================

.. autosummary::
:toctree: _generated/

limix.qtl.st_scan
limix.qtl.QTLModel

Plotting & Graphics
===================

.. autosummary::
:toctree: _generated/

limix.plot.box_aspect
limix.plot.ConsensusCurve
limix.plot.image
limix.plot.kinship
limix.plot.load_dataset
limix.plot.manhattan
limix.plot.normal
limix.plot.pca
limix.plot.power
limix.plot.qqplot
limix.plot.image
limix.plot.get_pyplot
limix.plot.show

Generalised Linear Mixed Models
===============================

.. autosummary::
:toctree: _generated/

limix.glmm.GLMMComposer.covariance_matrices
limix.glmm.GLMMComposer.decomp
limix.glmm.GLMMComposer.fit
limix.glmm.GLMMComposer.fixed_effects
limix.glmm.GLMMComposer.likname
limix.glmm.GLMMComposer.lml
limix.glmm.GLMMComposer.y

Shell utilities
===============

.. autosummary::
:toctree: _generated/

limix.sh.filehash
limix.sh.download
limix.sh.extract
limix.sh.remove

0 comments on commit e10df99

Please sign in to comment.