Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Mkdocs starter kit for Github Pages #17

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
20 changes: 20 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: docs
on:
push:
branches:
- master
- main
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: 3.9
- run: pip install mkdocs mkdocs-material mkdocs-markdownextradata-plugin mkdocs-git-revision-date-localized-plugin "mkdocstrings[python]"
- run: mkdocs gh-deploy --force
44 changes: 44 additions & 0 deletions docs/examples.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
## Needleman-Wunsch

```python
seq_a = ["G", "A", "T", "T", "A", "C", "A"]
seq_b = ["G", "C", "A", "T", "G", "C", "G"]

aligned_seq_a, aligned_seq_b = needleman_wunsch(
seq_a,
seq_b,
match_score=1.0,
mismatch_score=-1.0,
indel_score=-1.0,
gap="_",
)

# Expects ["G", "_", "A", "T", "T", "A", "C", "A"]
print(aligned_seq_a)

# Expects ["G", "C", "A", "_", "T", "G", "C", "G"]
print(aligned_seq_b)
```


## Hirschberg

```python
seq_a = ["A", "G", "T", "A", "C", "G", "C", "A"]
seq_b = ["T", "A", "T", "G", "C"]

aligned_seq_a, aligned_seq_b = hirschberg(
seq_a,
seq_b,
match_score=2.0,
mismatch_score=-1.0,
indel_score=-2.0,
gap="_",
)

# Expects ["A", "G", "T", "A", "C", "G", "C", "A"]
print(aligned_seq_a)

# Expects ["_", "_", "T", "A", "T", "G", "C", "_"]
print(aligned_seq_b)
```
25 changes: 25 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
## Introduction

Efficient implementations of Needleman-Wunsch and other sequence alignment algorithms written in Rust with Python bindings via PyO3.

## Installation

```bash
pip install sequence_align
```

## Quickstart

```python
seq_a = ["G", "A", "T", "T", "A", "C", "A"]
seq_b = ["G", "C", "A", "T", "G", "C", "G"]

aligned_seq_a, aligned_seq_b = needleman_wunsch(
seq_a,
seq_b,
match_score=1.0,
mismatch_score=-1.0,
indel_score=-1.0,
gap="_",
)
```
Empty file added docs/methodology.md
Empty file.
69 changes: 69 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
site_name: sequence_align

theme:
name: "material"
features:
# - navigation.indexes
- navigation.sections
- navigation.tabs
- navigation.expand
- navigation.top
palette:
# Palette toggle for light mode
- media: "(prefers-color-scheme: light)"
scheme: default
primary: blue-grey
toggle:
icon: material/brightness-7
name: Switch to dark mode

# Palette toggle for dark mode
- media: "(prefers-color-scheme: dark)"
scheme: slate
primary: blue-grey
toggle:
icon: material/brightness-4
name: Switch to light mode

repo_name: PPPModels
repo_url: https://github.com/kensho-technologies/sequence_align
edit_uri: blob/main/docs/
site_url: https://kensho-technologies.github.io/sequence_align/

extra:
homepage: https://kensho-technologies.github.io/
social:
- icon: fontawesome/brands/github
link: https://github.com/kensho-technologies/sequence_align

nav:
- Overview: index.md
- Methodology: methodology.md
- Examples: examples.md

plugins:
- search
- mkdocstrings:
handlers:
python:
options:
docstring_style: google


markdown_extensions:
- pymdownx.highlight:
anchor_linenums: true
line_spans: __span
pygments_lang_class: true
- pymdownx.inlinehilite
- pymdownx.snippets
- pymdownx.superfences
- pymdownx.arithmatex:
generic: true
- pymdownx.details
- admonition

extra_javascript:
- https://polyfill.io/v3/polyfill.min.js?features=es6
- https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js

3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ dev = [
"pyyaml",
"types-psutil",
"types-pyyaml",
"mkdocs",
"mkdocs-material",
"mkdocstrings",
]

[tool.black]
Expand Down