rnaglib.transforms.RNAFMTransform

class rnaglib.transforms.RNAFMTransform(chunking_strategy='simple', chunk_size=512, cache_path=None, expand_mean=True, verbose=False, **kwargs)[source]

Use the RNA-FM model to compute residue-level embeddings. Make sure rna-fm is installed by running pip install rna-fm. Sets a node attribute to ‘rnafm’ with a numpy array of the resulting embedding. Go here for the RNA-FM source code.

Parameters:

chunking_strategy (str) – how to process sequences longer than 1024. 'simple' just

splits into non-overlapping segments. :type chunk_size: int :param chunk_size: size of chunks to use (default is 512) :type cache_path: :param cache_path: a directory containing pre-computed npz embeddings :type expand_mean: :param expand_mean: True

Note

Maximum size for basic RNA-FM model is 1024. If sequence is larger than 1024 we apply 'chunking_strategy' to process the sequence.

__init__(chunking_strategy='simple', chunk_size=512, cache_path=None, expand_mean=True, verbose=False, **kwargs)[source]

Methods

__init__([chunking_strategy, chunk_size, ...])

basic_chunking(seq)

chunk(seq_data)

Apply a chunking strategy to sequences longer than 1024.

forward(rna_dict)

Attributes

encoder

name