Skip to main content

Python interface to LinearPartition, a linear-time RNA secondary structure prediction tool

Project description

python-linearpartition

Unofficial CPython binding to LinearPartition

Installation

Use pip to install the module.

pip install linearpartition-unofficial

You may build from the source code for unsupported Python versions or platforms.

git clone --recursive https://github.com/ChangLabSNU/python-linearpartition
cd python-linearpartition
pip install .

Usage

The module currently only has one function called partition(seq). The seq parameter should be an RNA sequence in uppercase letters, and any T should be converted to U before passing it to the function.

>>> import linearpartition as lp
>>> seq = 'UGUCGGGGUUGGCUGUCUGACA'
>>> bpmtx, fe = lp.partition(seq)
>>> fe
-7.216465644007023
>>> import pandas as pd
>>> pd.DataFrame(bpmtx).sort_values('prob', ascending=False).head()
    i   j      prob
19  3  18  0.999201
18  2  19  0.998801
17  1  20  0.997717
21  5  16  0.996692
22  4  17  0.996508

Functions

linearpartition.partition()

The linearpartition.partition function is a Python C extension function that calls LinearPartition to perform a linear partitioning operation and get the base pairing probability matrix.

linearpartition.partition(seq, mode='eterna', beamsize=100, dangles=2)
Parameters
  • seq (required): A string containing the RNA sequence to be analyzed. The sequence must be in uppercase and only contain A, C, G, and U. This parameter is required.
  • mode (optional): The name of free energy parameters to use. Use 'vienna' for Vienna RNA parameters, or 'eterna' for EternaFold parameters.
  • beamsize (optional): An integer representing the beam size for the operation. Larger value requires more computational time and memory. The default value is 100.
  • dangles (optional): An integer representing the number of dangles for the partitioning operation. The default value is 2.
Return Value

This function returns a tuple containing the result of the partitioning operation and the free energy of the ensemble structure in kcal/mol.

Author

Hyeshik Chang <hyeshik@snu.ac.kr>

License

This Python binding is licensed under the MIT-style license. However, the compiled binary includes code from the LinearPartition package, which is licensed for non-commercial use.

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

linearpartition-unofficial-0.2.tar.gz (7.8 kB view hashes)

Uploaded Source

Built Distributions

linearpartition_unofficial-0.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (805.1 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.27+ x86-64 manylinux: glibc 2.28+ x86-64

linearpartition_unofficial-0.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (804.9 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.27+ x86-64 manylinux: glibc 2.28+ x86-64

linearpartition_unofficial-0.2-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (804.1 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.27+ x86-64 manylinux: glibc 2.28+ x86-64

linearpartition_unofficial-0.2-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (803.9 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.27+ x86-64 manylinux: glibc 2.28+ x86-64

linearpartition_unofficial-0.2-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (804.3 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.27+ x86-64 manylinux: glibc 2.28+ x86-64

linearpartition_unofficial-0.2-cp37-cp37m-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (805.0 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.27+ x86-64 manylinux: glibc 2.28+ x86-64

linearpartition_unofficial-0.2-cp36-cp36m-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (803.7 kB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.27+ x86-64 manylinux: glibc 2.28+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page