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'
>>> pred = lp.partition(seq)
>>> pred['free_energy']
-7.216465644007023
>>> pred['structure']
'(((((((........)))))))'
>>> import pandas as pd
>>> pd.DataFrame(pred['bpp']).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 dictionary containing the MEA structure, base-pairing probability matrix and free energy of the ensemble structure in kcal/mol from the result of the partitioning operation.
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
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 Distributions
File details
Details for the file linearpartition-unofficial-0.3.tar.gz
.
File metadata
- Download URL: linearpartition-unofficial-0.3.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03c579e6a1bc16e67dc588237a9a54f5f4c0fe2b69086dff17fde8ae555ea59c |
|
MD5 | 67d97daf5065c8a2d4bcd84c16ed9b7b |
|
BLAKE2b-256 | a5c025268493b65aa628d428b1429f7032da3a11513ee434c5b4b0457688ab66 |
File details
Details for the file linearpartition_unofficial-0.3-pp310-pypy310_pp73-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: linearpartition_unofficial-0.3-pp310-pypy310_pp73-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 101.2 kB
- Tags: PyPy, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e0cb1563a9beb03bb2cad764e0c8751bdcebde22fe3ab96a24aa23a2c35729a |
|
MD5 | 1ae3f9172017d110271997e1a262b4a4 |
|
BLAKE2b-256 | ab15dca97d2c61b520d30bda4fb69c2bf2a69a6d7a58e1b867730b2240ef8310 |
File details
Details for the file linearpartition_unofficial-0.3-pp39-pypy39_pp73-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: linearpartition_unofficial-0.3-pp39-pypy39_pp73-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 101.1 kB
- Tags: PyPy, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3048a93c134356ff693f716afeff94f4bca273acf688f533d2fac47b68f24986 |
|
MD5 | 77776aa805aa8d71536e28e752a98811 |
|
BLAKE2b-256 | 8052415cb3b7d55e4e18bb5cffd3f69f2c8a589b27383f8c260f2d84a0c48420 |
File details
Details for the file linearpartition_unofficial-0.3-pp38-pypy38_pp73-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: linearpartition_unofficial-0.3-pp38-pypy38_pp73-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 101.3 kB
- Tags: PyPy, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 245cf364c0ae2804a85ceba82b416350f06feb2d789fbf7d66e732e12ffc6cf6 |
|
MD5 | e2b573029784b2718fa6e892a554abb2 |
|
BLAKE2b-256 | 36d69d3c074a5613b5966cd094d6a895c5eef166ee3fef2e41991e2bc4ac2616 |
File details
Details for the file linearpartition_unofficial-0.3-pp37-pypy37_pp73-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: linearpartition_unofficial-0.3-pp37-pypy37_pp73-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 102.4 kB
- Tags: PyPy, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b0166c41a2c4d09c118ddf659dd91a8b0b2b6f9784a55bf5be8c7b7b25f8446d |
|
MD5 | 8bcef59a9458c60216ff37225db88b3b |
|
BLAKE2b-256 | 2e106f0768ac081cb5f6e6d4622695ee10b6baa78ff08215b7acb6273b37abe6 |
File details
Details for the file linearpartition_unofficial-0.3-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: linearpartition_unofficial-0.3-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 851.1 kB
- Tags: CPython 3.12, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f1fb9f839a05200c6c6547df454ae1a6fe5a5b8051d74b793bce4f9a78305ca |
|
MD5 | 9e77c11557d6a8df4dd15981667c1385 |
|
BLAKE2b-256 | 59ee9def4c281d6d331b12ff47965084e814337deaeab7aeddd5782e422b513d |
File details
Details for the file linearpartition_unofficial-0.3-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: linearpartition_unofficial-0.3-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 850.9 kB
- Tags: CPython 3.11, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1097497a9facf6080360a6fc82de8fefd91e2da681b681f4b28698798c888105 |
|
MD5 | 37612813d910c762392bf4eee7bac279 |
|
BLAKE2b-256 | c6bc5a462d0a9bcf820f232c8efbf9eb2522560896730fa6c35c82bede38d8c0 |
File details
Details for the file linearpartition_unofficial-0.3-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: linearpartition_unofficial-0.3-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 850.1 kB
- Tags: CPython 3.10, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa2a4e1b3bc2456670a9b9d5ee8e6dfc95fbfd55e6ef509f58436d226a834efc |
|
MD5 | 3039ad50474a7768203e57d3bb795d74 |
|
BLAKE2b-256 | 296fc97c2c2dbbed2e6e7ae6b71ab4d601621e95987afc263fb786d67cbff3ff |
File details
Details for the file linearpartition_unofficial-0.3-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: linearpartition_unofficial-0.3-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 849.9 kB
- Tags: CPython 3.9, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f8c9db4406db083b201c2af5458a0893c997ac0b48b035f91a4f99472f43966 |
|
MD5 | f31038b7c1510fd5bc7d4670228243ab |
|
BLAKE2b-256 | 33b67c237979bda22529e40aa74b86a2f0cf3aced25b35856b9333a4d885d43b |
File details
Details for the file linearpartition_unofficial-0.3-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: linearpartition_unofficial-0.3-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 851.2 kB
- Tags: CPython 3.8, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a15048ebf17b1095c6abecf7b5ae9cdbf6a3780759b32eed362c2d5d92185b83 |
|
MD5 | 3b832c8627efffd43641ef42a9197447 |
|
BLAKE2b-256 | 96d7890ac0ae9951e9312c1b9b60067f4ec6cd18e67fd7534ec2f6d4e7b3bfc4 |
File details
Details for the file linearpartition_unofficial-0.3-cp37-cp37m-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: linearpartition_unofficial-0.3-cp37-cp37m-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 849.4 kB
- Tags: CPython 3.7m, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11a83bfb85c8b3dab06c67021f736b488e5e929091d5ea7df4082093edd44c54 |
|
MD5 | 2d0155ad72ae148d1f2bc2bf437482b8 |
|
BLAKE2b-256 | 94f8331f4782681a22eeb75601a2146bdcc002223e715c6673b8d222e36a19f0 |
File details
Details for the file linearpartition_unofficial-0.3-cp36-cp36m-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: linearpartition_unofficial-0.3-cp36-cp36m-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 847.9 kB
- Tags: CPython 3.6m, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e87e86e3835c511b3b41c9d90c287f69783d04d57efc8d43f8a5f1f5eafa6e6 |
|
MD5 | 93edcdf79dd0d18fae6b6a4e71a69676 |
|
BLAKE2b-256 | 4511ddaead668c006e3fb8dae13e9e8b0a1a62d6776923afb636aa3c71ffd2d7 |