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
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
Hashes for linearpartition-unofficial-0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72089742a419d6505d26fb8f9b780721d1c0fa8851d775dc44b149ddd9b824f0 |
|
MD5 | 7a25394fbf792f07ecec1336eb0776aa |
|
BLAKE2b-256 | 074e7c13033b54583774643a9546f29e1bbbc5a9ac05695b0a722ac5cd24a852 |
Hashes for linearpartition_unofficial-0.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44a1649ae9b41e6441d1758cfe7f65541e402d826414fdde3fcf7b911b4b14c9 |
|
MD5 | 2a32e14b1c3b2928074c94b4b515f5aa |
|
BLAKE2b-256 | 7fdfeefe38f1ae17fa7bb9cbcffab5ce2d3635809abe33f930869dc894773336 |
Hashes for linearpartition_unofficial-0.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aef2012cceca9e7a27eae70c92bf6dd44b6c14c5dffdaafc22afeb01020e3fda |
|
MD5 | ac636e0cc8e1c15ac059831895f4cff5 |
|
BLAKE2b-256 | 000040b5506f4a8abd998ce0543ee63ad5baccb19ab4f31644c7b08bb314af1a |
Hashes for linearpartition_unofficial-0.2-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 40f93343cfd93297c5c94cf19c7a5c8b08c4a3e5521e35d887135f8eeb59a9ca |
|
MD5 | e01ffb4631fe0aa15f04f366a42be26e |
|
BLAKE2b-256 | d48cb4c9836ad9ffb1badfdd4d34cb3b04b04982509bcf6bf34ede78c9eeef22 |
Hashes for linearpartition_unofficial-0.2-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64d22519aa6ca7634800ec1fafeae58a82f6711bcc8300e20321339e55987b7a |
|
MD5 | 2796732b1427ab4d66ec999c889fa983 |
|
BLAKE2b-256 | 4aa3f25d82fb897678bb8a0b6dbc59bdcc595327413172df5bb4b72ce65f2426 |
Hashes for linearpartition_unofficial-0.2-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d30f34a31bfc2f869d97a102ec95ff86b5a0bde0a754a045bf96055cd961ef58 |
|
MD5 | eecb65045b9054cbc76ab2f1cdb6fce3 |
|
BLAKE2b-256 | 1bced042f2aec8c88d0fa1de7db20bfe3cd3d7b081bb6387559b271e46ded3e7 |
Hashes for linearpartition_unofficial-0.2-cp37-cp37m-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b3f99fada10d48271e6061348d43981366886383fc1950fb02f8126aae67ead |
|
MD5 | 5f7b8b4138a1390b1fadc9f64485ec43 |
|
BLAKE2b-256 | 13388689af0d2f6782c4ddc0001de890256f0ac1ec670c39cd6a49cc9e161372 |
Hashes for linearpartition_unofficial-0.2-cp36-cp36m-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e364ad2349224f9d47bbf22411aa562bd1dd408a8a8c3b29c017833222c870f1 |
|
MD5 | 503a4829fb790b6e210498b748ec0180 |
|
BLAKE2b-256 | 3790dd53e0af1b92c6a26f38514b2b5a7d22fd3548389a738db456027b10b3d2 |