Automated Descriptor Engine for SNCI, SCDI, and 9D KNF
Project description
KNF-CORE: Automated Descriptor Engine
KNF-CORE is a specialized computational chemistry pipeline designed to automate the extraction of key molecular descriptors for KNF (Kinetic and Non-covalent Feature) analysis. It integrates powerful tools like xTB (Extended Tight-Binding) and Multiwfn (Multifunctional Wavefunction Analyzer) to generate a unique 9-dimensional vector representation of molecular interactions.
Features
- Automated Workflow: From a single input structure (XYZ, SDF, MOL, etc.) to a final descriptor vector with minimal user intervention.
- Robust Geometry Handling: Automatically detects and converts input formats, perceives molecular fragments, and handles single molecules, two-fragment complexes, and multi-fragment systems.
- xTB Integration: Performs semi-empirical quantum mechanical optimization (Geometry Optimization) and single-point energy calculations to derive electronic properties.
- Multiwfn Analysis: Automates Non-Covalent Interaction (NCI) analysis to capture weak interactions critical for binding affinity and stability.
- COSMO Solvation Model: Computes Sigma-Profile descriptors (SCDI) to account for solvation effects.
- Docker Support: Fully containerized environment for consistent execution across different platforms.
Branch Notes (Multiple-Molecules)
This branch includes explicit multi-fragment behavior:
1fragment:f1 = 0.0,f2 = 180.02fragments:f1= COM distance between fragments,f2= detected H-bond angle>2fragments:f1= average COM distance across all unique fragment pairsf2= fixed to180.0
This branch also includes an updated Docker workflow (Dockerfile, docker-compose.yml, and container entrypoint script).
Installation
Install from PyPI
pip install KNF
Prerequisites
- Python 3.8+
- xTB: Must be installed and accessible in your system PATH (
xtbcommand). - Multiwfn: Must be installed and accessible (
Multiwfncommand), or configured viasettings.ini. - OpenBabel: Required for file format conversions (
obabelcommand).
Install from Source
Clone the repository and install using pip:
git clone https://github.com/yourusername/KNF-CORE.git
cd KNF-CORE
pip install .
Docker Usage
A Dockerfile and docker-compose.yml are provided for a complete, pre-configured environment
with Python, xTB, OpenBabel, and Multiwfn.
-
Build the image:
docker build -t knf-core .
-
Run a KNF calculation:
docker run --rm -v $(pwd):/work -w /work knf-core input.sdf --charge 0 --force
-
Run with Docker Compose:
docker compose up --build
Edit
docker-compose.ymlcommand to target your input and options. -
Open a shell in the container (debugging):
docker run --rm -it -v $(pwd):/work -w /work knf-core bash
-
Verify toolchain inside container:
docker run --rm knf-core --help docker run --rm -it knf-core bash -lc "xtb --version && obabel -V && Multiwfn < /dev/null || true"
Usage
Command Line Interface (CLI)
The package provides a knf command for easy execution.
Basic Usage:
knf input_molecule.sdf
Options:
--charge <int>: Net charge of the system (default: 0).--spin <int>: Spin multiplicity (default: 1).--force: Force recalculation of existing steps.--clean: Clean up previous run directories before starting.--debug: Enable verbose debug logging.--processing <single|multi>: Queue mode for directory runs (default:single).--processes <single|multi>: Alias of--processing.--workers <int>: Number of worker threads when--processing multiis used.--output-dir <path>: Custom output root (default:Resultsnear input).--ram-per-job <MB>: RAM estimate used for auto worker selection.--refresh-autoconfig: Recompute one-time multi-mode config cache.
In multi mode, KNF-Core now auto-detects worker/thread settings and stores a one-time cache in:
.knf_autoconfig.json
This cache is machine-specific (CPU/RAM signature). KNF-Core reuses it automatically on future runs.
Example with Test File:
The repository includes a test file example.mol (diethyl sulfate) for verification.
knf example.mol --charge 0 --force
General Example:
knf drug_molecule.sdf --charge 1 --force
Python API
You can also use KNF-CORE within your own Python scripts:
from knf_core.pipeline import KNFPipeline
# Initialize the pipeline
pipeline = KNFPipeline(
input_file='test.sdf',
charge=0,
spin=1
)
# Run the analysis
pipeline.run()
Output
The pipeline generates a top-level Results folder. Each molecule/complex gets its own directory:
Results/<complex_file_stem>/
Each complex folder contains:
knf.json: The final 9D KNF vector and metadata.output.txt: Human-readable summary of the results.xtbopt.xyz: Optimized geometry.- Intermediate files from xTB and Multiwfn.
License
This project is licensed under the MIT License - see the LICENSE file for details.
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 knf-1.0.tar.gz.
File metadata
- Download URL: knf-1.0.tar.gz
- Upload date:
- Size: 25.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5fa89ee81523cdbb5890e354bf81f2ddad3e1de303f8e3b30659d12591e3439c
|
|
| MD5 |
a25f05badb2045267089d90fc1bc620f
|
|
| BLAKE2b-256 |
1566eb4caeb913b02efacac674b311e503cad0287b2817e6e24a6572ea5cb6ba
|
File details
Details for the file knf-1.0-py3-none-any.whl.
File metadata
- Download URL: knf-1.0-py3-none-any.whl
- Upload date:
- Size: 29.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
05ed43fe3e285d0e76cf8ca480d00985be534c6591c8af65162d4e7ed4fd8e86
|
|
| MD5 |
065879e74d4c11e5c8fe4313377c448a
|
|
| BLAKE2b-256 |
09fff94a1e569f3b12e1b72657a0168c6770624f26a42c62cdbd6aa1659c75f1
|