Molecular modeling extension for MikoshiLang — protein structures, MD analysis, and docking
Project description
MikoshiBio
Molecular Modeling Extension for MikoshiLang
Adds protein structure analysis, molecular dynamics trajectory analysis, and molecular docking capabilities to MikoshiLang.
Features
8th Knowledge Pack: PDB (Protein Data Bank)
- Query 200,000+ experimental protein structures
- Get resolution, experimental method, release dates
- Download PDB/mmCIF files
- Extract sequences from structures
BioPython Integration
- Load PDB structures from files, URLs, or PDB IDs
- Calculate RMSD between structures
- Find inter-atomic contacts
- Identify binding sites
- Secondary structure analysis (DSSP)
- Sequence property analysis
MDAnalysis Integration (v0.2.0) ✨ NEW
- Load and analyze MD trajectories
- Calculate RMSD, RMSF, radius of gyration
- Track contacts and distances over time
- Extract frames and align trajectories
- Support for DCD, XTC, TRR formats
Molecular Docking (v0.2.0) ✨ NEW
- AutoDock Vina integration
- Protein-ligand docking
- Binding affinity calculation
- Virtual screening
- Automatic docking box calculation
- PDB to PDBQT conversion
Planned Features
- Py3Dmol/NGLView visualization (v0.3.0)
- RDKit molecular descriptors (v0.4.0)
- Advanced trajectory analysis (v0.5.0)
Installation
# Basic installation
pip install mikoshi-bio
# With molecular dynamics support
pip install mikoshi-bio[md]
# With docking tools
pip install mikoshi-bio[docking]
# With visualization
pip install mikoshi-bio[visualization]
# Everything
pip install mikoshi-bio[all]
Quick Start
Query PDB Database
from mikoshilang import parse_and_eval
import mikoshibio # Loads PDB pack + structure functions
# Search for structures
parse_and_eval('PackSearch["pdb", "hemoglobin"]')
# → [{"id": "1A3N", "label": "Crystal Structure of Human Hemoglobin", ...}]
# Get structure metadata
parse_and_eval('PackValue["pdb", "1CRN", "Resolution"]')
# → {"value": 1.5, "entity": "1CRN", ...}
# Download structure
parse_and_eval('PackValue["pdb", "1CRN", "PDBFile"]')
# → {"value": "https://files.rcsb.org/download/1CRN.pdb", ...}
Load and Analyze Structures
from mikoshilang import Expr
from mikoshibio import LoadPDB, GetSequence, FindContacts, CalculateRMSD
# Load structure from PDB
structure = LoadPDB("pdb", "1CRN")
# Extract sequence
seq = GetSequence(structure)
print(f"Sequence: {seq}")
# Find contacts within 5 Angstroms
contacts = FindContacts(structure, distance=5.0)
print(f"Found {len(contacts)} contacts")
# Analyze sequence properties
from mikoshibio import SequenceAnalysis
props = SequenceAnalysis(seq)
print(f"MW: {props['molecular_weight']:.2f} Da")
print(f"pI: {props['isoelectric_point']:.2f}")
Compare Structures
# Load two structures
ref = LoadPDB("pdb", "1CRN")
mobile = LoadPDB("pdb", "2CRN")
# Calculate RMSD
rmsd = CalculateRMSD(ref, mobile)
print(f"RMSD: {rmsd:.2f} Å")
Find Binding Sites
# Load structure with ligand
structure = LoadPDB("pdb", "1ATP")
# Find residues near ATP
binding_residues = GetBindingSites(structure, "ATP", distance=4.0)
print(f"Binding site residues: {binding_residues}")
Usage with MikoshiLang Syntax
MikoshiBio integrates seamlessly with MikoshiLang's Wolfram-style syntax:
from mikoshilang import parse_and_eval
import mikoshibio
# Load structure
result = parse_and_eval('LoadPDB["pdb", "1CRN"]')
# Get sequence (stored in variable)
parse_and_eval('seq = GetSequence[result]')
# Analyze sequence
parse_and_eval('SequenceAnalysis[seq]')
# Find contacts
parse_and_eval('FindContacts[result, 5.0]')
Integration with Meta-Analysis Workflow
Example: Autism Epigenetics + Protein Structure
from mikoshilang import parse_and_eval
import mikoshibio
# For each epigenetic gene in your meta-analysis
genes = ["RELN", "OXTR", "MECP2", "UBE3A"]
for gene in genes:
# Query AlphaFold for predicted structure
alphafold = parse_and_eval(f'PackSearch["alphafold", "{gene}"]')
# Query PDB for experimental structures
pdb = parse_and_eval(f'PackSearch["pdb", "{gene}"]')
# Get sequence from best structure
if pdb and len(pdb) > 0:
structure = LoadPDB("pdb", pdb[0]["id"])
sequence = GetSequence(structure)
# Analyze protein properties
props = SequenceAnalysis(sequence)
print(f"{gene}: MW={props['molecular_weight']:.0f} Da, pI={props['isoelectric_point']:.2f}")
# Check for DNA-binding domains (future feature)
# binding_sites = GetBindingSites(structure, "DNA", distance=4.0)
Architecture
mikoshibio/
├── pdb_pack.py # PDB knowledge pack (8th pack)
├── biopython_bridge.py # BioPython wrappers
├── structure_rules.py # MikoshiLang evaluator rules
├── mdanalysis_tools.py # MD trajectory analysis (planned)
├── docking.py # AutoDock Vina interface (planned)
└── visualization.py # Molecular viewers (planned)
Knowledge Packs Comparison
| Pack | Domain | Coverage | License |
|---|---|---|---|
| PubChem | Small molecules | 100M+ | Public Domain |
| AlphaFold | Predicted structures | 200M+ | CC BY 4.0 |
| PDB | Experimental structures | 200K+ | CC0 1.0 |
Requirements
Core:
- Python ≥ 3.9
- mikoshilang ≥ 3.5.0
- biopython ≥ 1.80
Optional:
- MDAnalysis ≥ 2.0 (trajectory analysis)
- AutoDock Vina ≥ 1.2 (molecular docking)
- py3Dmol ≥ 2.0 (visualization)
- RDKit ≥ 2022.9 (molecular descriptors)
Functions Reference
Knowledge Pack Functions
PackSearch["pdb", query, limit=5] # Search PDB structures
PackValue["pdb", pdb_id, property] # Get structure metadata
Properties: Title, Method, Resolution, ReleaseDate, Organism, Chains, Sequence, PDBFile, MMCIF
Structure Analysis Functions
LoadPDB["pdb", pdb_id] # Load from PDB
LoadPDB[file_path] # Load from file
GetSequence[structure] # Extract amino acid sequence
FindContacts[structure, distance] # Find inter-atomic contacts
CalculateRMSD[struct1, struct2] # Structural alignment
CalculateSecondaryStructure[struct, file] # DSSP analysis
GetBindingSites[structure, ligand] # Binding site residues
SequenceAnalysis[sequence] # Protein properties
Development Status
- ✅ v0.1.0: PDB pack + BioPython integration
- ⏳ v0.2.0: MDAnalysis trajectory tools
- ⏳ v0.3.0: AutoDock Vina docking interface
- ⏳ v0.4.0: Molecular visualization (Py3Dmol/NGLView)
- ⏳ v0.5.0: RDKit molecular descriptors
License
Apache 2.0
Links
- GitHub: https://github.com/DarrenEdwards111/MikoshiBio
- MikoshiLang: https://pypi.org/project/mikoshilang/
- Documentation: https://mikoshi.co.uk/mikoshilang
Citation
If you use MikoshiBio in your research, please cite:
@software{mikoshibio2026,
title = {MikoshiBio: Molecular Modeling Extension for MikoshiLang},
author = {Mikoshi Ltd},
year = {2026},
url = {https://github.com/DarrenEdwards111/MikoshiBio}
}
Built by Mikoshi Ltd as an extension to MikoshiLang.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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
File details
Details for the file mikoshi_bio-0.2.0.tar.gz.
File metadata
- Download URL: mikoshi_bio-0.2.0.tar.gz
- Upload date:
- Size: 14.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d47d0d6d314389046e7745b011b5555d661fdf18ce5f9596f055aa448a955cf6
|
|
| MD5 |
38fcb513eb341d761ebab58e1d20d67d
|
|
| BLAKE2b-256 |
cf9d5e70dd09cfc560379e936c8bed6f2562d3fd330c9d6b29ad07809fb4b16f
|
File details
Details for the file mikoshi_bio-0.2.0-py3-none-any.whl.
File metadata
- Download URL: mikoshi_bio-0.2.0-py3-none-any.whl
- Upload date:
- Size: 14.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b03c9b282a5de9c72f9c1aae9db5ed5b25efa4d76cc7f0f213ba9d55e47ffe14
|
|
| MD5 |
744b21a14d53ac8f48b792e12d798528
|
|
| BLAKE2b-256 |
37393987b1a17d00d6b6cce323e38d97c643f9f256a4f3d1e86a6363824ca1e0
|