graphein.rna

Config

Base Config object for use with RNA Graph Construction.

class graphein.rna.config.BpRNAConfig(*, path: str = './bpRNA')[source]

Config for managing BpRNA :param path: Path to bpRNA :type path: str

model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class graphein.rna.config.RNAGraphConfig(*, granularity: str = 'rna_atom', verbose: bool = False, insertions: bool = False, keep_hets: list[str] = [], edge_construction_functions: list[~collections.abc.Callable | str] = [<function add_atomic_edges>], rna_df_processing_functions: list[~collections.abc.Callable] | None = None, node_metadata_functions: list[~collections.abc.Callable | str] | None = None, edge_metadata_functions: list[~collections.abc.Callable | str] | None = None, graph_metadata_functions: list[~collections.abc.Callable] | None = None)[source]

Config Object for RNA Structure Graph Construction.

Parameters:
  • granularity – Specifies the node types of the graph, defaults to "rna" for atoms as nodes. Other options are "rna-centroid" or any RNA atom name.

  • verbose (bool) – Specifies verbosity of graph creation process.

  • rna_df_processing_functions (Optional[List[Callable]]) – List of functions that take a pd.DataFrame and return a pd.DataFrame. This allows users to define their own series of processing functions for the RNA structure DataFrame and override the default sequencing of processing steps provided by Graphein. We refer users to our low-level API tutorial for more details.

  • edge_construction_functions (List[Callable]) – List of functions that take an nx.Graph and return an nx.Graph with desired edges added. Prepared edge constructions can be found in graphein.rna.edges

  • node_metadata_functions (List[Callable], optional) – List of functions that take an nx.Graph

  • edge_metadata_functions (List[Callable], optional) – List of functions that take an

  • graph_metadata_functions (List[Callable], optional) – List of functions that take an nx.Graph and return an nx.Graph with added graph-level features and metadata.

model_config = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

Graphs

Functions for working with RNA Secondary Structure Graphs.

graphein.rna.graphs.construct_rna_graph_2d(dotbracket: str | None, sequence: str | None, name: str | None = None, bprna_id: str | None = None, edge_construction_funcs: list[Callable] | None = None, edge_annotation_funcs: list[Callable] | None = None, node_annotation_funcs: list[Callable] | None = None, graph_annotation_funcs: list[Callable] | None = None, use_nussinov: bool = False, config: RNAGraphConfig | None = None) → Graph[source]

Constructs an RNA secondary structure graph from dotbracket notation.

Parameters:
  • dotbracket (str, optional) – Dotbracket notation representation of secondary structure.

  • sequence (str, optional) – Corresponding sequence RNA bases

  • bprna_id (str, optional) – bp RNA ID of the RNA secondary structure from which to construct the graph. Defaults to None.

  • edge_construction_funcs (List[Callable], optional) – List of edge construction functions. Defaults to None.

  • edge_annotation_funcs (List[Callable], optional) – List of edge metadata annotation functions. Defaults to None.

  • node_annotation_funcs (List[Callable], optional) – List of node metadata annotation functions. Defaults to None.

  • graph_annotation_funcs (List[Callable], optional) – List of graph metadata annotation functions. Defaults to None.

  • config (BpRNAConfig, optional) – BpRNA Configuration object. Defaults to None. Unused unless using a bpRNA to compute a graph.

Returns:

nx.Graph of RNA secondary structure

Return type:

nx.Graph

graphein.rna.graphs.construct_rna_graph_3d(config: RNAGraphConfig | None = None, name: str | None = None, path: str | PathLike | None = None, pdb_code: str | None = None, chain_selection: str = 'all', model_index: int = 1, rna_df_processing_funcs: list[Callable] | None = None, edge_construction_funcs: list[Callable] | None = None, edge_annotation_funcs: list[Callable] | None = None, node_annotation_funcs: list[Callable] | None = None, graph_annotation_funcs: list[Callable] | None = None) → Graph[source]

Constructs RNA structure graph from a pdb_code or path.

