A light-weight bioinformatics package
Project description
krane
AWS Scholarship Capstone Project - A light-weight bioinformatics package
Folder structure
krane/
├── src/
│ └── krane/
│ ├── __init__.py # Package version and top-level imports
│ ├── core/
│ │ ├── __init__.py
│ │ ├── models.py # Pydantic/data models
│ │ └── sequence.py # Core sequence analysis logic
│ ├── web/
│ │ ├── __init__.py
│ │ ├── app.py # FastAPI application setup
│ │ ├── routes/
│ │ │ ├── __init__.py
│ │ │ ├── sequence.py # Sequence-related endpoints
│ │ │ └── utils.py # Utility endpoints
│ │ ├── schemas/
│ │ │ ├── __init__.py
│ │ │ └── sequence.py # Request/Response models
│ │ └── templates/ # For web interface if needed
│ └── cli/
│ ├── __init__.py
│ └── commands.py # CLI commands
├── tests/
│ ├── __init__.py
│ ├── test_core.py
│ └── test_web.py
├── pyproject.toml # Project metadata and dependencies
├── README.md
└── LICENSE
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
git tag -a v0.1.0 -m "Release version 0.1.0"
git push origin v0.1.0
# This triggers PyPI workflow
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://<project-id>.appspot.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.0.0.tar.gz
(10.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
krane-0.0.0-py3-none-any.whl
(11.2 kB
view details)
File details
Details for the file krane-0.0.0.tar.gz.
File metadata
- Download URL: krane-0.0.0.tar.gz
- Upload date:
- Size: 10.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3075668078e0734bb3be68c96302abf684c21decd6a855e47845a5bd2dc0fb7e
|
|
| MD5 |
6daab3ed8903ebfbf5e2bd847849a5c4
|
|
| BLAKE2b-256 |
e925532beb102c1dd1c1218e7f9ace0fd25a6747a37bbb1e481954780821c7aa
|
File details
Details for the file krane-0.0.0-py3-none-any.whl.
File metadata
- Download URL: krane-0.0.0-py3-none-any.whl
- Upload date:
- Size: 11.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f303ba973415a9f3af67f2e773a0b41a83613520f155644eba969d276510a017
|
|
| MD5 |
37f0f34c361afac869cf39927d12d924
|
|
| BLAKE2b-256 |
f4617cee7b2965ad08efb3ef65d0e312c9fe5b51a19d5947e961efea7568f1b1
|