rnaglib.transforms.Transform

class rnaglib.transforms.Transform(parallel=False, num_workers=-1)[source]

Transforms modify and add information to an RNA graph via the networkx.Graph data structure. Receives an RNA graph and returns an RNA graph. This can be applied at dataset construction time, or a retrieval. Implementation inspired by torch-geometric Transforms library.

Parameters:
  • parallel (bool) – whether to run the transform in parallel.

  • num_workers (int) – if running in parallel, number of jobs to use.

Example

Transforms are callable objects that modify an RNA graph or dataset passed to it:

>>> from rnaglib.transforms import Transform
>>> t = Transform()
>>> dataset = RNADataset(debug=True)
>>> t(dataset[0])
>>> t(dataset)
__init__(parallel=False, num_workers=-1)[source]

Methods

__init__([parallel, num_workers])

forward(data)

rtype:

Any