Users can provide a RNAGraphConfig object to specify construction parameters.

However, config parameters can be overridden by passing arguments directly to the function.

Parameters:
  • config (graphein.protein.config.RNAGraphConfig, optional) – RNAGraphConfig object. If None, defaults to config in graphein.rna.config.

  • path (str, optional) – Path to PDB or MMTF to build graph from. Default is None.

  • pdb_code (str, optional) – 4-character PDB accession pdb_code to build graph from. Default is None.

  • chain_selection (str) – String of nucleotide chains to include in graph. E.g "ABDF" or "all". Default is "all".

  • model_index (int) – Index of model to use in the case of structural ensembles. Default is 1.

  • df_processing_funcs (List[Callable], optional) – List of DataFrame processing functions. Default is None.

  • edge_construction_funcs (List[Callable], optional) – List of edge construction functions. Default is None.

  • edge_annotation_funcs (List[Callable], optional) – List of edge annotation functions. Default is None.

  • node_annotation_funcs (List[Callable], optional) – List of node annotation functions. Default is None.

  • graph_annotation_funcs (List[Callable]) – List of graph annotation function. Default is None.

Returns:

RNA Structure Graph

Type:

nx.Graph

graphein.rna.graphs.validate_dotbracket(db: str)[source]

Sanitize dotbracket string. This ensures that it only has supported symbols.

See: SUPPORTED_DOTBRACKET_NOTATION

Parameters:

db (str) – Dotbracket notation string

Raises:

ValueError – Raises ValueError if dotbracket notation contains unsupported symbols

graphein.rna.graphs.validate_lengths(db: str, seq: str) → None[source]

Check lengths of dotbracket and sequence match.

Parameters:
  • db (str) – Dotbracket string to check

  • seq (str) – RNA nucleotide sequence to check.

Raises:

ValueError – Raises ValueError if lengths of dotbracket and sequence do not match.

graphein.rna.graphs.validate_rna_sequence(s: str) → None[source]

Validate RNA sequence. This ensures that it only contains supported bases.

Supported bases are: "A", "U", "G", "C", "I" Supported bases can be accessed in

Parameters:

s (str) – Sequence to validate

Raises:

ValueError – Raises ValueError if the sequence contains an unsupported base character

Edges

Atomic

Functions for computing atomic structure of proteins.

graphein.rna.edges.atomic.add_atomic_edges(G: Graph, tolerance: float = 0.56) → Graph[source]

Computes covalent edges based on atomic distances. Covalent radii are assigned to each atom based on its bond state. The distance matrix is then thresholded to entries less than this distance plus some tolerance to create an adjacency matrix. This adjacency matrix is then parsed into an edge list and covalent edges added.

Bond states and covalent radii are retrieved from:

Structures of the Molecular Components in DNA and RNA with Bond Lengths Interpreted as Sums of Atomic Covalent Radii Raji Heyrovska

Parameters:
  • G (nx.Graph) – Atomic graph (nodes correspond to atoms) to populate with atomic bonds as edges

  • tolerance (float) – Tolerance for atomic distance. Default is 0.56 Angstroms. Commonly used values are: 0.4, 0.45, 0.56

Returns:

Atomic graph with edges between bonded atoms added

Return type:

nx.Graph

graphein.rna.edges.atomic.add_bond_order(G: Graph) → Graph[source]

Assign bond orders to the covalent bond edges between atoms on the basis of bond length. Values are taken from:

Automatic Assignment of Chemical Connectivity to Organic Molecules in the Cambridge Structural Database. Jon C. Baber and Edward E. Hodgkin

Parameters:

G (nx.Graph) – Atomic-level RNA graph with covalent edges.

Returns:

Atomic-level RNA graph with covalent edges annotated with putative bond order.

Return type:

nx.Graph

graphein.rna.edges.atomic.add_ring_status(G: Graph) → Graph[source]

Identifies rings in the atomic RNA graph. Assigns the edge attribute "RING" to edges in the ring. We do not distinguish between aromatic and non-aromatic rings. Functions by identifying all cycles in the graph.

