Skip to main content

A light-weight bioinformatics package

Project description

krane

AWS Scholarship Capstone Project - A light-weight bioinformatics package

Folder structure

krane/
├── LICENSE
├── MANIFEST.in
├── README.md
├── dispatch.yaml                   # For GAE domain mapping
├── gae-deploy-flow.yml             # For GAE workflow (move to workflow)
├── krane.app.yaml                  # For GAE gloud deployment
├── noxfile.py                      
├── pyproject.toml
├── requirements-dev.txt
├── requirements.txt
├── src
│   └── krane
│       ├── README.md
│       ├── __init__.py             # Package version and top-level imports       ├── cli
│          ├── __init__.py
│          └── commands.py         # CLI commands       ├── core
│          ├── __init__.py
│          ├── models.py           # Pydantic/data models          ├── sequence.py         # Core sequence analysis logic          └── utils.py
│       └── web
│           ├── __init__.py
│           ├── app.py              # FastAPI application setup           ├── documentation.md    # Markdown documentation           ├── index.md            # Markdown home description           ├── routes
│              ├── __init__.py
│              ├── sequence.py     # Sequence-related endpoints              └── utils.py        # Utility endpoints           ├── schemas
│              ├── __init__.py
│              └── sequence.py     # Request/Response models           ├── static
│              ├── css
│              ├── img
│              └── js
│           └── templates           # For web interface               ├── demo.html
│               ├── help.html
│               └── index.html
├── tests                           # For automated tests   ├── __init__.py
│   ├── test_cli.py
│   ├── test_core.py
│   └── test_web.py
└── tox.ini

Generate requirements.txt

Install pip-tools

pip install pip-tools

Generate requirements.txt from pyproject.toml

pip-compile pyproject.toml -o requirements.txt

Generate dev requirements (includes test dependencies)

pip-compile pyproject.toml --extra dev --extra test -o requirements-dev.txt

Install package

Dev mode

python3 -m pip install --editable .

How to use krane

pip install krane

Install the package in development mode:

pip install -e .

Run web application

Using the installed command

krane-web

Running directly with uvicorn

uvicorn krane.web.app:app --reload

Use command line

Analyze a sequence

krane analyze ATCG --type DNA --label "Test"

Generate random sequence

krane generate --length 20 --type DNA

Read FASTA file

krane read-fasta sequence.fasta

Automated Test

Install test dependencies

pip install -e ".[test]"

Run all tests

pytest

Run with verbose output

pytest -v

Run with coverage report

pytest --cov=krane

Run all tests together

pytest tests/ -v

Run specific test file

pytest tests/test_web.py
pytest tests/test_core.py

Run tests matching a pattern

pytest -k "test_sequence"

Deployment Process

Deployment to Pypi

  • Create PyPI account and get API token
  • Add PYPI_API_TOKEN to GitHub repository secrets

For PyPI

# Tag a new version by creating annotated tags
# git tag -a v0.1.0 -m "Release version v0.1.0" 
# git tag -a v0.1.0 -m "Version 0.1.0" # setuptools_scm does not recognize lightweight tags
git tag -a v0.1.0 -m "Release version 0.1.0" # setuptools_scm does not recognize lightweight tags
# Push the Specific Tag to Remote
git push origin v0.1.0
# Push all tags to the remote
git push --tags --force  # Push updated tags to remote
# This triggers PyPI workflow

Force update tag locally first:

git tag -f v0.1.0 <local-commit-hash>
git push -f origin v0.1.0

Deployment to GAE

  • Create Google Cloud project
  • Create service account with App Engine Admin role
  • Download JSON key
  • Add to GitHub secrets:
  • GCP_PROJECT_ID: Your project ID
  • GCP_SA_KEY: The entire JSON key content

For Google App Engine:

# Push to main branch
git push origin main

# This triggers GAE workflow

Testing the deployments

After PyPI deployment:

# In a new virtual environment
pip install krane

# Test library
python -c "from krane.core import Sequence; print(Sequence('ATCG', 'DNA').transcription())"

# Test CLI
krane --help

After GAE deployment:

# Your app will be available at
https://krane.barestripe.com/

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

krane-0.1.0.tar.gz (15.9 kB view details)

Uploaded Source

Built Distribution

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

krane-0.1.0-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

Details for the file krane-0.1.0.tar.gz.

File metadata

  • Download URL: krane-0.1.0.tar.gz
  • Upload date:
  • Size: 15.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for krane-0.1.0.tar.gz
Algorithm Hash digest
SHA256 49a635408f77831b9b99ab4d477cc2e50f2742b43e1b6e18af6ae1318b36f179
MD5 5eea34e001e68bd16d3f0cb38fe70a8f
BLAKE2b-256 438e0be84998f3b07d2845f54d0b41b9c2daba8ad35301ecef07b24d5ba3aff1

See more details on using hashes here.

Provenance

The following attestation bundles were made for krane-0.1.0.tar.gz:

Publisher: pypi-deploy-flow.yml on callezenwaka/krane

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file krane-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: krane-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for krane-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2b66d9bf1726887e6046b4593f918175dd93595072ccc1768f822c56befe70af
MD5 64788f426f58dd059ea96bed5d4443bf
BLAKE2b-256 c38e29d257da3d77f971886f419b04ec1f7467de94849ab98241e71e86c8bcb6

See more details on using hashes here.

Provenance

The following attestation bundles were made for krane-0.1.0-py3-none-any.whl:

Publisher: pypi-deploy-flow.yml on callezenwaka/krane

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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