rnaglib.prepare_data

Constructing databases of RNAs along with their annotations. The resulting databases are stored in a local folder and accessed by RNADataset to build datasets.

rnaglib.prepare_data.chop_all(graph_path, dest, n_jobs=4, parallel=True)[source]

Chop and dump all the rglib graphs in the dataset.

Parameters:
  • graph_path – path to graphs for chopping

  • dest – path where chopped graphs will be dumped

N_jobs:

number of workers to use

Paralle:

whether to use multiprocessing

rnaglib.prepare_data.annotate_all(dump_path='../data/annotated/sample_v2', graph_path='../data/chunks_nx', parallel=True, do_hash=True, wl_hops=3, graphlet_size=1, re_annotate=False)[source]

Routine for all files in a folder

Parameters:
  • dump_path

  • graph_path

  • parallel

Returns:

rnaglib.prepare_data.fr3d_to_graph(rna_path)[source]

Use fr3d to generate networkx annotation graph.

Parameters:

rna_path – path to a PDB of the RNA structure

Returns nx.Graph:

networkx graph with annotations

rnaglib.prepare_data.build_graph_from_cif(cif_path, dump_dir=None)[source]

Takes a cif file and builds the full RNAglib graph.

Parameters:
  • cif_path – path to source mmCif file

  • dump_dir – where to save the resulting networkx graph. If None just returns graph.

Returns:

graph if dump_dir is None, else return path to saved graph.