Parameters:

G (nx.Graph) – Atom-level RNA structure graph to add ring edge types to

Returns:

Atom-level RNA structure graph with added "RING" edge attribute

Return type:

nx.Graph

Base Pairing

Functions to compute edges for an RNA secondary structure graph.

graphein.rna.edges.base_pairing.add_all_dotbracket_edges(G: Graph) → Graph[source]

Adds phosphodiester bonds between adjacent nucleotides and base_pairing interactions to an RNA secondary structure graph.

Parameters:

G (nx.Graph) – RNA Graph to add edges to.

Returns:

RNA graph with phosphodiester_bond and base_pairing edges added.

Return type:

nx.Graph

graphein.rna.edges.base_pairing.add_base_pairing_interactions(G: Graph) → Graph[source]

Adds base pairing interactions between nucleotides to an RNA secondary structure graph.

Parameters:

G (nx.Graph) – RNA Graph to add edges to.

Raises:

ValueError – if dotbracket contains an unsupported character.

Returns:

RNA graph with base_pairing edges added.

Return type:

nx.Graph

graphein.rna.edges.base_pairing.add_phosphodiester_bonds(G: Graph) → Graph[source]

Adds phosphodiester bonds between adjacent nucleotides to an RNA secondary structure graph.

Parameters:

G (nx.Graph) – RNA Graph to add edges to.

Returns:

RNA graph with phosphodiester_bond edges added.

Return type:

nx.Graph

graphein.rna.edges.base_pairing.add_pseudoknots(G: Graph) → Graph[source]

Adds pseudoknots nucleotides to an RNA secondary structure graph.

Parameters:

G (nx.Graph) – RNA Graph to add edges to.

Returns:

RNA graph with pseudoknot edges added.

Return type:

nx.Graph

graphein.rna.edges.base_pairing.check_base_pairing_type(base_1: str, base_2: str) → str[source]

Checks type and validity of base pairing interactions.

Parameters:
  • base_1 (str) – str RNA Base letter for base 1.

  • base_2 (str) – str RNA base letter for base 2.

Returns:

string referencing the type of base pairing "canonical", "wobble" or "invalid".

Return type:

str

Distance

Features

Node

Functions for featurising RNA Structure Graphs.

graphein.rna.features.atom.add_atomic_radii(n: str, d: dict[str, Any]) → float[source]

Add atomic radii to nodes based on values provided in:

Structures of the Molecular Components in DNA and RNA with Bond Lengths Interpreted as Sums of Atomic Covalent Radii Raji Heyrovska

Atoms in the RNA structure are mapped to their bond states (RNA_ATOM_BOND_STATE), which are in turn mapped to the corresponding atomic radii (RNA_ATOMIC_RADII).

Parameters:
  • n (str) – The node to add the atomic radius to. Unused, the argument is provided to retain a consistent function signature.

  • d (Dict[str, Any]) – The node data.

Returns:

The atomic radius of the node.

Return type:

float

Subgraphs

Provides functions for extracting subgraphs from RNA graphs.

graphein.rna.subgraphs.extract_k_hop_subgraph(g: Graph, central_node: str, k: int, k_only: bool = False, filter_dataframe: bool = True, update_coords: bool = True, recompute_distmat: bool = False, inverse: bool = False, return_node_list: bool = False) → Graph | list[str][source]

Extracts a k-hop subgraph.

Parameters:
  • g (nx.Graph) – The graph to extract the subgraph from.

  • central_node (str) – The central node to extract the subgraph from.

  • k (int) – The number of hops to extract.

  • k_only (bool) – Whether to only extract the exact k-hop subgraph (e.g. include 2-hop neighbours in 5-hop graph). Defaults to False.

  • filter_dataframe (bool, optional) – Whether to filter the pdb_df of the graph, defaults to True.

  • update_coords (bool) – Whether to update the coordinates of the graph. Defaults to True.

  • recompute_distmat (bool) – Whether to recompute the distance matrix of the graph. Defaults to False.

  • inverse (bool, optional) – Whether to inverse the selection, defaults to False.

  • return_node_list (bool) – Whether to return the node list. Defaults to False.

