MCPcopy Create free account

hub / github.com/COLA-Laboratory/OmniGenBench / functions

Functions955 in github.com/COLA-Laboratory/OmniGenBench

↓ 2 callersMethod_predict_batch
Generate predictions for a batch using the model. Args: batch: Input batch Returns: Dict[str, torch
omnigenbench/src/trainer/trainer.py:112
↓ 2 callersMethod_predict_continuous
Forward pass returning *continuous* latent phenotypes, with optional GE non‑linearity, followed by task‑specific linear head. Used by both GE
omnigenbench/src/explainability/shared_methods/squid_explainer.py:815
↓ 2 callersMethod_predict_structure_single
Predict structure and MFE for a single sequence using ViennaRNA with bp-span control.
omnigenbench/src/model/rna_design/model.py:114
↓ 2 callersMethod_prepare_batch
Prepare a batch for model input. Args: batch: Input batch Returns: Prepared batch
omnigenbench/src/trainer/base_trainer.py:737
↓ 2 callersMethod_process_labels
Process labels for metric computation. Args: labels (torch.Tensor): Raw labels Returns: np.ndarray:
omnigenbench/src/trainer/base_trainer.py:762
↓ 2 callersMethod_process_predictions
Process predictions for metric computation. Args: predictions (torch.Tensor): Raw predictions Returns:
omnigenbench/src/trainer/base_trainer.py:774
↓ 2 callersMethod_save_epoch_checkpoint
Save model checkpoint after each epoch. Args: path_to_save (str): Base path for saving epoch (int): Current
omnigenbench/src/trainer/base_trainer.py:805
↓ 2 callersMethod_save_final_model
Save the final trained model. Args: path_to_save (str): Base path for saving **kwargs: Additional keyword ar
omnigenbench/src/trainer/base_trainer.py:826
↓ 2 callersMethod_save_state_dict
Save model state dictionary to temporary file.
omnigenbench/src/trainer/base_trainer.py:843
↓ 2 callersMethod_save_state_dict
Save the current model state dictionary.
omnigenbench/src/trainer/accelerate_trainer.py:552
↓ 2 callersMethod_tokens_to_one_hot
(self, input_ids: torch.Tensor)
omnigenbench/src/model/baselines.py:701
↓ 2 callersMethod_tokens_to_one_hot
(self, input_ids: torch.Tensor)
omnigenbench/src/model/baselines.py:994
↓ 2 callersMethod_tokens_to_one_hot
(self, input_ids: torch.Tensor)
omnigenbench/src/model/baselines.py:1255
↓ 2 callersMethodadd_common_arguments
This method adds standard arguments that are common across all OmniGenome CLI commands, such as logging level and output directory.
omnigenbench/cli/commands/base.py:53
↓ 2 callersMethodapply_noise_to_sequence
Apply noise to a single sequence by randomly masking tokens. Args: seq (str): Input genomic sequence Returns:
omnigenbench/src/model/augmentation/model.py:107
↓ 2 callersFunctionbench_command
This function parses command-line arguments, initializes the AutoBench, and runs the evaluation.
omnigenbench/auto/auto_bench/auto_bench_cli.py:33
↓ 2 callersFunctioncheck_bench_version
Check if benchmark version is compatible with OmniGenBench version. This function compares the benchmark version with the OmniGenBench versi
omnigenbench/src/misc/utils.py:465
↓ 2 callersFunctionclean_script_for_testing
Clean up the generated Python script to make it testable. Removes interactive elements and notebook magic commands. Args: sc
tests/test_example_notebooks.py:144
↓ 2 callersFunctionclean_temp_checkpoint
Clean up temporary checkpoint files older than specified days. This function removes temporary checkpoint files that are older than the
omnigenbench/src/misc/utils.py:405
↓ 2 callersMethodcompute_bpp_matrix
Compute Base Pairing Probability matrix using ViennaRNA. This method uses the partition function approach to calculate the
examples/translation_efficiency_prediction/te_bpp_model.py:138
↓ 2 callersFunctionconv3x3
3x3 convolution with padding. Args: in_planes (int): Number of input channels out_planes (int): Number of output channels
omnigenbench/src/model/regression/resnet.py:23
↓ 2 callersFunctionconvert_notebook_to_script
Convert a Jupyter notebook to a Python script using nbconvert. Args: notebook_path: Path to the .ipynb file Returns
tests/test_example_notebooks.py:95
↓ 2 callersFunctioncreate_demo_dataset
Create a demo dataset for testing. This function generates synthetic RNA sequences with random labels for demonstration purposes. In
examples/translation_efficiency_prediction/te_bpp_model.py:596
↓ 2 callersMethodevaluate
Evaluate the model on the validation dataset. Returns: Dict[str, Any]: Dictionary containing evaluation metrics
omnigenbench/src/trainer/base_trainer.py:619
↓ 2 callersFunctionevaluate_structure_fitness
(sequences, structure)
examples/rna_sequence_design/web_rna_design.py:223
↓ 2 callersMethodfit
End‑to‑end training loop with a 60/20/20 train/val/test split. Returns the trained *nn.Module* and the sequence list (for external eva
omnigenbench/src/explainability/shared_methods/squid_explainer.py:678
↓ 2 callersFunctiongenerate_svg_string
Generate an SVG string of the RNA fold.
examples/rna_sequence_design/web_rna_design.py:293
↓ 2 callersFunctiongenetic_algorithm_for_rna_design
(structure, visualize_generation_callback=None, **kwargs)
examples/rna_sequence_design/web_rna_design.py:77
↓ 2 callersMethodget_base_pairs
Extract base pairs from dot-bracket structure
examples/rna_secondary_structure_prediction/enhanced_ssp_demo.py:130
↓ 2 callersFunctionmlm_mutate
(population, structure, model, tokenizer, mutation_ratio)
examples/rna_sequence_design/easy_rna_design_emoo.py:174
↓ 2 callersFunctionmlm_mutate
(population, structure, model, tokenizer, mutation_ratio)
examples/rna_sequence_design/web_rna_design.py:192
↓ 2 callersFunctionmlm_predict
(mlm_inputs, structure, model, tokenizer)
examples/rna_sequence_design/easy_rna_design_emoo.py:378
↓ 2 callersFunctionmlm_predict
(mlm_inputs, structure, model, tokenizer)
examples/rna_sequence_design/web_rna_design.py:241
↓ 2 callersMethodnumeric_agg
Aggregate a list of numeric values. Args: result (list): A list of numeric values to aggregate Returns:
omnigenbench/src/utility/ensemble.py:113
↓ 2 callersMethodpostprocess
Default identity post-processing (override in subclasses).
omnigenbench/src/model/baselines.py:1873
↓ 2 callersFunctionpredict_structure_single
Predicts the RNA structure for a single sequence.
examples/rna_sequence_design/easy_rna_design_emoo.py:76
↓ 2 callersFunctionresnet_b16
This function creates a ResNet model with 16 basic blocks, optimized for processing genomic sequences and their structural representations.
omnigenbench/src/model/regression/resnet.py:463
↓ 2 callersMethodsave_model
Save the trained model. Args: path (str): Path to save the model overwrite (bool): Whether to overwrite exis
omnigenbench/src/trainer/base_trainer.py:721
↓ 2 callersMethodsave_model
Save the trained model. Args: path_to_save (str): Path to save the model overwrite (bool): Whether to overwr
omnigenbench/src/trainer/hf_trainer.py:266
↓ 2 callersMethodsave_model
Save the trained model. Args: path_to_save (str): Path to save the model overwrite (bool): Whether to overwr
omnigenbench/src/trainer/trainer.py:384
↓ 2 callersFunctionsvg_to_html
Convert SVG string to HTML code that can be displayed in Gradio HTML component.
examples/rna_sequence_design/web_rna_design.py:315
↓ 2 callersMethodtokenize
Convert sequence(s) into k-mers. This method breaks the input sequence(s) into overlapping k-mers based on the configured k-
omnigenbench/src/tokenizer/kmers_tokenizer.py:149
↓ 2 callersFunctiontrain_te_model
Train a translation efficiency prediction model with BPP features. This is a high-level function that handles the entire training pipeli
examples/translation_efficiency_prediction/te_bpp_model.py:646
↓ 1 callersMethod__init__
(self, *args, **kwargs)
omnigenbench/src/abc/abstract_dataset.py:64
↓ 1 callersMethod__init__
Initialize the ModelHub instance. Args: *args: Additional positional arguments **kwargs: Additional keyword
omnigenbench/src/utility/model_hub/model_hub.py:428
↓ 1 callersMethod__init__
Initialize the OmniPooling layer. Args: config: Model configuration object containing architecture information
omnigenbench/src/model/module_utils.py:34
↓ 1 callersMethod__init__
Initialize the HuggingFace trainer wrapper. Args: model (torch.nn.Module): The model to be trained training_
omnigenbench/src/trainer/hf_trainer.py:56
↓ 1 callersMethod__init__
Initialize the dataset. Args: dataset_name_or_path: Path to dataset or dataset name tokenizer: Token
examples/translation_efficiency_prediction/te_with_bpp_features.py:37
↓ 1 callersMethod__repr__
String representation of the cache.
omnigenbench/src/misc/utils.py:107
↓ 1 callersMethod__repr__
Return a formatted, human-readable string representation of the metrics. Returns: str: A formatted string showing metric
omnigenbench/src/trainer/base_trainer.py:38
↓ 1 callersMethod__setattr__
Set the value of an argument and add it to the argument dict and call count dict. :param arg_name: The name of the argument.
omnigenbench/auto/config/auto_config.py:62
↓ 1 callersMethod_build_config_dict
(self)
omnigenbench/src/model/baselines.py:180
↓ 1 callersMethod_build_config_dict
(self)
omnigenbench/src/model/baselines.py:454
↓ 1 callersMethod_build_config_dict
(self)
omnigenbench/src/model/baselines.py:726
↓ 1 callersMethod_build_config_dict
(self)
omnigenbench/src/model/baselines.py:1021
↓ 1 callersMethod_build_config_dict
(self)
omnigenbench/src/model/baselines.py:1276
↓ 1 callersMethod_build_config_dict
Return a serializable dictionary for ``save_pretrained``. The dictionary includes both backbone hyperparameters and head/task info.
omnigenbench/src/model/baselines.py:2146
↓ 1 callersMethod_build_config_dict
(self)
omnigenbench/src/model/baselines.py:2761
↓ 1 callersMethod_calculate_loss
Internal method to calculate loss if not already present in outputs. :param outputs: The dictionary of model outputs. :param
omnigenbench/src/abc/abstract_model.py:675
↓ 1 callersMethod_collect_metadata
Collect all metadata to be saved with the model. This method gathers comprehensive metadata about the model, including: - Lo
omnigenbench/src/abc/abstract_model.py:805
↓ 1 callersMethod_compute_loss
Compute loss from model outputs. Args: outputs (Dict[str, torch.Tensor]): Model outputs Returns: to
omnigenbench/src/trainer/accelerate_trainer.py:184
↓ 1 callersMethod_compute_loss
Compute loss from model outputs. Args: outputs (Dict[str, torch.Tensor]): Model outputs Returns: to
omnigenbench/src/trainer/trainer.py:226
↓ 1 callersMethod_crossover
Multi-point crossover between randomly chosen parents.
omnigenbench/src/model/rna_design/model.py:232
↓ 1 callersMethod_ensure_local_model_path
Resolve the provided identifier to a local directory, downloading from Hugging Face first and falling back to the OmniGenome hub.
omnigenbench/src/utility/model_hub/model_hub.py:489
↓ 1 callersMethod_evaluate_structure_fitness
Evaluate sequences by folding and computing hamming distance to target structure; select via NSGA-like fronts.
omnigenbench/src/model/rna_design/model.py:301
↓ 1 callersMethod_find_class_in_package
Search for a class inside a package (OmniGenBench first).
omnigenbench/src/utility/model_hub/model_hub.py:549
↓ 1 callersMethod_forward_impl
Forward pass implementation. Args: x (Tensor): Input tensor [batch_size, channels, height, width] Returns:
omnigenbench/src/model/regression/resnet.py:427
↓ 1 callersMethod_generate_in_silico_mave
(Private) Generates an in-silico MAVE dataset. This helper function creates a dataset of mutated sequences by randomly perturbing the
omnigenbench/src/explainability/shared_methods/lime_explainer.py:98
↓ 1 callersMethod_generate_in_silico_mave
(Private) Generate single-mutation variants of the sequence. This function creates all possible point mutations of the input sequence,
omnigenbench/src/explainability/shared_methods/ism_explainer.py:101
↓ 1 callersMethod_generate_in_silico_mave
(Private) Generates an in-silico MAVE dataset. This helper function creates a dataset of mutated sequences and uses the provided deep
omnigenbench/src/explainability/shared_methods/squid_explainer.py:173
↓ 1 callersFunction_infer_optimization_direction
Infer the optimization direction based on metric values. This function analyzes the trend of metric values to determine whether larger v
omnigenbench/src/trainer/base_trainer.py:127
↓ 1 callersMethod_init_custom_layers
Initialize weights for custom layers using Xavier initialization.
examples/translation_efficiency_prediction/te_bpp_model.py:508
↓ 1 callersMethod_init_fusion_layers
Initialize weights for new layers.
examples/translation_efficiency_prediction/te_with_bpp_features.py:255
↓ 1 callersMethod_init_population
Initialize the population via MLM conditioned on target structure.
omnigenbench/src/model/rna_design/model.py:155
↓ 1 callersMethod_is_causal_lm
Check if the model is a causal language model. Determines if the model architecture is causal based on the configuration. R
omnigenbench/src/model/module_utils.py:108
↓ 1 callersMethod_load_config
Load model configuration and check for differences with current config. This method loads the saved configuration and compares it wi
omnigenbench/src/abc/abstract_model.py:1044
↓ 1 callersMethod_load_dataset_class
Restore the dataset class from metadata. This method attempts to dynamically import the dataset class that was saved with th
omnigenbench/src/abc/abstract_model.py:1083
↓ 1 callersMethod_load_dataset_info
Load dataset_info.json from the dataset directory. This method searches for dataset_info.json in the directory containing th
omnigenbench/src/abc/abstract_dataset.py:740
↓ 1 callersMethod_load_loss_function
Restore saved loss function from metadata. This method attempts to restore the loss function that was used during training b
omnigenbench/src/abc/abstract_model.py:1153
↓ 1 callersMethod_load_metadata
Load and validate metadata from saved model directory. This method reads the metadata.json file and performs validation to e
omnigenbench/src/abc/abstract_model.py:1007
↓ 1 callersMethod_load_metadata
(path)
omnigenbench/src/utility/model_hub/model_hub.py:534
↓ 1 callersMethod_load_state_dict
Load model state dictionary from temporary file.
omnigenbench/src/trainer/base_trainer.py:855
↓ 1 callersMethod_load_state_dict
Load the best model state dictionary.
omnigenbench/src/trainer/accelerate_trainer.py:543
↓ 1 callersMethod_load_tokenizer
Load saved tokenizer from binary file. This method deserializes the tokenizer that was saved using dill. The tokenizer is es
omnigenbench/src/abc/abstract_model.py:1242
↓ 1 callersMethod_load_weights
Load model weights with validation and compatibility checks. This method loads the saved state dictionary and performs thorough
omnigenbench/src/abc/abstract_model.py:1193
↓ 1 callersMethod_make_layer
Create a layer of ResNet blocks. Args: block: Type of ResNet block to use planes (int): Number of output cha
omnigenbench/src/model/regression/resnet.py:366
↓ 1 callersMethod_mut_predictor
(Private) Predicts the model's output for a list of mutated sequences. This helper function queries the model for the predictions of a list
omnigenbench/src/explainability/shared_methods/lime_explainer.py:170
↓ 1 callersMethod_mut_predictor
(Private) Predict the model's output for a list of mutated sequences. This function uses the model to predict the output for each mutated seq
omnigenbench/src/explainability/shared_methods/ism_explainer.py:134
↓ 1 callersMethod_non_dominated_sorting
(scores, mfe_values)
omnigenbench/src/model/rna_design/model.py:264
↓ 1 callersMethod_pad_and_truncate
Pads and truncates sequences in the dataset to a uniform length. The length is determined dynamically based on the longest sequence i
omnigenbench/src/abc/abstract_dataset.py:616
↓ 1 callersMethod_postprocessing
Performs postprocessing on the tokenized data. This method standardizes the 'labels' field and prints the label distribution
omnigenbench/src/abc/abstract_dataset.py:1321
↓ 1 callersMethod_preprocessing
Performs preprocessing on the loaded examples. This method standardizes the 'sequence' field and adds secondary structure inf
omnigenbench/src/abc/abstract_dataset.py:1292
↓ 1 callersMethod_remove_state_dict
Remove temporary state dictionary file.
omnigenbench/src/trainer/base_trainer.py:866
↓ 1 callersMethod_remove_state_dict
Remove the temporary model state dictionary file.
omnigenbench/src/trainer/accelerate_trainer.py:565
↓ 1 callersMethod_resolve_model_class
Resolve the model class, prioritizing OmniGenBench, then custom files.
omnigenbench/src/utility/model_hub/model_hub.py:586
↓ 1 callersMethod_save_base_files
Copy base model configuration files to save directory. This method copies essential configuration files from the original model
omnigenbench/src/abc/abstract_model.py:699
↓ 1 callersMethod_save_custom_dataset_class
Save custom dataset class source file if available. This method saves the source code of custom dataset classes associated w
omnigenbench/src/abc/abstract_model.py:761
↓ 1 callersMethod_save_custom_model_class
Save custom model class source file if it's user-defined. This method detects and saves the source code of custom model classes
omnigenbench/src/abc/abstract_model.py:723
↓ 1 callersMethod_save_weights
Save model weights and tokenizer to disk. This method handles the serialization of model weights and tokenizer. It attempts
omnigenbench/src/abc/abstract_model.py:869
↓ 1 callersMethod_select_next_generation
(next_generation, fronts)
omnigenbench/src/model/rna_design/model.py:292
← previousnext →101–200 of 955, ranked by callers