Skip to main content

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.

  1. Download the ViennaRNA package: ViennaRNA-2.7.0.tar.gz

  2. Install the Package:

tar -zxvf ViennaRNA-2.7.0.tar.gz
cd ViennaRNA-2.7.0
./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:

cd ./pylib
python3 setup.py build_ext --inplace

5. Start Python (From the pylib Directory)

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

hfold-0.0.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

hfold-0.0.3-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl (1.2 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ i686

hfold-0.0.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

hfold-0.0.3-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl (1.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ i686

hfold-0.0.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

hfold-0.0.3-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl (1.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ i686

hfold-0.0.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

hfold-0.0.3-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl (1.2 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ i686

hfold-0.0.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

hfold-0.0.3-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl (1.2 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ i686

hfold-0.0.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

hfold-0.0.3-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl (1.2 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ i686

File details

Details for the file hfold-0.0.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for hfold-0.0.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 32be790650f967b2c8ff255aadd08ed23cc8e9e61da79047dbfb27152f8118f5
MD5 bacb836902f8835daaaa54752dfddf37
BLAKE2b-256 621e282bccd827329a05b889e5e1822f24302b6f9017e152774ed1153ab63149

See more details on using hashes here.

File details

Details for the file hfold-0.0.3-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for hfold-0.0.3-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 84127f05f281fe538b2bbfa14d848174daf63f6f953124ab21b6d9c1883dd5fd
MD5 5fbfb0d8f3f3a6d82709ad103ee085f4
BLAKE2b-256 cae82d6a936f30b8371d8d26b23551318909236c7e6d412be36a2726c543c2ce

See more details on using hashes here.

File details

Details for the file hfold-0.0.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for hfold-0.0.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8496f4529f677e080b8eddbf8b952b30869541ab48c3bf3f2ce59e16c51ff223
MD5 39ba9d4a6714a50de33766ca4d2ef398
BLAKE2b-256 50eff3011c89480d463cc3a980f6fcb018902997903019d757042d8f8f2eec13

See more details on using hashes here.

File details

Details for the file hfold-0.0.3-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for hfold-0.0.3-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 34b7b5e348a95080f73849042c1359990cfbdf3b29928f9132fd4010f767a086
MD5 34e52b8e07b121e58087d15364d80125
BLAKE2b-256 73d97085c2fe4dff5e233711f587ee30bfc2e49add5ac1b124c6684570690a7e

See more details on using hashes here.

File details

Details for the file hfold-0.0.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for hfold-0.0.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f248fe8764c4517c9c3bb237368e1af59ee563a6950fd1987168d5ed59ff03fe
MD5 3e38b629cbffaead199d2670cf2050c9
BLAKE2b-256 ef086dc99feed96d6ea4b0efec9e90b440569b40b8ef20e065e5a66f78a8c966

See more details on using hashes here.

File details

Details for the file hfold-0.0.3-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for hfold-0.0.3-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 3fdd1fc02c91553f21bbbc5d570f4a80854266831968fe74897a27a2c258763d
MD5 6813ee274b1483107a391e83e718c87d
BLAKE2b-256 acf725ed9bda37f05258436bf2b07e367edc63ee8e74cc177309b8008c7486f1

See more details on using hashes here.

File details

Details for the file hfold-0.0.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for hfold-0.0.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 90a3f7aea22250f2f2df0a78c43ee2e7edd924b25d601426288f9c7858f9472e
MD5 fea8c79a3975d3e1426406321e260053
BLAKE2b-256 fb025f46230f4ebce5fe46ce507ac5a5d9ec53d1723c76fd93c8689d2357fa1f

See more details on using hashes here.

File details

Details for the file hfold-0.0.3-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for hfold-0.0.3-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 4fd81c01fbf422cbd7363f084138e3dbee70f2c58e7a8e3d57ff1d76a6a200f2
MD5 62d481a2ee634b71352f9462272c93d8
BLAKE2b-256 78a2892c1b50490cd1b5fe27476494e48e9662ebbce73f4cb5030563b0989fe7

See more details on using hashes here.

File details

Details for the file hfold-0.0.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for hfold-0.0.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 269fd5b35b1064018a9d7561a92c2a91ad231b582518ec1b52f140762dc08ddc
MD5 86b998ebbe8068e662969e7cf78960ba
BLAKE2b-256 2656254a4eb688ab722e6057bba5f670eb075a5f4ffaa8bfd42d142655cfeba0

See more details on using hashes here.

File details

Details for the file hfold-0.0.3-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for hfold-0.0.3-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 10b7a8eb0281304137a09b9dc59d3a4c31cf9d9ea9766ef107a5a4b8dbb0d43a
MD5 446fc947f2fa12b48f9263731e0beaba
BLAKE2b-256 f05ffd0511ffbceb2996d72d44198efb581f32a0210f1489971631c086a09e37

See more details on using hashes here.

File details

Details for the file hfold-0.0.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for hfold-0.0.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 75e5f7dfd01077e012a1ad3fe6161a9c1c3fe391d1ba038015ce97baeb11a9a8
MD5 56aa83df0320f20bd1c08b29e2695fd9
BLAKE2b-256 4c3b9988ecd0294cbb43fc7b99c3329ddedbd0d6f0cb9e064b3c68ba3013d8c5

See more details on using hashes here.

File details

Details for the file hfold-0.0.3-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for hfold-0.0.3-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 4eba1617e9711aca685705601f77bfad05f3df6453d7b92f8ed9323b8351b9ec
MD5 c056310001db6d0567d5e1c6e754906b
BLAKE2b-256 091661aac562271e1caf6e337af70922e2420660424262969b6391e454b2cf98

See more details on using hashes here.

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