Returns:

The subgraph or node list if return_node_list=True.

Return type:

Union[nx.Graph, List[str]]

graphein.rna.subgraphs.extract_subgraph_by_bond_type(g: Graph, bond_types: list[str], filter_dataframe: bool = True, update_coords: bool = True, recompute_distmat: bool = False, inverse: bool = False, return_node_list: bool = False) → Graph | list[str][source]

Extracts a subgraph from a graph based on a list of allowable bond types.

Parameters:
  • g (nx.Graph) – The graph to extract the subgraph from.

  • bond_types (List[str]) – List of allowable bond types.

  • filter_dataframe (bool, optional) – Whether to filter the pdb_df of the graph, defaults to True.

  • update_coords (bool) – Whether to update the coordinates of the graph. Defaults to True.

  • recompute_distmat (bool) – Whether to recompute the distance matrix of the graph. Defaults to False.

  • inverse (bool, optional) – Whether to inverse the selection, defaults to False.

  • return_node_list (bool, optional) – Whether to return the node list, defaults to False.

Returns:

The subgraph or node list if return_node_list=True.

Return type:

Union[nx.Graph, List[str]]

graphein.rna.subgraphs.extract_subgraph_by_sequence_position(g: Graph, sequence_positions: list[int], filter_dataframe: bool = True, update_coords: bool = True, recompute_distmat: bool = False, inverse: bool = False, return_node_list: bool = False) → Graph | list[str][source]

Extracts a subgraph from a graph based on a chain.

Parameters:
  • g (nx.Graph) – The graph to extract the subgraph from.

  • chain (List[int]) – The sequence positions to extract. E.g. [1, 3, 5, 7].

  • filter_dataframe (bool) – Whether to filter the pdb_df dataframe of the graph. Defaults to True.

  • update_coords (bool) – Whether to update the coordinates of the graph. Defaults to True.

  • recompute_distmat (bool) – Whether to recompute the distance matrix of the graph. Defaults to False.

  • inverse (bool) – Whether to inverse the selection. Defaults to False.

Returns:

The subgraph or node list if return_node_list=True.

Return type:

Union[nx.Graph, List[str]]

graphein.rna.subgraphs.extract_subgraph_from_atom_types(g: Graph, atom_types: list[str], filter_dataframe: bool = True, update_coords: bool = True, recompute_distmat: bool = False, inverse: bool = False, return_node_list: bool = False) → Graph | list[str][source]

Extracts a subgraph from an RNA graph based on a list of atom types.

Parameters:
  • g (nx.Graph) – The graph to extract the subgraph from.

  • atom_types (List[str]) – The list of atom types to extract.

  • filter_dataframe (bool) – Whether to filter the pdb_df dataframe of the graph. Defaults to True.

  • update_coords (bool) – Whether to update the coordinates of the graph. Defaults to True.

  • recompute_distmat (bool) – Whether to recompute the distance matrix of the graph. Defaults to False.

  • inverse (bool) – Whether to inverse the selection. Defaults to False.

Returns:

The subgraph or node list if return_node_list=True.

Return type:

Union[nx.Graph, List[str]]

graphein.rna.subgraphs.extract_subgraph_from_backbone(g: Graph, filter_dataframe: bool = True, update_coords: bool = True, recompute_distmat: bool = True, inverse: bool = False, return_node_list: bool = False)[source]

Extracts a subgraph from an RNA structure retaining only backbone atoms.

Backbone atoms are defined in graphein.rna.constants.RNA_BACKBONE_ATOMS.

Parameters:
  • g (nx.Graph) – RNA Structure Graph to extract subgraph from.

  • filter_dataframe (bool) – Whether to filter the pdb_df dataframe of the graph. Defaults to True.

  • update_coords (bool) – Whether to update the coordinates of the graph. Defaults to True.

  • recompute_distmat (bool) – Whether to recompute the distance matrix of the graph. Defaults to False.

  • inverse (bool) – Whether to inverse the selection. Defaults to False.

