HFold: Python bindings for the HFold C++ library
Project description
How to test the hfold python package
1. Make sure you have ViennaRNA installed on your system
ViennaRNA package installation
The hfold package requires ViennaRNA to be installed before compilation.
-
Download the ViennaRNA package: ViennaRNA-2.7.1.tar.gz
-
Install the Package:
tar -zxvf ViennaRNA-2.7.1.tar.gz
cd ViennaRNA-2.7.1
./configure --without-perl
sudo make -j$(nproc) # Linux
sudo make -j$(sysctl -n hw.ncpu) # macOS
sudo make install
More info: ViennaRNA GitHub
2. Setup a Virtual Environment
Make sure you're in a virtual environment
python3 -m venv venv
source venv/bin/activate
3. Install Python Dependencies
Make sure you have pybind11 and setuptools installed
sudo apt install pybind11-dev # linux
brew install pybind11 # MacOS
python3 -m pip install pybind11 setuptools scikit-build
4. Build the Python Extension
From the project root:
pip install -v -e ./pylib/
5. Start Python
python3
6. Run Test Commands
Once in the Python shell, you can test hfold:
import hfold
# Basic sequence folding
hfold.hfold("AGGGCUAUCCUU", param_file="../params/rna_DirksPierce09.par")[0][0]
# Folding with suboptimal structures
hfold.hfold("AGGGCUAUCCUU", subopt=5, param_file="../params/rna_DirksPierce09.par")[0]
# Folding sequences from file
hfold.hfold(subopt=2, fileI="./sample_inputs/sample.txt", param_file="../params/rna_DirksPierce09.par")
Full List of Parameters
| Parameter | Type | Description |
|---|---|---|
sequence |
str | RNA sequence |
restriction |
str | Folding constraint |
pk_free |
bool | Exclude pseudoknots |
pk_only |
bool | Only allow pseudoknots |
dangles |
int | Dangle configuration |
subopt |
int | Number of suboptimal structures |
fileI |
str | Input file path |
fileO |
str | Output file path |
param_file |
str | Thermodynamic parameters file |
noConv_given |
bool | Do not convert DNA into RNA |
suppress_output |
bool | Suppress console output |
Build wheels
python -m pip install --upgrade cibuildwheel scikit-build-core twine pybind11 setuptools # install pre-req
cibuildwheel pylib --output-dir dist # build
python -m twine upload dist/* # upload
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 Distributions
Built Distributions
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 hfold-0.0.5-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: hfold-0.0.5-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 3.3 MB
- Tags: CPython 3.14t, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d960e116fbdbaf2284d438fd70705cdc17d47e46a4226b58c3a0d67e6f60355e
|
|
| MD5 |
dc8bcead21cda0d13088f59d38731ef6
|
|
| BLAKE2b-256 |
56a76af9d79a008519950dc6e5d2a681dbab8413b0b81e57c25379cd7fcc1dd4
|
Provenance
The following attestation bundles were made for hfold-0.0.5-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:
Publisher:
python-publish.yml on TheCOBRALab/HFold
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hfold-0.0.5-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
d960e116fbdbaf2284d438fd70705cdc17d47e46a4226b58c3a0d67e6f60355e - Sigstore transparency entry: 1770525962
- Sigstore integration time:
-
Permalink:
TheCOBRALab/HFold@62716542d8a1f2b8679251ef93047a156e545172 -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/TheCOBRALab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@62716542d8a1f2b8679251ef93047a156e545172 -
Trigger Event:
release
-
Statement type:
File details
Details for the file hfold-0.0.5-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: hfold-0.0.5-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 2.9 MB
- Tags: CPython 3.14, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4fb7fa95c966d45a8bce567901ac517c57cd399b5e541727001db05bfeb51026
|
|
| MD5 |
f9b97067aa7e79cb7ecbb9c63c706cac
|
|
| BLAKE2b-256 |
59cc5c4f905877d8f46fe2be6b72fbbb3c7962952e5b2f050c4e925754629d12
|
Provenance
The following attestation bundles were made for hfold-0.0.5-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:
Publisher:
python-publish.yml on TheCOBRALab/HFold
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hfold-0.0.5-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
4fb7fa95c966d45a8bce567901ac517c57cd399b5e541727001db05bfeb51026 - Sigstore transparency entry: 1770525357
- Sigstore integration time:
-
Permalink:
TheCOBRALab/HFold@62716542d8a1f2b8679251ef93047a156e545172 -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/TheCOBRALab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@62716542d8a1f2b8679251ef93047a156e545172 -
Trigger Event:
release
-
Statement type:
File details
Details for the file hfold-0.0.5-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: hfold-0.0.5-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 2.4 MB
- Tags: CPython 3.13, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
75ebcbf205098704735e9c2a15940980cd198c5d08d1f11387c9eb21690314ef
|
|
| MD5 |
96ba94e5763ee628153e733b23fb00b4
|
|
| BLAKE2b-256 |
753932dcae4e4d4421d611b16510e8461f415294aeec3c50c4cb56a1468a783d
|
Provenance
The following attestation bundles were made for hfold-0.0.5-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:
Publisher:
python-publish.yml on TheCOBRALab/HFold
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hfold-0.0.5-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
75ebcbf205098704735e9c2a15940980cd198c5d08d1f11387c9eb21690314ef - Sigstore transparency entry: 1770525821
- Sigstore integration time:
-
Permalink:
TheCOBRALab/HFold@62716542d8a1f2b8679251ef93047a156e545172 -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/TheCOBRALab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@62716542d8a1f2b8679251ef93047a156e545172 -
Trigger Event:
release
-
Statement type:
File details
Details for the file hfold-0.0.5-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: hfold-0.0.5-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 2.0 MB
- Tags: CPython 3.12, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
77a44089fd22ba7e2ffed19ad7358fe7033cedae4dc37725ab2c25fd50fb4210
|
|
| MD5 |
40a745abaadf9c542aae188bd79a7e4e
|
|
| BLAKE2b-256 |
1d92829878ebf640b412ab3ee1108e6d50de62ab5782a3bbd8da2679bf9f0232
|
Provenance
The following attestation bundles were made for hfold-0.0.5-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:
Publisher:
python-publish.yml on TheCOBRALab/HFold
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hfold-0.0.5-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
77a44089fd22ba7e2ffed19ad7358fe7033cedae4dc37725ab2c25fd50fb4210 - Sigstore transparency entry: 1770525452
- Sigstore integration time:
-
Permalink:
TheCOBRALab/HFold@62716542d8a1f2b8679251ef93047a156e545172 -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/TheCOBRALab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@62716542d8a1f2b8679251ef93047a156e545172 -
Trigger Event:
release
-
Statement type:
File details
Details for the file hfold-0.0.5-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: hfold-0.0.5-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 1.5 MB
- Tags: CPython 3.11, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
991c2e381d22e4be73eff3bdb989844b76444bdf2d275e4e5b1c1d1e983e5d72
|
|
| MD5 |
39ea3e6ae511ee6f061e7e712ec3b3ec
|
|
| BLAKE2b-256 |
17ef5ba6128ad4d174a684b81e4133b33966b9575ba5aa963c6c000e25e850e9
|
Provenance
The following attestation bundles were made for hfold-0.0.5-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:
Publisher:
python-publish.yml on TheCOBRALab/HFold
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hfold-0.0.5-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
991c2e381d22e4be73eff3bdb989844b76444bdf2d275e4e5b1c1d1e983e5d72 - Sigstore transparency entry: 1770525546
- Sigstore integration time:
-
Permalink:
TheCOBRALab/HFold@62716542d8a1f2b8679251ef93047a156e545172 -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/TheCOBRALab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@62716542d8a1f2b8679251ef93047a156e545172 -
Trigger Event:
release
-
Statement type:
File details
Details for the file hfold-0.0.5-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: hfold-0.0.5-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.10, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9f5f5a47b89c5cc81e319f1f2dfeaa8f79dbc15af8622bc96c0339d18d381b87
|
|
| MD5 |
293dfd1f23051e5e0bdd3465301293ba
|
|
| BLAKE2b-256 |
e519df9d66b562b6ac06ab5e3a180efc5132506c2bde095b5e3ac2c9fa3fe0cb
|
Provenance
The following attestation bundles were made for hfold-0.0.5-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:
Publisher:
python-publish.yml on TheCOBRALab/HFold
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hfold-0.0.5-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
9f5f5a47b89c5cc81e319f1f2dfeaa8f79dbc15af8622bc96c0339d18d381b87 - Sigstore transparency entry: 1770525259
- Sigstore integration time:
-
Permalink:
TheCOBRALab/HFold@62716542d8a1f2b8679251ef93047a156e545172 -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/TheCOBRALab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@62716542d8a1f2b8679251ef93047a156e545172 -
Trigger Event:
release
-
Statement type:
File details
Details for the file hfold-0.0.5-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: hfold-0.0.5-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 627.4 kB
- Tags: CPython 3.9, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7980bb0cf25d2a8dd75e13bc3edc694537e136b0b5f2a25d71e59dedf52c39f2
|
|
| MD5 |
dbd4931a27febcf541510563d920afad
|
|
| BLAKE2b-256 |
94a6b8863d8208ce26802df23dcab48397b9fde33df2e2aa549680595e59f763
|
Provenance
The following attestation bundles were made for hfold-0.0.5-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:
Publisher:
python-publish.yml on TheCOBRALab/HFold
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hfold-0.0.5-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
7980bb0cf25d2a8dd75e13bc3edc694537e136b0b5f2a25d71e59dedf52c39f2 - Sigstore transparency entry: 1770525700
- Sigstore integration time:
-
Permalink:
TheCOBRALab/HFold@62716542d8a1f2b8679251ef93047a156e545172 -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/TheCOBRALab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@62716542d8a1f2b8679251ef93047a156e545172 -
Trigger Event:
release
-
Statement type: