Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[flake8]
# Black by its default setting the maximum length to 88
max-line-length = 88
extend-ignore =
# also the Black's default, whitespace before ':'
E203,
# this is for the line length, all the lines too long are comments now
E501
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
environment: release

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
Expand All @@ -31,14 +31,14 @@ jobs:
- name: Build SDist and wheel
run: python3 -m build

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
path: dist/*

- name: Check metadata
run: pipx run twine check dist/*

- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: artifact
path: dist
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Evaluate code syntax and correctness
on: [push, pull_request]

jobs:
pre-commit_and_pytest:
name: Run pre-commit and pytest
strategy:
matrix:
os: [ubuntu-latest, Windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
permissions:
contents: read

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11.x"

- uses: pre-commit/action@v3.0.0
name: Run pre-commit

- name: Install pypa/build
run: >-
python3 -m
pip install
--upgrade
build

- name: Initialize submodules
run: |
git submodule update --init

- name: Build SDist and wheel
run: python3 -m build

- name: Install AlphaImpute2
run: pip install dist/alphaimpute2-0.0.2-py3-none-any.whl

- name: Install pytest
run: |
pip install pytest
pip install pytest-benchmark

- name: Run pytest
run: |
pytest
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ __pycache__/
*.py[cod]
*.DS_Store
*.egg-info/
build/
example/outputs
.env
tests/functional_tests/outputs
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
repos:
- repo: https://github.com/psf/black
rev: 23.7.0
hooks:
- id: black
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8
16 changes: 16 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: 2

build:
os: ubuntu-22.04
tools:
python: "3.11"
jobs:
post_create_environment:
- pip install sphinx-rtd-theme

sphinx:
configuration: docs/source/conf.py

formats:
- pdf
- epub
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@ AlphaImpute2

AlphaImpute2 is a phasing and imputation algorithm for massive livestock populations. The method uses a approximate version of multi-locus iterative peeling for pedigree based imputation, and a novel imputation algorithm that uses the Positional Burrows Wheeler Transform for population imputation. AlphaImpute2 has been successfully used to perform imputation in populations of hundreds of thousands of individuals. AlphaImpute2 was developed by Andrew Whalen, and is currently being supported by Andrew Whalen and Steve Thorn.

User guide
============

See [https://alphapeel.readthedocs.io/en/latest](https://alphaimpute2.readthedocs.io/en/latest/)

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

AlphaImpute2 is available on [PyPI](https://pypi.org/project/AlphaImpute2/):

pip install AlphaImpute2

Availability
============
Expand Down
12 changes: 12 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import os
import shutil


def pytest_configure(config):
"""
Prepare path and report file for functional tests
"""
func_output_path = os.path.join("tests", "functional_tests", "outputs")
if os.path.exists(func_output_path):
shutil.rmtree(func_output_path)
os.mkdir(func_output_path)
142 changes: 128 additions & 14 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config

# -- Path setup --------------------------------------------------------------

Expand All @@ -17,56 +19,168 @@

# -- Project information -----------------------------------------------------

project = 'AlphaImpute2'
copyright = '2020, Andrew Whalen'
author = 'Andrew Whalen'
project = "AlphaImpute2"
copyright = "2020, Andrew Whalen"
author = "Andrew Whalen"

# The short X.Y version
version = ""
# The full version, including alpha/beta/rc tags
release = ""


# -- 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.mathjax",
"sphinx.ext.ifconfig",
"sphinx.ext.viewcode",
"sphinx.ext.githubpages",
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
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"

# 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 = "python"

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []

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


# -- 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'
html_theme = "sphinx_rtd_theme"

# 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 = {}

# 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']
html_static_path = []

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# The default sidebars (for documents that don't match any pattern) are
# defined by theme itself. Builtin themes are using these templates by
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
# 'searchbox.html']``.
#
# html_sidebars = {}


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

# Output file base name for HTML help builder.
htmlhelp_basename = "AlphaImpute2doc"


# -- 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',
'extraclassoptions': 'openany,oneside'

"extraclassoptions": "openany,oneside"
}

# 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,
"AlphaImpute2.tex",
"AlphaImpute2 Documentation",
"Andrew Whalen",
"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, "alphaimpute2", "AlphaImpute2 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,
"AlphaPeel",
"AlphaPeel Documentation",
author,
"AlphaPeel",
"One line description of project.",
"Miscellaneous",
),
]


# -- Options for Epub output -------------------------------------------------

# Bibliographic Dublin Core info.
epub_title = project

# The unique identifier of the text. This can be a ISBN number
# or the project homepage.
#
# epub_identifier = ''

# A unique identification for the text.
#
# epub_uid = ''

# A list of files that should not be packed into the epub file.
epub_exclude_files = ["search.html"]


# -- Extension configuration -------------------------------------------------
Loading