Returns:

The subgraph or node list if return_node_list=True.

Return type:

Union[nx.Graph, List[str]]

graphein.rna.subgraphs.extract_subgraph_from_bases(g: Graph, filter_dataframe: bool = True, update_coords: bool = True, recompute_distmat: bool = True, inverse: bool = False, return_node_list: bool = False)[source]

Extracts a subgraph from an RNA structure retaining only base atoms.

Backbone atoms are defined in graphein.rna.constancts.RNA_BACKBONE_ATOMS. We exclude these to perform the selection.

Parameters:
  • g (nx.Graph) – RNA Structure Graph to extract subgraph from.

  • filter_dataframe (bool) – Whether to filter the pdb_df dataframe of the graph. Defaults to True.

  • update_coords (bool) – Whether to update the coordinates of the graph. Defaults to True.

  • recompute_distmat (bool) – Whether to recompute the distance matrix of the graph. Defaults to False.

  • inverse (bool) – Whether to inverse the selection. Defaults to False.

Returns:

The subgraph or node list if return_node_list=True.

Return type:

Union[nx.Graph, List[str]]

graphein.rna.subgraphs.extract_subgraph_from_chains(g: Graph, chains: list[str], filter_dataframe: bool = True, update_coords: bool = True, recompute_distmat: bool = False, inverse: bool = False, return_node_list: bool = False) → Graph | list[str][source]

Extracts a subgraph from a graph based on a chain.

Parameters:
  • g (nx.Graph) – The graph to extract the subgraph from.

  • chains (List[str]) – The chain(s) to extract. E.g. ["A", "C"].

  • filter_dataframe (bool) – Whether to filter the pdb_df dataframe of the graph. Defaults to True.

  • update_coords (bool) – Whether to update the coordinates of the graph. Defaults to True.

  • recompute_distmat (bool) – Whether to recompute the distance matrix of the graph. Defaults to False.

  • inverse (bool) – Whether to inverse the selection. Defaults to False.

Returns:

The subgraph or node list if return_node_list=True.

Return type:

Union[nx.Graph, List[str]]

graphein.rna.subgraphs.extract_subgraph_from_node_list(g, node_list: list[str] | None, filter_dataframe: bool = True, update_coords: bool = True, recompute_distmat: bool = False, inverse: bool = False, return_node_list: bool = False) → Graph | list[str][source]

Extracts a subgraph from a graph based on a list of nodes.

Parameters:
  • g (nx.Graph) – The graph to extract the subgraph from.

  • node_list (List[str], optional) – The list of nodes to extract.

  • filter_dataframe (bool) – Whether to filter the pdb_df DataFrame of the graph. Defaults to True.

  • update_coords (bool) – Whether to update the coordinates of the graph. Defaults to True.

  • recompute_distmat (bool) – Whether to recompute the distance matrix of the graph. Defaults to False.

  • inverse (bool) – Whether to inverse the selection. Defaults to False.

Returns:

The subgraph or node list if return_node_list=True.

Return type:

Union[nx.Graph, List[str]]

graphein.rna.subgraphs.extract_subgraph_from_phosphoric_acid(g: Graph, filter_dataframe: bool = True, update_coords: bool = True, recompute_distmat: bool = True, inverse: bool = False, return_node_list: bool = False)[source]

Extracts a subgraph from an RNA structure retaining only base atoms.

Phosphoric acid atoms are defined in graphein.rna.constancts.PHOSPHORIC_ACID_ATOMS.

Parameters:
  • g (nx.Graph) – RNA Structure Graph to extract subgraph from.

  • filter_dataframe (bool) – Whether to filter the pdb_df dataframe of the graph. Defaults to True.

  • update_coords (bool) – Whether to update the coordinates of the graph. Defaults to True.

  • recompute_distmat (bool) – Whether to recompute the distance matrix of the graph. Defaults to False.

  • inverse (bool) – Whether to inverse the selection. Defaults to False.

