Skip to content

Commit

Permalink
Release 1.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
lemieuxl committed Mar 10, 2017
2 parents 7f319f7 + d8086c4 commit 0222bf7
Show file tree
Hide file tree
Showing 15 changed files with 704 additions and 144 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -14,3 +14,4 @@ htmlcov
.ipynb_checkpoints

build
_build
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -9,6 +9,7 @@ install:
- pip install six
- pip install numpy
- pip install pandas
- pip install -U mock
- pip install coveralls
script:
- coverage run setup.py test
Expand Down
11 changes: 6 additions & 5 deletions README.mkd
Expand Up @@ -5,7 +5,9 @@

# pyplink - Module to process Plink's binary files

`PyPlink` is a Python module to read and write Plink's binary files.
`PyPlink` is a Python module to read and write Plink's binary files. Short
documentation available at
[https://lemieuxl.github.io/pyplink/](https://lemieuxl.github.io/pyplink/).


## Dependencies
Expand Down Expand Up @@ -67,12 +69,11 @@ conda update pyplink -c http://statgen.org/wp-content/uploads/Softwares/pyplink

To test the module, just perform the following command:

```python
>>> import pyplink
>>> pyplink.test()
```console
$ python -m pyplink.tests
.............................................
----------------------------------------------------------------------
Ran 45 tests in 0.480s
Ran 45 tests in 0.334s

OK
```
Expand Down
20 changes: 20 additions & 0 deletions docs/Makefile
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXPROJ = pyplink
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
186 changes: 186 additions & 0 deletions docs/conf.py
@@ -0,0 +1,186 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# pyplink documentation build configuration file, created by
# sphinx-quickstart on Fri Mar 10 09:00:31 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.

import os
import sys
sys.path.insert(0, os.path.abspath('..'))


# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.mathjax',
'sphinx.ext.viewcode',
'sphinx.ext.githubpages',
'sphinx.ext.napoleon',
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'

# The master toctree document.
master_doc = 'index'

# General information about the project.
project = 'pyplink'
copyright = '2017, Louis-Philippe Lemieux Perreault'
author = 'Louis-Philippe Lemieux Perreault'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
import pyplink
version = ".".join(pyplink.__version__.split(".")[:-1])
release = pyplink.__version__

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False


# -- Options for HTML output ----------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'alabaster'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.

html_theme_options = {
'github_user': 'lemieuxl',
'github_repo': 'pyplink',
'github_button': False,
'fixed_sidebar': True,
}

html_sidebars = {
'**': [
'about.html',
'navigation.html',
'relations.html',
'searchbox.html',
'donate.html',
]
}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']


# -- Options for HTMLHelp output ------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'pyplinkdoc'


# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'pyplink.tex', 'pyplink Documentation',
'Louis-Philippe Lemieux Perreault', 'manual'),
]


# -- Options for manual page output ---------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'pyplink', 'pyplink Documentation',
[author], 1)
]


# -- Options for Texinfo output -------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'pyplink', 'pyplink Documentation',
author, 'pyplink', 'One line description of project.',
'Miscellaneous'),
]




# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {
'https://docs.python.org/3': None,
'numpy': ('http://docs.scipy.org/doc/numpy/', None),
'pandas': ('http://pandas.pydata.org/pandas-docs/stable/', None),
}
39 changes: 39 additions & 0 deletions docs/index.rst
@@ -0,0 +1,39 @@
.. pyplink documentation master file, created by
sphinx-quickstart on Fri Mar 10 09:00:31 2017.
pyplink
========

:py:mod:`pyplink` is a Python (2 and 3) binary Plink file parser and writer
released under the MIT licence. The difference with existing parsers (and Plink
itself) is that :py:mod:`pyplink` does not load the BED file in memory, making
possible to work with extremely large files (*e.g.* 1000 Genomes Phase 3
files).

For more information on how to use :py:mod:`pyplink`, refer to the
:doc:`API documentation <pyplink>`. Below is a snippet describing the most
common usage of the module.


.. code-block:: python
from pyplink import PyPlink
with PyPlink("plink_file_prefix") as bed:
# Getting the BIM and FAM
bim = bed.get_bim()
fam = bed.get_fam()
# Iterating over all loci
for loci_name, genotypes in bed:
pass
# Getting the genotypes of a single marker (numpy.ndarray)
genotypes = bed.get_geno_marker("rs12345")
.. toctree::
:hidden:

installation
pyplink
30 changes: 30 additions & 0 deletions docs/installation.rst
@@ -0,0 +1,30 @@

Installation
=============

You can install :py:mod:`pyplink` using either ``pip`` or ``conda``.

.. code-block:: bash
# Using pip
pip install pyplink
.. code-block:: bash
# Using conda
conda config --add channels http://statgen.org/wp-content/uploads/Softwares/pyplink
conda install pyplink
To test the installation, run ``python`` and execute the following commands.

.. code-block:: python
>>> import pyplink
>>> pyplink.test()
.............................................
----------------------------------------------------------------------
Ran 45 tests in 0.343s
OK
11 changes: 11 additions & 0 deletions docs/pyplink.rst
@@ -0,0 +1,11 @@

pyplink's API
==============

.. autoclass:: pyplink.PyPlink
:members:


.. automodule:: pyplink
:members:

4 changes: 2 additions & 2 deletions pyplink/__init__.py
Expand Up @@ -25,7 +25,7 @@
# THE SOFTWARE.


from .pyplink import *
from .pyplink import PyPlink

try:
from .version import pyplink_version as __version__
Expand All @@ -46,7 +46,7 @@ def test(verbosity=1): # pragma: no cover
"""Executes all the tests for pyplink.
Args:
verbosity (int): the verbosity level for unittest
verbosity (int): The verbosity level for :py:mod:`unittest`.
Just set ``verbosity`` to an integer higher than ``1`` to have more
information about the tests.
Expand Down

0 comments on commit 0222bf7

Please sign in to comment.