evolocity.pp.featurize_fasta¶
-
evolocity.pp.featurize_fasta(fname, model_name='esm1b', mkey='model', embed_batch_size=3000, use_cache=True, cache_namespace=None)¶ Embeds a FASTA file.
Takes a FASTA file containing sequences and returns an
Anndataobject with sequence embeddings in the adata.X matrix.Assumes metadata is storred in FASTA record as key=value pairs that are separated by vertical bar “|” characters.
- Parameters
- fname : str
Path to FASTA file.
- model_name : str (default: ‘esm1b’)
Language model used to compute likelihoods.
- mkey : str (default: ‘model’)
Name at which language model is stored.
- embed_batch_size : int (default: 3000)
Batch size to embed sequences. Lower to fit into GPU memory.
- use_cache : bool (default: False)
Cache embeddings to disk for faster future loading.
- cache_namespace : str (default: ‘protein’)
Namespace at which to store cache.
- Returns
Returns an
Anndataobject with the attributes.X – Matrix where rows correspond to sequences and columns are language model embedding dimensions
seq (.obs) – Sequences corresponding to rows in adata.X
model (.uns) – language model