Returns:

The subgraph or node list if return_node_list=True.

Return type:

Union[nx.Graph, List[str]]

graphein.rna.subgraphs.extract_subgraph_from_point(g: Graph, centre_point: ndarray | tuple[float, float, float], radius: float, filter_dataframe: bool = True, update_coords: bool = True, recompute_distmat: bool = False, inverse: bool = False, return_node_list: bool = False) → Graph | list[str][source]

Extracts a subgraph from a graph based on a centre point and radius.

Parameters:
  • g (nx.Graph) – The graph to extract the subgraph from.

  • centre_point (Tuple[float, float, float]) – The centre point of the subgraph.

  • radius (float) – The radius of the subgraph.

  • filter_dataframe (bool) – Whether to filter the pdb_df dataframe of the graph. Defaults to True.

  • update_coords (bool) – Whether to update the coordinates of the graph. Defaults to True.

  • recompute_distmat – Whether to recompute the distance matrix of the

graph. Defaults to False. :type recompute_distmat: bool :param inverse: Whether to inverse the selection. Defaults to False. :type inverse: bool :return: The subgraph or node list if return_node_list=True. :rtype: Union[nx.Graph, List[str]]

graphein.rna.subgraphs.extract_subgraph_from_residue_types(g: Graph, residue_types: list[str], filter_dataframe: bool = True, update_coords: bool = True, recompute_distmat: bool = False, inverse: bool = False, return_node_list: bool = False) → Graph | list[str][source]

Extracts a subgraph from a graph based on a list of allowable (nucleotide) residue types.

Parameters:
  • g (nx.Graph) – The graph to extract the subgraph from.

  • residue_types (List[str]) – List of allowable residue types (1-letter residue names). E.g. ["A", "G"].

  • filter_dataframe (bool, optional) – Whether to filer the pdb_df of the graph, defaults to True.

  • update_coords (bool) – Whether to update the coordinates of the graph. Defaults to True.

  • recompute_distmat (bool) – Whether to recompute the distance matrix of the graph. Defaults to False.

  • inverse (bool) – Whether to inverse the selection. Defaults to False.

Returns:

The subgraph or node list if return_node_list=True.

Return type:

Union[nx.Graph, List[str]]

graphein.rna.subgraphs.extract_subgraph_from_ribose(g: Graph, filter_dataframe: bool = True, update_coords: bool = True, recompute_distmat: bool = True, inverse: bool = False, return_node_list: bool = False)[source]

Extracts a subgraph from an RNA structure retaining only base atoms.

Ribose atoms are defined in graphein.rna.constants.RIBOSE_ATOMS.

Parameters:
  • g (nx.Graph) – RNA Structure Graph to extract subgraph from.

  • filter_dataframe (bool) – Whether to filter the pdb_df dataframe of the graph. Defaults to True.

  • update_coords (bool) – Whether to update the coordinates of the graph. Defaults to True.

  • recompute_distmat (bool) – Whether to recompute the distance matrix of the graph. Defaults to False.

  • inverse (bool) – Whether to inverse the selection. Defaults to False.

Returns:

The subgraph or node list if return_node_list=True.

Return type:

Union[nx.Graph, List[str]]

Visualisation

Visualisation utilities for RNA Secondary Structure Graphs.

graphein.rna.visualisation.plot_rna_graph(g: Graph, layout: <module 'networkx.drawing.layout' from '/home/runner/work/graphein/graphein/.venv/lib/python3.12/site-packages/networkx/drawing/layout.py'> = <function circular_layout>, label_base_type: bool = True, label_base_position: bool = False, label_dotbracket_symbol: bool = False, **kwargs)[source]

Plots a RNA Secondary Structure Graph. Colours edges by kind.

