Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/COLA-Laboratory/OmniGenBench
/ functions
Functions
955 in github.com/COLA-Laboratory/OmniGenBench
⨍
Functions
955
◇
Types & classes
187
↓ 1 callers
Method
_seq_to_one_hot
(Private) Converts a sequence to a one-hot encoding. This helper function converts a sequence into a one-hot encoding based on the pr
omnigenbench/src/explainability/shared_methods/lime_explainer.py:150
↓ 1 callers
Method
_setup_data_loaders
Set up data loaders for training, evaluation, and testing. Args: train_dataset (Optional[Dataset]): Training dataset
omnigenbench/src/trainer/base_trainer.py:380
↓ 1 callers
Method
_setup_training_components
Set up training-specific components (device, scaler, etc.). This method should be implemented by subclasses to initialize tr
omnigenbench/src/trainer/base_trainer.py:430
↓ 1 callers
Method
_tokens_to_one_hot
Project token ids to nucleotide one-hot channels. Parameters ---------- ids : torch.LongTensor Shape ``(batch_siz
omnigenbench/src/model/baselines.py:1604
↓ 1 callers
Method
_tokens_to_one_hot
(self, ids: torch.Tensor)
omnigenbench/src/model/baselines.py:1675
↓ 1 callers
Method
_tokens_to_one_hot
(self, ids: torch.Tensor)
omnigenbench/src/model/baselines.py:1766
↓ 1 callers
Method
_tokens_to_one_hot
(self, ids: torch.Tensor)
omnigenbench/src/model/baselines.py:1828
↓ 1 callers
Method
_tokens_to_one_hot
(self, ids: torch.Tensor)
omnigenbench/src/model/baselines.py:2740
↓ 1 callers
Method
_train_epoch
Train the model for one epoch. Args: epoch (int): Current epoch number Returns: float: Average trai
omnigenbench/src/trainer/base_trainer.py:441
↓ 1 callers
Method
_train_epoch
Train the model for one epoch using HuggingFace Accelerate. Args: epoch (int): Current epoch number Returns:
omnigenbench/src/trainer/accelerate_trainer.py:147
↓ 1 callers
Method
augment_from_file
Main function to handle the augmentation process from a file input to a file output. This method loads sequences from an input file,
omnigenbench/src/model/augmentation/model.py:262
↓ 1 callers
Method
augment_sequence
Perform augmentation on a single sequence by predicting masked tokens. Args: seq (str): Input genomic sequence with mask
omnigenbench/src/model/augmentation/model.py:185
↓ 1 callers
Method
augment_sequences
Augment a list of sequences by applying noise and performing MLM-based predictions. Args: sequences (list): List of geno
omnigenbench/src/model/augmentation/model.py:218
↓ 1 callers
Function
auto_lora_model
This function automatically identifies suitable target modules and creates a LoRA-adapted version of the input model. It handles configuratio
omnigenbench/src/lora/lora_model.py:57
↓ 1 callers
Method
batch_encode
Batch encode sequences into aggregated (pooled) embeddings. Args: sequences (List[str]): Input DNA or RNA sequences for encoding.
omnigenbench/src/model/embedding/model.py:58
↓ 1 callers
Method
bench_info
Prints and returns information about the current benchmark setup. Returns: str: A string containing benchmark informatio
omnigenbench/auto/auto_bench/auto_bench.py:210
↓ 1 callers
Method
calculate_structure_metrics
Calculate various structure comparison metrics
examples/rna_secondary_structure_prediction/enhanced_ssp_demo.py:97
↓ 1 callers
Function
clean_temp_dir_pt_files
Clean up temporary PyTorch files in the current directory. This function removes temporary PyTorch files (like .pt, .pth files) that may
omnigenbench/src/misc/utils.py:488
↓ 1 callers
Function
clone_hf_model
Clone a model from Hugging Face Hub to local directory using git. Note: This method requires git and git-lfs to be installed for large files
omnigenbench/src/utility/model_hub/model_hub.py:247
↓ 1 callers
Method
compute
Compute the metric, based on the true and predicted values. Args: y_true: The true values y_score: The predi
omnigenbench/src/metric/metric.py:176
↓ 1 callers
Method
compute
Compute the metric, based on the true and predicted values. This method computes the classification metric using the provided
omnigenbench/src/metric/classification_metric.py:150
↓ 1 callers
Method
compute
Compute the regression metric, based on the true and predicted values. Args: y_true: The true values y_score
omnigenbench/src/metric/regression_metric.py:165
↓ 1 callers
Method
compute
Compute the ranking metric, based on the true and predicted values. This method should be implemented by subclasses to provide speci
omnigenbench/src/metric/ranking_metric.py:121
↓ 1 callers
Method
compute_bpp_matrix_efficient
More efficient BPP computation using ViennaRNA's bpp method. Args: sequence: RNA sequence string
examples/translation_efficiency_prediction/te_with_bpp_features.py:84
↓ 1 callers
Method
compute_similarity
Compute cosine similarity between two embeddings. Args: embedding1 (torch.Tensor or np.ndarray): The first embedding
omnigenbench/src/model/embedding/model.py:378
↓ 1 callers
Function
conv5x5
5x5 convolution with padding. Args: in_planes (int): Number of input channels out_planes (int): Number of output channels
omnigenbench/src/model/regression/resnet.py:64
↓ 1 callers
Function
count_parameters
This function iterates through all parameters of a PyTorch model and counts only those that require gradients (i.e., trainable parameters).
omnigenbench/src/abc/abstract_model.py:28
↓ 1 callers
Function
create_enhanced_ssp_demo
Create enhanced secondary structure prediction demo
examples/rna_secondary_structure_prediction/enhanced_ssp_demo.py:624
↓ 1 callers
Function
create_parser
Creates the argument parser for the auto-train CLI. :return: An `argparse.ArgumentParser` instance.
omnigenbench/auto/auto_train/auto_train_cli.py:99
↓ 1 callers
Function
create_parser
Creates the argument parser for the benchmark CLI. Returns: An `argparse.ArgumentParser` instance.
omnigenbench/auto/auto_bench/auto_bench_cli.py:70
↓ 1 callers
Function
create_rna_design_parser
Create the parser for RNA design command.
omnigenbench/cli/ogb_cli.py:422
↓ 1 callers
Function
crossover
(population, num_points=3)
examples/rna_sequence_design/easy_rna_design_emoo.py:223
↓ 1 callers
Method
dataframe
MAVE‑NN wanted a pandas DataFrame. Here we simply return *seq_list* (for inspection) and a PyTorch tensor (N,) or (N,num_tasks) for y.
omnigenbench/src/explainability/shared_methods/squid_explainer.py:653
↓ 1 callers
Function
download_hf_model
Download a model from Hugging Face Hub to local directory. This function provides two download strategies: 1. HuggingFace Hub API (defau
omnigenbench/src/utility/model_hub/model_hub.py:191
↓ 1 callers
Function
download_model
Downloads a model from a given URL. It supports both remote and local-only modes. Args: config_or_model (str): The name or path of t
omnigenbench/src/utility/hub_utils.py:229
↓ 1 callers
Function
download_pipeline
Downloads a pipeline from a given URL. It supports both remote and local-only modes. Args: pipeline_name_or_path (str): The name or
omnigenbench/src/utility/hub_utils.py:329
↓ 1 callers
Method
encode
Encode a single sequence into pooled embeddings. Args: sequence (str): Input DNA or RNA sequence for encoding. max_le
omnigenbench/src/model/embedding/model.py:270
↓ 1 callers
Function
evaluate_structure_fitness
Evaluate the fitness of RNA sequences by comparing their predicted structures with the target structure. Args: sequences (list):
examples/rna_sequence_design/easy_rna_design_emoo.py:296
↓ 1 callers
Function
example_1_simple_hairpin
Example 1: Design a simple hairpin structure A hairpin is one of the most basic RNA secondary structures, consisting of a stem (base
examples/rna_sequence_design/rna_design_examples.py:19
↓ 1 callers
Function
example_2_custom_parameters
Example 2: Design with custom evolutionary parameters This example shows how to tune the genetic algorithm parameters for better exp
examples/rna_sequence_design/rna_design_examples.py:57
↓ 1 callers
Function
example_3_batch_design
Example 3: Batch design multiple structures Demonstrates efficient batch processing of multiple target structures, useful for large-
examples/rna_sequence_design/rna_design_examples.py:97
↓ 1 callers
Function
example_4_validate_designs
Example 4: Validate designed sequences Shows how to verify that designed sequences actually fold into the target structure using Vie
examples/rna_sequence_design/rna_design_examples.py:148
↓ 1 callers
Function
example_5_save_and_load
Example 5: Save designs and reload for analysis Demonstrates best practices for saving and organizing design results.
examples/rna_sequence_design/rna_design_examples.py:198
↓ 1 callers
Method
execute
Execute the autobench command with the provided arguments. It handles model and tokenizer loading, benchmark execution, and result lo
omnigenbench/cli/commands/bench/bench_cli.py:117
↓ 1 callers
Method
explain
Generates an explanation for a given input. This is the core method of any explainer and **must be implemented** by all concrete subc
omnigenbench/src/abc/abstract_explainer.py:39
↓ 1 callers
Method
explain
Computes the pairwise interaction matrix for a given sequence. This method calls the underlying SQUID explainer to generate the epistasis
omnigenbench/src/explainability/epistasis/explainer.py:62
↓ 1 callers
Method
explain
Generates an attribution matrix for a given sequence. This method uses the underlying explainer (e.g., 'squid') to compute the attrib
omnigenbench/src/explainability/sequence_logo/explainer.py:83
↓ 1 callers
Method
explain
Generates the 2D embeddings for the input sequences. This method acts as a wrapper, calling the `explain` method of the underlying di
omnigenbench/src/explainability/visualization_2d/explainer.py:69
↓ 1 callers
Function
extract_python_from_vscode_notebook
Extract Python code from VSCode notebook format. Args: notebook_path: Path to the .ipynb file in VSCode format Retu
tests/test_example_notebooks.py:72
↓ 1 callers
Function
find_linear_target_modules
This function searches through a model's modules to identify linear layers that can be adapted using LoRA. It supports filtering by keyword p
omnigenbench/src/lora/lora_model.py:19
↓ 1 callers
Method
fix_invalid_structure
Fix invalid base pairs in structure
examples/rna_secondary_structure_prediction/enhanced_ssp_demo.py:77
↓ 1 callers
Method
forward
Forward pass through the base model.
omnigenbench/src/utility/model_hub/model_hub.py:59
↓ 1 callers
Method
forward
Compute head logits and optional loss. Parameters ---------- features : dict Must contain ``hidden_state`` or ``s
omnigenbench/src/model/baselines.py:1856
↓ 1 callers
Method
from_hub
Create OmniDataset instances from HuggingFace Hub or local directory. This method supports loading datasets from: 1. OmniGen
omnigenbench/src/abc/abstract_dataset.py:394
↓ 1 callers
Method
from_pretrained
Create a k-mers tokenizer from a pre-trained model. Args: config_or_model (str): Name or path of the pre-trained model
omnigenbench/src/tokenizer/kmers_tokenizer.py:126
↓ 1 callers
Method
generate_interactive_html
Generate interactive HTML visualization with multiple structures
examples/rna_secondary_structure_prediction/enhanced_ssp_demo.py:144
↓ 1 callers
Function
generate_sequence
Generate a random RNA sequence.
examples/translation_efficiency_prediction/te_bpp_model.py:617
↓ 1 callers
Function
genetic_algorithm_for_rna_design
(structure, **kwargs)
examples/rna_sequence_design/easy_rna_design_emoo.py:93
↓ 1 callers
Method
get_attention_statistics
Compute comprehensive statistics from attention scores. Args: attention_scores (torch.Tensor): Attention tensor with shape (num_l
omnigenbench/src/abc/embedding_mixin.py:557
↓ 1 callers
Method
get_column
Returns all values for a specific column in the dataset. Args: column_name (str): The name of the column. Retur
omnigenbench/src/abc/abstract_dataset.py:1406
↓ 1 callers
Function
get_explainer
Retrieves an explainer class from the registry by its name. Args: name (str): The name of the explainer method to retrieve. Returns:
omnigenbench/src/explainability/epistasis/explainer.py:19
↓ 1 callers
Function
get_explainer
Retrieves an explainer class from the registry by name. This function acts as a factory to access different explanation methods that have bee
omnigenbench/src/explainability/sequence_logo/explainer.py:25
↓ 1 callers
Function
get_explainer
Retrieves an explainer class from the registry by its name. This function acts as a factory, allowing for dynamic selection of the dimensiona
omnigenbench/src/explainability/visualization_2d/explainer.py:20
↓ 1 callers
Function
get_model_info
Get metadata about a HuggingFace model repository. Args: repo_id (str): HuggingFace repository identifier token (Optional[st
omnigenbench/src/utility/model_hub/hf_download.py:295
↓ 1 callers
Method
get_params
Return (theta_0, theta_lc, theta_lclc). Pairwise parameters are only returned if gpmap_type == 'pairwise'.
omnigenbench/src/explainability/shared_methods/squid_explainer.py:854
↓ 1 callers
Method
inference
Perform inference on genomic sequences. This method provides a basic inference interface for pre-trained models that haven't
omnigenbench/src/utility/model_hub/model_hub.py:67
↓ 1 callers
Method
info
Print formatted dataset information in table format using tabulate. This method displays dataset_info in a human-readable table form
omnigenbench/src/abc/abstract_dataset.py:782
↓ 1 callers
Method
init_pipeline
This method handles loading the model, tokenizer, and configuration from a model path or identifier. It tries to load from the ModelH
omnigenbench/src/utility/pipeline_hub/pipeline.py:177
↓ 1 callers
Function
init_population
(structure, num_population, model, tokenizer)
examples/rna_sequence_design/easy_rna_design_emoo.py:146
↓ 1 callers
Function
init_population
(structure, num_population, model, tokenizer)
examples/rna_sequence_design/web_rna_design.py:169
↓ 1 callers
Function
is_bpe_tokenization
Check if the tokenization is BPE-based by analyzing token characteristics. This function examines the tokens to determine if they follow BPE
omnigenbench/src/tokenizer/bpe_tokenizer.py:17
↓ 1 callers
Function
is_vscode_notebook
Check if a notebook is in VSCode's XML format. Args: notebook_path: Path to the notebook file Returns: True
tests/test_example_notebooks.py:57
↓ 1 callers
Method
l2_regularizer
(self)
omnigenbench/src/explainability/shared_methods/squid_explainer.py:531
↓ 1 callers
Function
list_hf_repo_files
List all files in a HuggingFace repository. Args: repo_id (str): HuggingFace repository identifier repo_type (str): Type of
omnigenbench/src/utility/model_hub/hf_download.py:204
↓ 1 callers
Method
load
This static method loads a complete pipeline including model, tokenizer, datasets, and trainer from a saved pipeline directory or hub
omnigenbench/src/utility/pipeline_hub/pipeline.py:353
↓ 1 callers
Method
load_dataset_name_or_path
Loads data from a file or list of files. Args: dataset_name_or_path (str or list): Path to the data file or a list of pa
omnigenbench/src/abc/abstract_dataset.py:1067
↓ 1 callers
Method
load_embeddings
Load embeddings from a file. Args: embedding_path (str): Path to the saved embeddings Returns: torc
omnigenbench/src/abc/embedding_mixin.py:338
↓ 1 callers
Method
load_embeddings
Load embeddings from a file. Args: embedding_path (str): Path to the saved embeddings Returns: torc
omnigenbench/src/model/embedding/model.py:359
↓ 1 callers
Method
load_sequences_from_file
Load sequences from a JSON file. Args: input_file (str): Path to the input JSON file containing sequences Retur
omnigenbench/src/model/augmentation/model.py:91
↓ 1 callers
Function
main
Main entry point for the OGB (OmniGenBench) CLI. This provides a unified interface for all OmniGenBench command-line tools.
omnigenbench/cli/ogb_cli.py:519
↓ 1 callers
Function
main
The main entry point for the OmniGenome command-line interface. This function sets up the command-line argument parser and handles the execut
omnigenbench/cli/omnigenome_cli.py:18
↓ 1 callers
Function
main
Entry point for the autoinfer command-line interface. This function provides a standalone CLI for running inference with fine-tuned geno
omnigenbench/cli/autoinfer_cli.py:18
↓ 1 callers
Function
main
Run all examples demonstrating RNA design functionality.
examples/rna_sequence_design/rna_design_examples.py:257
↓ 1 callers
Function
main
Main entry point for the script.
examples/translation_efficiency_prediction/te_bpp_model.py:830
↓ 1 callers
Function
main
Main training function.
examples/translation_efficiency_prediction/te_with_bpp_features.py:328
↓ 1 callers
Method
model_info
Prints and returns detailed information about the model. :return: A string containing the model information.
omnigenbench/src/abc/abstract_model.py:1572
↓ 1 callers
Function
mutate
(sequence, mutation_rate)
examples/rna_sequence_design/easy_rna_design_emoo.py:175
↓ 1 callers
Function
mutate
(sequence, mutation_rate)
examples/rna_sequence_design/web_rna_design.py:193
↓ 1 callers
Function
non_dominated_sorting
(scores, mfe_values)
examples/rna_sequence_design/easy_rna_design_emoo.py:263
↓ 1 callers
Function
predict_structure
Predicts structures for multiple sequences using multithreading.
examples/rna_sequence_design/web_rna_design.py:64
↓ 1 callers
Function
predict_structure_single
Predicts the RNA structure for a single sequence.
examples/rna_sequence_design/web_rna_design.py:48
↓ 1 callers
Method
print_label_distribution
Print the distribution of labels for 0-dimensional (scalar) labels. This is useful for classification tasks where each sample has a s
omnigenbench/src/abc/abstract_dataset.py:555
↓ 1 callers
Function
query_models_info
This function retrieves model information from the OmniGenome hub, either from a remote repository or from a local cache. It supports fil
omnigenbench/src/utility/hub_utils.py:53
↓ 1 callers
Function
read_version_from_init
()
setup_omnigenbench.py:15
↓ 1 callers
Function
read_version_from_init
()
setup.py:15
↓ 1 callers
Method
register_command
This method sets up the command-line interface for the autobench functionality, including all necessary arguments and their descripti
omnigenbench/cli/commands/bench/bench_cli.py:45
↓ 1 callers
Method
register_command
This method sets up the command-line interface for RNA sequence design, including all necessary arguments and their descriptions.
omnigenbench/cli/commands/rna/rna_design.py:50
↓ 1 callers
Method
run
This method loads the dataset configuration, initializes the model and tokenizer, and runs training across multiple seeds. It support
omnigenbench/auto/auto_train/auto_train.py:175
↓ 1 callers
Function
run_all_tests
Run all tests.
examples/translation_efficiency_prediction/test_te_bpp_model.py:337
↓ 1 callers
Method
save_augmented_sequences
Save augmented sequences to a JSON file. Args: augmented_sequences (list): List of augmented sequences to save
omnigenbench/src/model/augmentation/model.py:250
← previous
next →
201–300 of 955, ranked by callers