### RNA Get Method Examples Source: https://viennarna-python.readthedocs.io/en/stable/genindex Illustrates the usage of the `get()` method across different RNA classes, including `RNA.COORDINATE`, `RNA.SOLUTION`, and various `varArray` types. This method is used to retrieve data from these objects. ```python get() ``` -------------------------------- ### ViennaRNA Python API: COORDINATE Methods Source: https://viennarna-python.readthedocs.io/en/stable/RNA Provides documentation for the COORDINATE object in the ViennaRNA Python API. It lists attributes like X and Y, and methods such as get(). ```Python class COORDINATE: X: float Y: float def get(self) -> tuple[float, float] thisown: bool ``` -------------------------------- ### Access SOLUTION Properties in Python Source: https://viennarna-python.readthedocs.io/en/stable/RNA Allows access to the energy and structure properties of a SOLUTION object, along with methods to get and retrieve its size. The `thisown` attribute indicates ownership. ```Python SOLUTION.energy SOLUTION.get() SOLUTION.size() SOLUTION.structure SOLUTION.thisown ``` -------------------------------- ### RNA.fold_compound Strand Start Source: https://viennarna-python.readthedocs.io/en/stable/RNA Defines the starting position of each strand within the concatenated RNA sequence. ```python strand_start: list-like(unsigned int) ``` -------------------------------- ### Compute Path and Return Moves (Python) Source: https://viennarna-python.readthedocs.io/en/stable/RNA Computes a path between two structures, stores the final structure, and returns a list of transition moves from the start to the final structure. ```Python path(_fold_compound self_, _IntVector pt_, _unsigned int steps_, _unsigned int options=_) → MoveVector[source] ``` ```Python path(_fold_compound self_, _varArrayShort pt_, _unsigned int steps_, _unsigned int options=_) → MoveVector ``` -------------------------------- ### Accessing RNA Structure Properties (Python) Source: https://viennarna-python.readthedocs.io/en/stable/RNA Demonstrates accessing properties of an RNA structure object, such as length, start position, ownership, and upward traversal. ```Python hx.length hx.start hx.thisown hx.up3 hx.up5 ``` -------------------------------- ### Create a duplexT Object Source: https://viennarna-python.readthedocs.io/en/stable/RNA The `duplexT` class constructor initializes a data structure designed to hold information about RNA duplexes. It includes attributes for start and end indices, structure string, and energy values. ```Python _class _RNA.duplexT(_* args_, _** kwargs_) ``` -------------------------------- ### RNA Module: Accessing Loop Information Source: https://viennarna-python.readthedocs.io/en/stable/genindex Provides examples of accessing information about different types of RNA loops, specifically 'Tetraloops' and 'Triloops', from 'exp_param' and 'param' attributes. This is useful for analyzing loop stability and conformational preferences. ```Python import RNA # Accessing Tetraloop information tetraloops_exp = RNA.exp_param.Tetraloops tetraloops_param = RNA.param.Tetraloops # Accessing Triloop information triloops_exp = RNA.exp_param.Triloops triloops_param = RNA.param.Triloops # Example of iterating through loop data if it's a collection # for loop_data in tetraloops_exp: # print(loop_data) ``` -------------------------------- ### RNA Array and Pointer Operations Source: https://viennarna-python.readthedocs.io/en/stable/genindex Details functions for working with integer arrays and pointers, including `intArray_frompointer()` and methods for getting and setting items in an integer pointer array (`intP_getitem`, `intP_setitem`). ```python import RNA # Example for intArray_frompointer # Assuming 'ptr' is a valid pointer to an integer array # int_array = RNA.intArray_frompointer(ptr) # Example for intP_getitem and intP_setitem # Assuming 'int_ptr' is a valid pointer to an integer array # value = RNA.intP_getitem(int_ptr, index) # RNA.intP_setitem(int_ptr, index, value) ``` -------------------------------- ### RNA Utility Functions Source: https://viennarna-python.readthedocs.io/en/stable/RNA Contains various utility functions for RNA processing, including getting items from short arrays and setting item values. ```Python urn() ushortP_getitem() ushortP_setitem() ``` -------------------------------- ### RNA Loop and Stack Initialization Source: https://viennarna-python.readthedocs.io/en/stable/RNA Includes functions for initializing different types of RNA loops and stacks, such as 'salt_duplex_init', 'salt_loop', 'salt_loop_int', 'salt_ml', and 'salt_stack'. These are fundamental for thermodynamic calculations. ```Python salt_duplex_init() salt_loop() salt_loop_int() salt_ml() salt_stack() ``` -------------------------------- ### Python: Boltzmann Sampling with pbacktrack_sub Source: https://viennarna-python.readthedocs.io/en/stable/RNA Samples a secondary structure using Boltzmann probabilities. Requires unique multiloop decomposition to be active and the partition function matrices to be filled by calling RNA.fold_compound.pf() first. It takes start and end positions as input and returns a secondary structure in dot-bracket notation. ```Python RNA.fold_compound.pbacktrack_sub(start, end) ``` -------------------------------- ### RNA Log Options Get Source: https://viennarna-python.readthedocs.io/en/stable/RNA Retrieves the current log options for the default logging system. These options control aspects like quiet mode or trace timers. ```python RNA.log_options() ``` -------------------------------- ### Initialize RNA.md with Default Settings Source: https://viennarna-python.readthedocs.io/en/stable/RNA Demonstrates how to initialize the RNA.md data structure with default thermodynamic and folding parameters. This is the primary way to obtain a set of default settings for calculations. ```Python import RNA # Initialize with default settings md = RNA.md() # The 'md' object now holds default model details and has associated methods. ``` -------------------------------- ### Variable Array Short Get Source: https://viennarna-python.readthedocs.io/en/stable/RNA Retrieves an element from a variable short array. ```python _RNA.varArrayShort(_* args_).get(_i_) ``` -------------------------------- ### Variable Array Move Get Source: https://viennarna-python.readthedocs.io/en/stable/RNA Retrieves an element from a variable move array. ```python _RNA.varArrayMove(_d_ , _type_).get(_i_) ``` -------------------------------- ### Logging and Utility Functions (Python) Source: https://viennarna-python.readthedocs.io/en/stable/RNA Lists functions for managing logging levels, callbacks, and other utility operations within the package. ```Python log_cb_add() log_cb_add_pycallback() log_cb_num() log_fp() log_fp_set() log_level() log_level_set() log_options() log_options_set() log_reset() ``` -------------------------------- ### RNA.md Methods for Model Management Source: https://viennarna-python.readthedocs.io/en/stable/RNA Illustrates the methods available on the RNA.md object for managing and updating model details. These include resetting to defaults, setting from global parameters, and generating option strings. ```Python import RNA md = RNA.md() # Reset to default parameters md.reset() # Set model details from global variables (if applicable) # RNA.set_model_details(md) # Get an option string representing the current model details # option_str = md.option_string() # print(option_str) # Update model details (example: changing temperature) # md.temperature = 310.0 # Set to body temperature # RNA.md_update(md) # Update internal structures if necessary ``` -------------------------------- ### Variable Array Int Get Source: https://viennarna-python.readthedocs.io/en/stable/RNA Retrieves an element from a variable integer array. ```python _RNA.varArrayInt(_d_ , _type_).get(_i_) ``` -------------------------------- ### Variable Array Char Get Source: https://viennarna-python.readthedocs.io/en/stable/RNA Retrieves an element from a variable character array. ```python _RNA.varArrayChar(_d_ , _type_).get(_i_) ``` -------------------------------- ### Generate Random Walk Path (Python/C++) Source: https://viennarna-python.readthedocs.io/en/stable/RNA Generates a random walk path of a specified length from a starting RNA structure. It updates the structure to the final state of the walk and can return the sequence of moves. Options can modify its behavior. ```Python path_random(_fold_compound self_, _IntVector pt_, _unsigned int steps_, _unsigned int options=_) → MoveVector[source] path_random(_fold_compound self_, _varArrayShort pt_, _unsigned int steps_, _unsigned int options=_) → MoveVector ``` -------------------------------- ### Variable Array Iterator Next Source: https://viennarna-python.readthedocs.io/en/stable/RNA Gets the next element from a variable array iterator. ```python _RNA.var_array_Iterator(_var_arr_).next() ``` -------------------------------- ### ViennaRNA Python API: Energy Models Source: https://viennarna-python.readthedocs.io/en/stable/RNA Lists various energy models available in the ViennaRNA Python API, including E_ExtLoop, E_GQuad_IntLoop_L, E_GQuad_IntLoop_L_comparative, E_Hairpin, E_IntLoop, E_IntLoop_Co, E_MLstem, E_Stem, and E_gquad. ```Python E_ExtLoop() E_GQuad_IntLoop_L() E_GQuad_IntLoop_L_comparative() E_Hairpin() E_IntLoop() E_IntLoop_Co() E_MLstem() E_Stem() E_gquad() ``` -------------------------------- ### RNA Initialization and Folding Functions Source: https://viennarna-python.readthedocs.io/en/stable/genindex Lists functions for initializing RNA folding processes, including partition function calculations for circular and linear structures, and random initialization. ```python import RNA RNA.init_pf_circ_fold() RNA.init_pf_fold() RNA.init_rand() RNA.initialize_cofold() ``` -------------------------------- ### Variable Array UInt Get Source: https://viennarna-python.readthedocs.io/en/stable/RNA Retrieves an element from a variable unsigned int array. ```python _RNA.varArrayUInt(_d_ , _type_).get(_i_) ``` -------------------------------- ### Variable Array UChar Get Source: https://viennarna-python.readthedocs.io/en/stable/RNA Retrieves an element from a variable unsigned char array. ```python _RNA.varArrayUChar(_d_ , _type_).get(_i_) ``` -------------------------------- ### Prepare Probing Data (Deigan 2009) Source: https://viennarna-python.readthedocs.io/en/stable/RNA Prepares a data structure for the Deigan et al. 2009 method using probing data. This function can be used directly or as a constructor for the `probing_data` object. It takes reactivities, slope (m), and intercept (b) as parameters to convert probing data into pseudo-energies for RNA folding. ```Python RNA.probing_data_Deigan2009(reactivities, m, b) # or as a constructor: RNA.probing_data(reactivities, m, b) ``` -------------------------------- ### RNA.fold_compound: Fold Compound Initialization Source: https://viennarna-python.readthedocs.io/en/stable/RNA Represents the core data structure for RNA folding computations. It can be initialized with a single sequence, concatenated sequences for cofolding, or a sequence alignment. It provides methods to get the type and length of the stored sequence data. ```Python _class _RNA.fold_compound(_fold_compound self_, _char const * sequence_, _md md=None_, _unsigned int options=_) ``` ```Python _class _RNA.fold_compound(_fold_compound self_, _StringVector alignment_, _md md=None_, _unsigned int options=_) ``` ```Python _class _RNA.fold_compound(_fold_compound self_, _char const * sequence_, _char * s1_, _char * s2_, _md md=None_, _unsigned int options=_) ``` -------------------------------- ### Variable Array Float/Double Get Source: https://viennarna-python.readthedocs.io/en/stable/RNA Retrieves an element from a variable float or double array. ```python _RNA.varArrayFLTorDBL(_d_ , _type_).get(_i_) ``` -------------------------------- ### RNA Module: Global Settings Source: https://viennarna-python.readthedocs.io/en/stable/genindex This snippet demonstrates how to set parameters from global variables within the RNA module. ```python RNA.md.set_from_globals() ``` -------------------------------- ### Variable Array Access (Python) Source: https://viennarna-python.readthedocs.io/en/stable/RNA Provides methods to access and query properties of various variable-sized arrays (char, double, int, etc.) within the ViennaRNA package. Includes getting elements, size, ownership, and type information. ```Python varArrayChar.get() varArrayChar.size() varArrayChar.thisown varArrayChar.type() varArrayFLTorDBL.get() varArrayFLTorDBL.size() varArrayFLTorDBL.thisown varArrayFLTorDBL.type() varArrayInt.get() varArrayInt.size() varArrayInt.thisown varArrayInt.type() varArrayMove.get() varArrayMove.size() varArrayMove.thisown varArrayMove.type() varArrayShort.get() varArrayShort.size() varArrayShort.thisown varArrayShort.type() varArrayUChar.get() varArrayUChar.size() varArrayUChar.thisown varArrayUChar.type() varArrayUInt.get() varArrayUInt.size() varArrayUInt.thisown varArrayUInt.type() ``` -------------------------------- ### RNA plot options puzzler constructor Source: https://viennarna-python.readthedocs.io/en/stable/RNA Constructor for the RNA.plot_options_puzzler class, initializing options for the RNApuzzler algorithm. It allows setting various parameters related to structure visualization and optimization. ```Python RNA.plot_options_puzzler() ``` -------------------------------- ### Get Item from UShort Array Source: https://viennarna-python.readthedocs.io/en/stable/RNA Retrieves an item from a UShort array at a specified index. ```python RNA.ushortP_getitem(_ary_ , _index_) ``` -------------------------------- ### Prepare Comparative Probing Data (Zarringhalam 2012) Source: https://viennarna-python.readthedocs.io/en/stable/RNA Prepares comparative probing data for RNA folding, likely for multiple conditions or parameters, using the Zarringhalam et al. 2012 method. This function handles multiple sets of reactivities, betas, and conversion parameters. ```Python RNA.probing_data_Zarringhalam2012_comparative(_DoubleDoubleVector reactivities_, _DoubleVector betas_, _StringVector pr_conversions=std::vector< std::string >()_, _DoubleVector pr_defaults=std::vector< double >()_, _unsigned int multi_params=_) ``` -------------------------------- ### Get Concentrations (Python) Source: https://viennarna-python.readthedocs.io/en/stable/RNA Calculates or retrieves concentrations based on provided thermodynamic parameters. ```Python RNA.get_concentrations(FcAB, FcAA, FcBB, FEA, FEB, A0, B0) ``` -------------------------------- ### Get Aligned Line (Python) Source: https://viennarna-python.readthedocs.io/en/stable/RNA Retrieves an aligned line, likely for sequence or structure visualization. ```Python RNA.get_aligned_line(arg1) ``` -------------------------------- ### Create Probing Data (Deigan2009) Source: https://viennarna-python.readthedocs.io/en/stable/RNA Prepares probing data according to the Deigan et al. 2009 method. Converts probing data (e.g., SHAPE reactivity) to pseudo-energies for directed RNA folding. ```Python RNA.probing_data_Deigan2009(reactivities: DoubleVector, m: float, b: float) -> probing_data ``` -------------------------------- ### Memory Management (Python) Source: https://viennarna-python.readthedocs.io/en/stable/RNA Demonstrates checking ownership of objects, typically used with C++ bindings. ```Python hx.thisown intArray.thisown move.thisown mx_mfe.thisown mx_pf.thisown ``` -------------------------------- ### RNA.floatP_getitem: Get Float Array Element Source: https://viennarna-python.readthedocs.io/en/stable/RNA Retrieves an element from a float array at a specified index. ```Python RNA.floatP_getitem(_ary_ , _index_) ``` -------------------------------- ### Get Random Number Source: https://viennarna-python.readthedocs.io/en/stable/RNA Generates a random number between 0 and 1. It is typically implemented by calling _erand48(). ```python RNA.urn() ``` -------------------------------- ### Prepare Probing Data (Zarringhalam 2012) Source: https://viennarna-python.readthedocs.io/en/stable/RNA Prepares probing data for RNA folding using the Zarringhalam et al. 2012 method. It converts reactivities into probabilities and computes pseudo-energies, which can be used with RNA.fold_compound.sc_probing(). The function takes reactivities, a scaling factor beta, and optional parameters for reactivity conversion and default probability. ```Python RNA.probing_data_Zarringhalam2012(_DoubleVector reactivities_, _double beta_, _std::string pr_conversion=_, _double pr_default=_) ``` -------------------------------- ### RNA Data Setting Functions Source: https://viennarna-python.readthedocs.io/en/stable/RNA Functions for setting experimental data, probability callbacks, and product callbacks within the RNA calculation framework. These allow integration of external data and custom logic. ```Python ud_set_exp_prod_cb() ud_set_prob_cb() ud_set_prod_cb() ud_set_pydata() ``` -------------------------------- ### Get G-quadruplex L-matrix (Python) Source: https://viennarna-python.readthedocs.io/en/stable/RNA Calculates the L-matrix for G-quadruplex structures, likely used in thermodynamic calculations. ```Python RNA.get_gquad_L_matrix(S, start, maxdist, n, g, P) ``` -------------------------------- ### RNA Log Callback Number Source: https://viennarna-python.readthedocs.io/en/stable/RNA Gets the current number of log message callbacks registered in the logging system. ```python RNA.log_cb_num() ``` -------------------------------- ### RNA Fold Compound Methods Source: https://viennarna-python.readthedocs.io/en/stable/genindex Details methods associated with the `RNA.fold_compound` class, including adding base pairs (`hc_add_bp`, `hc_add_bp_nonspecific`, `hc_add_bp_strand`), adding from a database (`hc_add_from_db`), adding upward pairs (`hc_add_up`, `hc_add_up_strand`), and initialization (`hc_init`). ```python class RNA: class fold_compound: # ... other methods and attributes def hc_add_bp(self, i, j): """Adds a base pair (i, j) to the fold compound.""" pass def hc_add_bp_nonspecific(self, i, j): """Adds a non-specific base pair (i, j).""" pass def hc_add_bp_strand(self, i, j): """Adds a base pair (i, j) across strands.""" pass def hc_add_from_db(self, db_file): """Adds base pairs from a database file.""" pass def hc_add_up(self, i, j): """Adds an upward base pair (i, j).""" pass def hc_add_up_strand(self, i, j): """Adds an upward base pair (i, j) across strands.""" pass def hc_init(self): """Initializes the fold compound.""" pass ``` -------------------------------- ### RNA Module Classes and Methods - Viennarna Source: https://viennarna-python.readthedocs.io/en/stable/genindex This snippet lists the classes and methods available in the RNA module. It covers core functionalities like calculating Minimum Free Energy (MFE), handling sequence data, and managing plotting options. ```Python md (class) move (class) move_neighbor_diff() MoveVector (class) mx_mfe (class) mx_pf (class) neighbors() next() (RNA.SwigPyIterator method) next() (RNA.var_array_Iterator method) ``` -------------------------------- ### General Utility and Type Functions Source: https://viennarna-python.readthedocs.io/en/stable/RNA Includes general utility functions such as getting the type of an object and parsing G-quadruplex data. ```Python gettype() gq_parse() ``` -------------------------------- ### RNA Log Level Get Source: https://viennarna-python.readthedocs.io/en/stable/RNA Retrieves the current default log level for the logging system. This determines the verbosity of log messages. ```python RNA.log_level() ``` -------------------------------- ### ViennaRNA Python API - Parameter Handling Source: https://viennarna-python.readthedocs.io/en/stable/genindex Allows for the management and modification of thermodynamic parameters used in folding calculations. ```Python import RNA # Example: Accessing and potentially modifying parameters # This is a conceptual example as direct modification might be complex # and often involves loading custom parameter files. param = RNA.param() print(f"Bulge parameter: {param.bulge}") ``` -------------------------------- ### RNA: Experimental Parameters Source: https://viennarna-python.readthedocs.io/en/stable/genindex Details various experimental parameters used in RNA folding, such as expbulge, expdangle5, expdangle3, expDuplexInit, and many others related to loop types and mismatches. These are attributes of RNA.exp_param. ```Python import RNA # Accessing parameters (conceptual): # bulge_param = RNA.exp_param.expbulge # dangle5_param = RNA.exp_param.expdangle5 # ... and so on for other parameters ``` -------------------------------- ### Get Centroid Structure from Probs (Python) Source: https://viennarna-python.readthedocs.io/en/stable/RNA Retrieves the centroid structure of an ensemble from probability data. This function is a renamed version of get_centroid_struct_pr. ```Python RNA.get_centroid_struct_pr(length, dist, pr) ``` -------------------------------- ### Get Centroid Structure from PList (Python) Source: https://viennarna-python.readthedocs.io/en/stable/RNA Retrieves the centroid structure of an ensemble from a plist representation. This function is a renamed version of get_centroid_struct_pl. ```Python RNA.get_centroid_struct_pl(length, dist, pl) ``` -------------------------------- ### Probing Data Constructor (Multiple Sequences - Zarringhalam) Source: https://viennarna-python.readthedocs.io/en/stable/RNA Constructor for the probing_data class for multiple sequence alignments using the Zarringhalam et al. 2012 method. Accepts lists of reactivities, scaling factors (betas), conversion strategies, and default probabilities. ```Python RNA.probing_data(reactivities: DoubleDoubleVector, betas: DoubleVector, pr_conversions: StringVector = std::vector< std::string >(), pr_defaults: DoubleVector = std::vector< double >()) -> probing_data ``` -------------------------------- ### Probing Data Constructor (Single Sequence) Source: https://viennarna-python.readthedocs.io/en/stable/RNA Constructor for the probing_data class for a single sequence. Accepts reactivities, slope (m), and intercept (b) for the Deigan et al. 2009 method. ```Python RNA.probing_data(reactivities: DoubleVector, m: float, b: float) -> probing_data ``` -------------------------------- ### Probing Data Constructor (Single Sequence - Zarringhalam) Source: https://viennarna-python.readthedocs.io/en/stable/RNA Constructor for the probing_data class for a single sequence using the Zarringhalam et al. 2012 method. Accepts reactivities and a scaling factor (beta). ```Python RNA.probing_data(reactivities: DoubleVector, beta: float, pr_conversion: str = _, pr_default: float = _) -> probing_data ``` -------------------------------- ### Get Option String for RNA Source: https://viennarna-python.readthedocs.io/en/stable/RNA Generates a command-line parameter string representing the current options set within an RNA.md() object. This function is not thread-safe. ```Python option_string() ``` -------------------------------- ### Integer Pointer Access (Python) Source: https://viennarna-python.readthedocs.io/en/stable/RNA Shows functions for accessing and setting items within an integer pointer. ```Python intP_getitem() intP_setitem() ``` -------------------------------- ### Manipulate MoveVector in Python Source: https://viennarna-python.readthedocs.io/en/stable/RNA Provides methods for resizing, getting the size, and swapping elements within a MoveVector. The `thisown` attribute indicates ownership of the object. ```Python MoveVector.resize() MoveVector.size() MoveVector.swap() MoveVector.thisown ``` -------------------------------- ### RNA Pathfinding and Folding Functions Source: https://viennarna-python.readthedocs.io/en/stable/genindex Functions related to pathfinding algorithms for RNA folding, including finding paths, saddle points, and gradients. Also includes functions for partition function calculations (pf) and related methods like pf_add, pf_circ_fold, pf_dimer, pf_fold, and pfl_fold variants. ```Python path_findpath() path_findpath_saddle() path_gradient() pf() pf_add() pf_circ_fold() pf_dimer() pf_fold() pfl_fold() pfl_fold_cb() pfl_fold_up() pfl_fold_up_cb() ``` -------------------------------- ### Probing Data Constructor (Multiple Sequences - Deigan) Source: https://viennarna-python.readthedocs.io/en/stable/RNA Constructor for the probing_data class for multiple sequence alignments using the Deigan et al. 2009 method. Accepts lists of reactivities, slopes (ms), and intercepts (bs). ```Python RNA.probing_data(reactivities: DoubleDoubleVector, ms: DoubleVector, bs: DoubleVector) -> probing_data ``` -------------------------------- ### Get Salt Correction for Duplex Initialization Source: https://viennarna-python.readthedocs.io/en/stable/RNA Calculates the salt correction factor for duplex initialization based on the salt concentration specified in the model details. The result is in dcal/mol. ```python RNA.salt_duplex_init(_md_) ``` -------------------------------- ### Prepare Probing Data (Eddy 2014) Source: https://viennarna-python.readthedocs.io/en/stable/RNA Prepares a data structure for the Eddy et al. 2014 method using probing data. This function takes reactivities, unpaired data, and paired data as input to facilitate RNA folding predictions. ```Python RNA.probing_data_Eddy2014_2(reactivities, unpaired_data, paired_data) ``` -------------------------------- ### Parameter File Reading and Random String Generation Source: https://viennarna-python.readthedocs.io/en/stable/RNA Provides utilities for reading parameter files and generating random strings. 'read_parameter_file' is crucial for loading configuration or thermodynamic data, while 'random_string' can be used for generating unique identifiers or test data. ```Python read_parameter_file() random_string() ``` -------------------------------- ### Get Mean Base Pair Distance Source: https://viennarna-python.readthedocs.io/en/stable/RNA Retrieves the mean base pair distance from the last partition function computation. Deprecated; use RNA.fold_compound.mean_bp_distance() or RNA.mean_bp_distance_pr() instead. ```Python RNA.mean_bp_distance(_length_) ``` -------------------------------- ### Python floatArray Methods Source: https://viennarna-python.readthedocs.io/en/stable/RNA Provides documentation for methods associated with the floatArray data structure in the ViennaRNA Python interface. This includes functions for creating arrays from pointers and managing object ownership. ```Python floatArray.frompointer() floatArray.thisown ``` -------------------------------- ### RNA Module: Structure Component Initialization and Modification Source: https://viennarna-python.readthedocs.io/en/stable/genindex This snippet covers initialization and modification methods for RNA structure components. It includes functions for initializing fold compounds, modifying them, and setting specific structural parameters. ```python RNA.fold_compound.sc_init() RNA.fold_compound.sc_mod() RNA.fold_compound.sc_remove() RNA.fold_compound.sc_set_bp() RNA.fold_compound.sc_set_stack() RNA.fold_compound.sc_set_up() ``` -------------------------------- ### Apply Probing Data Source: https://viennarna-python.readthedocs.io/en/stable/RNA Applies probing data, such as SHAPE, to guide the structure prediction. This function is attached to fold_compound objects and takes prepared probing data as input. ```python sc_probing(_fold_compound self_, _probing_data data_) → int ``` -------------------------------- ### Prepare Comparative Probing Data (Deigan 2009) Source: https://viennarna-python.readthedocs.io/en/stable/RNA Prepares data structures for comparative structure predictions using the Deigan et al. 2009 method. This function handles multiple sets of probing data and parameters (m and b) for multiple sequence alignments (MSA). It allows specifying sequence-specific parameters via the `multi_params` flag. ```Python RNA.probing_data_Deigan2009_comparative(reactivities, ms, bs, multi_params=0) ``` -------------------------------- ### Determine Rotational Symmetry Source: https://viennarna-python.readthedocs.io/en/stable/RNA Calculates the order of rotational symmetry for a given string by checking for self-mapping with wrap-around. It can also store the start positions of rotational shifts that result in symmetry. ```python RNA.rotational_symmetry(_string_, _positions_) ``` -------------------------------- ### RNA.db_pack - Pack secondary structure using base 3 encoding Source: https://viennarna-python.readthedocs.io/en/stable/RNA Packs a secondary structure string (in dot-bracket notation) into a compressed binary string using a 5:1 compression scheme with base 3 encoding. This is useful for memory-efficient storage of multiple structures. ```Python RNA.db_pack(_struc_) ``` -------------------------------- ### Get Salt Correction for Loop Source: https://viennarna-python.readthedocs.io/en/stable/RNA Computes the salt correction for a loop, considering the number of backbone elements, salt concentration, temperature, and backbone length. The correction is returned in dcal/mol. ```python RNA.salt_loop(_L_, _salt_, _T_, _backbonelen_) ``` -------------------------------- ### Sample Secondary Structure (pbacktrack) Source: https://viennarna-python.readthedocs.io/en/stable/RNA Samples a secondary structure from the Boltzmann ensemble using probabilistic backtracing. Requires unique multiloop decomposition to be active and the partition function matrices to be filled. ```Python RNA.fold_compound.pbacktrack() ``` -------------------------------- ### RNA.E_ExtLoop Function Source: https://viennarna-python.readthedocs.io/en/stable/RNA A function likely related to external loop calculations in RNA secondary structure prediction. It takes type, start index, end index, and partition function as arguments. ```Python def RNA.E_ExtLoop(_type_, _si1_, _sj1_, _P_) ``` -------------------------------- ### Generate Suboptimal Structures with Callback (Python) Source: https://viennarna-python.readthedocs.io/en/stable/RNA A callback-based implementation for generating suboptimal secondary structures within an energy band. It calls a user-provided function for each backtrack, passing the structure, energy, and user data. This function requires specific initialization of the fold_compound object. ```Python subopt_cb(_fold_compound self_, _int delta_, _PyObject * PyFunc_, _PyObject * data=Py_None_) → PyObject * ``` -------------------------------- ### RNA.fold_compound.rotational_symmetry_db Source: https://viennarna-python.readthedocs.io/en/stable/RNA Determines the order of rotational symmetry for a given RNA dot-bracket structure. It can also store start positions for rotational shifts that map the string onto itself. This function is a method of the fold_compound object. ```Python RNA.fold_compound.rotational_symmetry_db(structure, positions=None) ``` -------------------------------- ### Attach Production Rule for Partition Function Source: https://viennarna-python.readthedocs.io/en/stable/RNA Attaches callbacks for the partition function calculation, complementing `RNA.fold_compound.ud_set_prod_rule_cb()`. It allows binding callbacks to fill dynamic programming matrices for U production rules and to retrieve partition functions for segments potentially bound by ligands. ```Python ud_set_exp_prod_rule_cb(_fold_compound self_, _PyObject * pre_cb_, _PyObject * eval_cb_) -> PyObject * ``` -------------------------------- ### Get Salt Correction for RNA Stack Source: https://viennarna-python.readthedocs.io/en/stable/RNA Retrieves the salt correction for a stack in an RNA molecule based on salt concentration, temperature, and helical rise. The returned correction is a rounded integer value. ```Python RNA.salt_stack(_salt_, _T_, _hrise_) ``` -------------------------------- ### ViennaRNA Python Module Index Source: https://viennarna-python.readthedocs.io/en/stable/py-modindex Lists the available modules within the ViennaRNA Python package. The primary module documented is 'RNA'. ```Python RNA ``` -------------------------------- ### Get Salt Correction for Loop (Integer) Source: https://viennarna-python.readthedocs.io/en/stable/RNA Computes the salt correction for a loop, considering the number of backbone elements, salt concentration, temperature, and backbone length. The correction is returned as an integer value. ```python RNA.salt_loop_int(_L_, _salt_, _T_, _backbonelen_) ``` -------------------------------- ### RNA: Reset and Substitute Parameters Source: https://viennarna-python.readthedocs.io/en/stable/genindex Provides functions to reset and substitute experimental parameters within the RNA folding process. These methods are part of the RNA.fold_compound functionality. ```Python from RNA import fold_compound # Example usage (conceptual): # fold_compound.exp_params_reset() # fold_compound.exp_params_subst() ``` -------------------------------- ### Find Optimal Direct RNA Refolding Path Source: https://viennarna-python.readthedocs.io/en/stable/RNA Finds an optimal direct refolding path between two secondary structures using the findpath algorithm. Allows specifying an upper bound for the saddle point energy. ```Python RNA.fold_compound.path_findpath(s1, s2, width, maxE) ``` -------------------------------- ### Find Sequences with Target Structure Source: https://viennarna-python.readthedocs.io/en/stable/RNA Searches for an RNA sequence that has a specific minimum free energy structure. The function takes a starting sequence and a target structure as input and returns the found sequence or an error code. ```C++ char * inverse_fold(char * start, const char * target) ``` -------------------------------- ### ViennaRNA Python API: DoublePair Methods Source: https://viennarna-python.readthedocs.io/en/stable/RNA Describes the DoublePair data structure in the ViennaRNA Python API, highlighting its attributes 'first' and 'second', which represent a pair of double-precision floating-point numbers. ```Python class DoublePair: first: float second: float thisown: bool ``` -------------------------------- ### RNA Sequence and Strand Information Source: https://viennarna-python.readthedocs.io/en/stable/RNA Accesses and manipulates RNA sequences, including encoding and preparation for analysis. Also provides information about strands within the RNA structure, such as their start and end points, number, and order. ```Python fold_compound.sequence fold_compound.sequence_encoding fold_compound.sequence_encoding2 fold_compound.strand_end fold_compound.strand_number fold_compound.strand_order fold_compound.strand_start fold_compound.strands ``` -------------------------------- ### Structure Packing and Plotting (Python) Source: https://viennarna-python.readthedocs.io/en/stable/RNA Contains functions for packing RNA structures and generating visualizations like the 'snoop' plot. ```Python pack_structure() my_PS_rna_plot_snoop_a() naview_xy_coordinates() ``` -------------------------------- ### Fold RNA Alignment with Callback Source: https://viennarna-python.readthedocs.io/en/stable/RNA Computes the MFE for an RNA alignment using a comparative method, with a callback function for progress or intermediate results. Requires a window size and Python callback objects. ```Python import RNA import PyObject # Assuming PyObject is available or simulated # alignment = RNA.StringVector(['..((..))', '((....))']) # window_size = 10 # callback_function = PyObject() # data_object = PyObject() # mfe = RNA.aliLfold_cb(alignment, window_size, callback_function, data_object) # print(mfe) ``` -------------------------------- ### RNA Module: Vector Size and Access Source: https://viennarna-python.readthedocs.io/en/stable/genindex This snippet demonstrates how to get the size of various vector types within the RNA module. It covers different vector implementations used for storing structural data. ```python RNA.ConstCharVector.size() RNA.CoordinateVector.size() RNA.DoubleDoubleVector.size() RNA.DoubleVector.size() RNA.DuplexVector.size() RNA.ElemProbVector.size() RNA.HeatCapacityVector.size() RNA.HelixVector.size() RNA.IntIntVector.size() RNA.IntVector.size() RNA.MoveVector.size() RNA.PathVector.size() RNA.SOLUTION.size() RNA.SOLUTIONVector.size() RNA.StringVector.size() RNA.SuboptVector.size() RNA.UIntUIntVector.size() RNA.UIntVector.size() RNA.varArrayChar.size() RNA.varArrayFLTorDBL.size() RNA.varArrayInt.size() RNA.varArrayMove.size() RNA.varArrayShort.size() RNA.varArrayUChar.size() RNA.varArrayUInt.size() RNA.size() ``` -------------------------------- ### Load Energy Parameters from String Source: https://viennarna-python.readthedocs.io/en/stable/RNA Loads energy parameters from a provided string, following the default energy parameter file convention. An optional name can be given to the parameter set. It returns a non-zero value on success and 0 on failure. ```python RNA.params_load_from_string(_std::string parameters_, _std::string name=""_, _unsigned int options=_) ``` -------------------------------- ### Create Annotated PostScript Alignment Plot Source: https://viennarna-python.readthedocs.io/en/stable/RNA Generates an annotated PostScript alignment plot, allowing for specific slices of the alignment to be printed by specifying start and end positions. An offset parameter adjusts the alignment position ruler. ```Python RNA.file_PS_aln(filename: str, alignment: list[str], identifiers: list[str], structure: str, start: int = 0, end: int = 0, offset: int = 0, columns: int = 60) -> int ``` -------------------------------- ### Create Pair Table (Pseudo-knot) Source: https://viennarna-python.readthedocs.io/en/stable/RNA Creates a pair table for a secondary structure, recognizing pseudo-knots using extended dot-bracket notation. The table maps paired bases and indicates unpaired bases. It handles different bracket types via a bitmask. ```python RNA.ptable_pk(structure) ``` -------------------------------- ### RNA.boustrophedon: Generate Boustrophedon Sequence Source: https://viennarna-python.readthedocs.io/en/stable/RNA Generates a sequence of Boustrophedon distributed positive natural numbers within a given interval [start, end]. The numbers are arranged alternating from the left and right ends of the interval. Returns NULL on failure. ```python RNA.boustrophedon(_* args_)[source] Generate a sequence of Boustrophedon distributed numbers. This function generates a sequence of positive natural numbers within the interval [start,end] in a Boustrophedon fashion. That is, the numbers start,…,end in the resulting list are alternating between left and right ends of the interval while progressing to the inside, i.e. the list consists of a sequence of natural numbers of the form: start,end,start+1,end−1,start+2,end−2,… The resulting list is 1-based and contains the length of the sequence of numbers at it’s 0-th position. Upon failure, the function returns **NULL** SWIG Wrapper Notes This function is available as overloaded global function boustrophedon(). See, e.g. `RNA.boustrophedon()` in the /api_python . Parameters: * **start** (`size()`) – The first number of the list (left side of the interval) * **end** (`size()`) – The last number of the list (right side of the interval) Returns: A list of alternating numbers from the interval [start,end] (or **NULL** on error) Return type: `list-like(unsigned int)` See also `RNA.boustrophedon_pos` ``` -------------------------------- ### Sliding Window Equilibrium Probabilities (Python) Source: https://viennarna-python.readthedocs.io/en/stable/RNA The probs_window() function computes various equilibrium probabilities using a sliding window approach over a given sequence. It utilizes a callback function to report probabilities, which depend on the provided options flag. This function is designed for efficient analysis of large sequences. ```Python probs_window(fc, ulength, options, PyFunc, data=Py_None) ``` -------------------------------- ### RNA Structure List Generation Source: https://viennarna-python.readthedocs.io/en/stable/genindex Functions for generating lists of RNA structures, including a general plist function and a method to create a list from probability data. ```Python plist() plist_from_probs() ``` -------------------------------- ### Get Mean Base Pair Distance (Python) Source: https://viennarna-python.readthedocs.io/en/stable/RNA Calculates the mean base pair distance in the thermodynamic ensemble of an RNA structure. This is computed from the pair probabilities and provides insight into the average deviation of base pairs from their ideal positions. ```Python RNA.fold_compound.mean_bp_distance() ``` -------------------------------- ### Add Pseudouridine Soft Constraints Source: https://viennarna-python.readthedocs.io/en/stable/RNA Adds soft constraint callbacks for Pseudouridine to guide RNA structure prediction. Modification sites are provided as a list of 1-based sequence positions. Energy parameter corrections are derived from specific literature. ```python sc_mod_pseudouridine(_* args_, _** kwargs_) ``` -------------------------------- ### ViennaRNA Python API - Structure Visualization Source: https://viennarna-python.readthedocs.io/en/stable/genindex Provides functionality to visualize RNA secondary structures, often in formats like dot-bracket notation or graphical representations. ```Python import RNA # Example: Plotting a structure (requires additional libraries like matplotlib) seq = "GGGGAAAACCCC" structure = RNA.fold(seq) # This is a placeholder, actual plotting depends on specific visualization functions # For example, using RNA.plot_structure(structure) or similar if available print(f"Structure for plotting: {structure}") ``` -------------------------------- ### Python RNA Apply Commands Source: https://viennarna-python.readthedocs.io/en/stable/RNA Applies a list of commands to an RNA.fold_compound object. Commands can be read from a file or specified directly. Options can be used to filter the types of commands applied. ```Python fc.commands_apply(commands, options) ``` -------------------------------- ### Enumerate Necklaces with Fixed Content Source: https://viennarna-python.readthedocs.io/en/stable/RNA Enumerates all non-cyclic permutations (necklaces) with a fixed content, based on a provided list of counts for each object type. The algorithm used is described in :cite:t:`sawada:2003`. The function returns a list of necklaces, terminated by a NULL pointer. A SWIG wrapper is available as a global function `enumerate_necklaces()` which accepts lists and produces lists of lists. ```Python RNA.enumerate_necklaces(_entity_counts_) ``` -------------------------------- ### Fold RNA Alignment with Limited Window Source: https://viennarna-python.readthedocs.io/en/stable/RNA Computes the Minimum Free Energy (MFE) for an RNA alignment using a comparative method with a specified window size. It can optionally write to a null file. ```Python import RNA # alignment = RNA.StringVector(['..((..))', '((....))']) # window_size = 10 # mfe = RNA.aliLfold(alignment, window_size) # print(mfe) ``` -------------------------------- ### Add Purine Soft Constraints Source: https://viennarna-python.readthedocs.io/en/stable/RNA Adds soft constraint callbacks for Purine (nebularine) to guide RNA structure prediction. Modification sites are provided as a list of 1-based sequence positions. Energy parameter corrections are derived from specific literature. ```python sc_mod_purine(_* args_, _** kwargs_) ``` -------------------------------- ### RNA Module Functions - Viennarna Source: https://viennarna-python.readthedocs.io/en/stable/genindex This snippet lists various functions available in the RNA module, categorized by their starting letter. These functions cover a wide range of RNA processing tasks, including folding, energy calculations, and data manipulation. ```Python last_parameter_file() Lfold() Lfold_cb() Lfoldz() Lfoldz_cb() log_cb_add() log_cb_add_pycallback() log_cb_num() log_fp() log_fp_set() log_level() log_level_set() log_options() log_options_set() log_reset() loop_energy() loopidx_from_ptable() Make_bp_profile() Make_bp_profile_bppm() make_loop_index() Make_swString() make_tree() maximum_matching() maximumNumberOfConfigChangesAllowed maxmimum_matching() MEA_from_plist() mean_bp_distance() memmove() mfe() mfe_dimer() mfe_window() mfe_window_cb() mfe_window_zscore() mfe_window_zscore_cb() move_standard() n_multichoose_k() naview_xy_coordinates() new_doubleP() new_floatP() new_intP() new_shortP() new_ushortP() next() ``` -------------------------------- ### RNA Parameter Loading Functions Source: https://viennarna-python.readthedocs.io/en/stable/genindex Functions for loading thermodynamic parameters for RNA and DNA folding. Supports various parameter sets including Turner 1999, Turner 2004, Andronescu 2007, Langdon 2018, and DNA parameters from Mathews 1999 and 2004. Also includes functions to load special hairpin parameters and parameters from a string. ```Python params_load() params_load_DNA_Mathews1999() params_load_DNA_Mathews2004() params_load_from_string() params_load_RNA_Andronescu2007() params_load_RNA_Langdon2018() params_load_RNA_misc_special_hairpins() params_load_RNA_Turner1999() params_load_RNA_Turner2004() ``` -------------------------------- ### Sample Subsequence Structure (pbacktrack_sub) Source: https://viennarna-python.readthedocs.io/en/stable/RNA Samples a secondary structure of a specified subsequence from the Boltzmann ensemble. It uses probabilistic backtracing within the partition function DP arrays for the given interval [start:end]. Requires unique multiloop decomposition and pre-filled partition function matrices. ```Python RNA.fold_compound.pbacktrack_sub(_fold_compound self_, _unsigned int start_, _unsigned int end_) -> char ``` ```Python RNA.fold_compound.pbacktrack_sub(_fold_compound self_, _unsigned int num_samples_, _unsigned int start_, _unsigned int end_, _unsigned int options=_) -> StringVector ``` ```Python RNA.fold_compound.pbacktrack_sub(_fold_compound self_, _unsigned int num_samples_, _unsigned int start_, _unsigned int end_, _pbacktrack_mem nr_memory_, _unsigned int options=_) -> StringVector ``` ```Python RNA.fold_compound.pbacktrack_sub(_fold_compound self_, _unsigned int num_samples_, _unsigned int start_, _unsigned int end_, _PyObject * PyFunc_, _PyObject * data=Py_None_, _unsigned int options=0_) -> unsigned int ``` ```Python RNA.fold_compound.pbacktrack_sub(_fold_compound self_, _unsigned int num_samples_, _unsigned int start_, _unsigned int end_, _PyObject * PyFunc_, _PyObject * data_, _pbacktrack_mem nr_memory_, _unsigned int options=0_) -> unsigned int ``` -------------------------------- ### Produce Secondary Structure Graph in SStructView Format Source: https://viennarna-python.readthedocs.io/en/stable/RNA Generates a secondary structure graph in SStructView format and writes the coordinate file. It takes the RNA sequence, secondary structure in dot-bracket notation, and the output filename as input. ```Python RNA.ssv_rna_plot(string: str, structure: str, ssfile: str) ``` -------------------------------- ### Load RNA Energy Parameters from File Source: https://viennarna-python.readthedocs.io/en/stable/RNA Loads energy parameters from a specified file. It supports default parameters if no filename is provided and offers various options for file formats. This function is crucial for setting up energy models for RNA folding. ```python RNA.params_load(_std::string filename=""_, _unsigned int options=_) ```