Parameters:
  • g (nx.Graph) – NetworkX graph of RNA secondary structure graph.

  • layout (nx.layout) – Layout algorithm to use. Default is circular_layout.

  • label_base_type (bool) – Whether to label the base type of each base.

  • label_base_position (bool) – Whether to label the base position of each base.

  • label_dotbracket_symbol – Whether to label the dotbracket symbol of each base.

Utils

Utility Functions for working with RNA Secondary Structure Graphs.

graphein.rna.utils.download_bp_rna_1m(out_path: str = '/tmp/')[source]

Downloads BP RNA Dotbrackets.

Parameters:

out_path (str, optional) – _description_, defaults to “/tmp/”

graphein.rna.utils.read_dbn_file(path: str) → tuple[str, str][source]

Read a dotbracket file to sequence and dotbracket strings.

Parameters:

path (str) – Path to the dotbracket file in .dbn format.

Returns:

Tuple of sequence and dotbracket strings.

Return type:

Tuple[str, str]

Constants

Constants for working with RNA Secondary Structure Graphs.

graphein.rna.constants.CANONICAL_BASE_PAIRINGS: dict[str, list[str]] = {'A': ['U'], 'C': ['G'], 'G': ['C'], 'U': ['A']}

Maps standard RNA bases to their canonical base pairings.

graphein.rna.constants.PSEUDOKNOT_CLOSING_SYMBOLS: list[str] = [']', '}', '>']

List of symbols denoting a pseudoknot closing.

graphein.rna.constants.PSEUDOKNOT_OPENING_SYMBOLS: list[str] = ['[', '{', '<']

List of symbols denoting a pseudoknot opening.

graphein.rna.constants.RNA_ATOMIC_RADII: dict[str, float] = {'Cdb': 0.67, 'Cres': 0.72, 'Csb': 0.77, 'H': 0.37, 'Ndb': 0.62, 'Nsb': 0.7, 'Odb': 0.6, 'Osb': 0.67, 'P': 0.92}

List of atomic radii (in angstroms) from Heyrovska 2008.

graphein.rna.constants.RNA_ATOMS: list[str] = ["C1'", 'C2', "C2'", "C3'", 'C4', "C4'", 'C5', "C5'", 'C6', 'C8', 'N1', 'N2', 'N3', 'N4', 'N6', 'N7', 'N9', 'O2', "O2'", "O3'", 'O4', "O4'", "O5'", 'O6', 'OP1', 'OP2', 'P']

List of valid RNA atoms found in PDB structures.

