rnaglib.transforms.SequenceRepresentation

class rnaglib.transforms.SequenceRepresentation(framework='pyg', backbone='both', **kwargs)[source]

Represents RNA as a linear sequence following the 5’to 3’ order of backbone edges. Note that this only works on single-chain. If you have a multi-chain RNA make sure to first apply the ChainSplitTransform. RNAs. When using a graph-based framework (e.g. pyg or dgl) the RNA is stored as a linear graph with edges going in 5’ to 3’ as well as 3’ to 3’. This can be controlled using the backbone argument.

Parameters:
  • framework (str) – which learning framework to store representation.

  • backbone (str) – if ‘both’ graph will have 5’ -> 3’ edges and 3’ -> 5’, if ‘5p3p’ will only have the former and if ‘3p5p’ only the latter.

__init__(framework='pyg', backbone='both', **kwargs)[source]

Methods

__init__([framework, backbone])

batch(samples)

Batch a list of graph samples

to_pyg(graph, features_dict)

to_torch(graph, features_dict)

Attributes

name

Just return the name of the representation