Giter Club home page Giter Club logo

python-linearpartition's Introduction

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 <[email protected]>

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.

python-linearpartition's People

Contributors

cauch-bs avatar hyeshik avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.