graphein.rna.constants.RNA_ATOM_BOND_STATE: dict[str, dict[str, str]] = {'A': {"C1'": 'Cres', 'C2': 'Cres', "C2'": 'Cres', "C3'": 'Cres', 'C4': 'Cres', "C4'": 'Cres', 'C5': 'Cdb', "C5'": 'Cres', 'C6': 'Cres', 'C8': 'Cdb', 'H': 'H', 'N1': 'Ndb', 'N3': 'Ndb', 'N6': 'Nsb', 'N7': 'Ndb', 'N9': 'Nsb', "O1'": 'Osb', "O2'": 'Osb', "O3'": 'Osb', "O4'": 'Osb', "O5'": 'Osb', 'OP1': 'Osb', 'OP2': 'Odb', 'P': 'P'}, 'C': {"C1'": 'Cres', 'C2': 'Cdb', "C2'": 'Cres', "C3'": 'Cres', 'C4': 'Cdb', "C4'": 'Cres', 'C5': 'Cres', "C5'": 'Cres', 'C6': 'Cdb', 'H': 'H', 'N1': 'Nsb', 'N3': 'Ndb', 'N4': 'Nsb', "O1'": 'Osb', 'O2': 'Odb', "O2'": 'Osb', "O3'": 'Osb', "O4'": 'Osb', "O5'": 'Osb', 'OP1': 'Osb', 'OP2': 'Odb', 'P': 'P'}, 'G': {"C1'": 'Cres', 'C2': 'Cdb', "C2'": 'Cres', "C3'": 'Cres', 'C4': 'Cdb', "C4'": 'Cres', 'C5': 'Cres', "C5'": 'Cres', 'C6': 'Cdb', 'C8': 'Cdb', 'H': 'H', 'N1': 'Nsb', 'N2': 'Nsb', 'N3': 'Ndb', 'N7': 'Ndb', 'N9': 'Nsb', "O1'": 'Osb', "O2'": 'Osb', "O3'": 'Osb', "O4'": 'Osb', "O5'": 'Osb', 'O6': 'Odb', 'OP1': 'Osb', 'OP2': 'Odb', 'P': 'P'}, 'T': {'C': 'Csb', "C1'": 'Cres', 'C2': 'Cdb', "C2'": 'Cres', "C3'": 'Cres', 'C4': 'Cdb', "C4'": 'Cres', 'C5': 'Cres', "C5'": 'Cres', 'C6': 'Cdb', 'H': 'H', 'N1': 'Nsb', 'N3': 'Nsb', "O1'": 'Osb', 'O2': 'Odb', "O2'": 'Osb', "O3'": 'Osb', 'O4': 'Odb', "O4'": 'Osb', "O5'": 'Osb', 'OP1': 'Osb', 'OP2': 'Odb', 'P': 'P'}, 'U': {"C1'": 'Cres', 'C2': 'Cdb', "C2'": 'Cres', "C3'": 'Cres', 'C4': 'Cdb', "C4'": 'Cres', 'C5': 'Cres', "C5'": 'Cres', 'C6': 'Cdb', 'H': 'H', 'N1': 'Nsb', 'N3': 'Nsb', "O1'": 'Osb', 'O2': 'Odb', "O2'": 'Osb', "O3'": 'Osb', 'O4': 'Odb', "O4'": 'Osb', "O5'": 'Osb', 'OP1': 'Osb', 'OP2': 'Odb', 'P': 'P'}}

List of atoms mapped to bondstates from Heyrovska 2008.

graphein.rna.constants.RNA_BASES: list[str] = ['A', 'U', 'G', 'C', 'I']

List of allowable RNA Bases.

graphein.rna.constants.RNA_BASE_COLORS: dict[str, str] = {'A': 'r', 'C': 'y', 'G': 'g', 'I': 'm', 'U': 'b'}

Maps RNA bases (RNA_BASES) to a colour for visualisations.

graphein.rna.constants.SIMPLE_DOTBRACKET_NOTATION: list[str] = ['(', '.', ')']

List of characters in simplest dotbracket notation.

graphein.rna.constants.SS_BOND_TYPES: list[str] = ['phosphodiester_bond', 'base_pairing', 'pseudoknot']

List of valid secondary structure bond types.

graphein.rna.constants.SUPPORTED_DOTBRACKET_NOTATION = ['(', '.', ')', '[', '{', '<', ']', '}', '>']

List of all valid dotbracket symbols. Amalgamation of SIMPLE_DOTBRACKET_NOTATION and SUPPORTED_PSEUDOKNOT_NOTATION.

graphein.rna.constants.SUPPORTED_PSEUDOKNOT_NOTATION: list[str] = ['[', '{', '<', ']', '}', '>']

List of characters denoting pseudoknots in dotbracket notation. Amalgam of PSEUDOKNOT_OPENING_SYMBOLS and PSEUDOKNOT_CLOSING_SYMBOLS.

graphein.rna.constants.VALID_BASE_PAIRINGS = {'A': ['U', 'I'], 'C': ['G', 'I'], 'G': ['C', 'U'], 'I': ['A', 'C', 'U'], 'U': ['A', 'G', 'I']}

Mapping of RNA bases (RNA_BASES) to their allowable pairings. Amalgam of CANONICAL_BASE_PAIRINGS and WOBBLE_BASE_PAIRINGS.

graphein.rna.constants.WOBBLE_BASE_PAIRINGS: dict[str, list[str]] = {'A': ['I'], 'C': ['I'], 'G': ['U'], 'I': ['A', 'C', 'U'], 'U': ['G', 'I']}

Maps RNA bases (RNA_BASES) to their wobble base pairings.