### Evo2 Environment Setup Source: https://github.com/morrislab/mrnabench/blob/main/README.md Installs the necessary dependencies for running Evo2 inference, requiring an H100 GPU. It sets up a Conda environment and installs PyTorch, vtx, evo2, and flash-attn. ```bash conda create --name evo_bench -c conda-forge python=3.11 gxx=12.2.0 -y conda activate evo_bench pip install torch==2.6.0+cu124 --index-url https://download.pytorch.org/whl/cu124 pip install vtx==1.0.4 pip install evo2==0.2.0 pip install flash-attn==2.7.4.post1 cd path/to/mRNA/bench pip install -e . ``` -------------------------------- ### Install mRNABench (Datasets Only) Source: https://github.com/morrislab/mrnabench/blob/main/README.md Installs the mRNABench package for accessing benchmark datasets. This is the minimal installation for dataset usage. ```shell pip install mrna-bench ``` -------------------------------- ### mRNABench Dev Mode Setup Source: https://github.com/morrislab/mrnabench/blob/main/README.md Sets up the development environment for mRNABench, enabling dataset generation and access to the RNA-Fazal localization dataset. It requires specific Conda and pip installations. ```bash conda create --name mrna_bench_dev python=3.10 conda activate mrna_bench_dev # Install genome-kit first conda install -c conda-forge genome_kit=7.1.0 conda install -c conda-forge gcc_linux-64 gxx_linux-64 # Note: You might need to add gcc compilers to LD_LIBRARY_PATH if you encounter linking issues pip install torch==2.2.2 --index-url https://download.pytorch.org/whl/cu121 pip install mrna-bench[base_models] ``` -------------------------------- ### Embed Dataset with a Foundation Model and Perform Linear Probing Source: https://github.com/morrislab/mrnabench/blob/main/README.md An example of using mRNABench to load a model, generate embeddings for a dataset, and then build and run a linear probe for evaluation. It includes model loading, embedding generation, splitter configuration, and evaluator setup. ```python import torch import mrna_bench as mb from mrna_bench.embedder import DatasetEmbedder from mrna_bench.linear_probe import LinearProbeBuilder device = torch.device("cuda") dataset = mb.load_dataset("go-mf") model = mb.load_model("Orthrus", "orthrus-large-6-track", device) embedder = DatasetEmbedder(model, dataset) embeddings = embedder.embed_dataset() embeddings = embeddings.detach().cpu().numpy() prober = (LinearProbeBuilder(dataset) .fetch_embedding_by_embedding_instance("orthrus-large-6", embeddings) .build_splitter("homology", species="human", eval_all_splits=False) .build_evaluator("multilabel") .set_target("target") .build() ) metrics = prober.run_linear_probe(2541) print(metrics) ``` -------------------------------- ### Model Integration Guide Source: https://github.com/morrislab/mrnabench/blob/main/README.md Details the process for integrating new DNA foundation models into the framework. It covers inheritance requirements, dependency management, essential methods to implement, and the registration process. ```APIDOC EmbeddingModel Integration Guide: All models should inherit from the template `EmbeddingModel`. Each model file should lazily load dependencies within its `__init__` methods so each model can be used individually without installing all other models. Required Methods: - `get_model_short_name(model_version)`: Fetches the internal name for the model. This must be unique for every model version and must not contain underscores. - `embed_sequence` or `embed_sequence_sixtrack`: Implement one of these methods for sequence embedding. Registration: - New models should be added to `MODEL_CATALOG`. Example Structure (Conceptual): class MyNewModel(EmbeddingModel): def __init__(self, model_version, **kwargs): super().__init__(**kwargs) # Lazily load dependencies here self._model_version = model_version self._internal_name = self.get_model_short_name(model_version) def get_model_short_name(self, model_version): # Return unique, underscore-free name return f"mynewmodel_{model_version.replace('.', '_')}" def embed_sequence(self, sequence): # Implementation for sequence embedding pass # Add to catalog MODEL_CATALOG["mynewmodel"] = MyNewModel ``` -------------------------------- ### Install mRNABench with Base Models Source: https://github.com/morrislab/mrnabench/blob/main/README.md Installs the inference-capable version of mRNABench, including support for most base models. Requires PyTorch 2.2.2 and CUDA 12.1+. ```bash conda create --name mrna_bench python=3.10 conda activate mrna_bench pip install torch==2.2.2 --index-url https://download.pytorch.org/whl/cu121 pip install mrna-bench[base_models] ``` -------------------------------- ### Visualize MRLs by Feature Combinations Source: https://github.com/morrislab/mrnabench/blob/main/experiments/mrl_compositionality.ipynb Visualizes the Mean Ribosome Load (MRL) for different combinations of Kozak quality and upstream start codon presence. It preprocesses data, creates feature combination labels, calculates mean MRLs, and generates a point plot with standard deviation error bars. Requires pandas, seaborn, and matplotlib. ```python import pandas as pd import seaborn as sns import matplotlib.pyplot as plt subset_df = data_df[data_df['kozak_quality'] != 'mixed'] # Create a new column with the combination labels subset_df['feature_combo'] = subset_df.apply( lambda row: f"uAUG: {bool(row['u_start'])},\n{row['kozak_quality']} Kozak", axis=1 ) y = 'target_mrl_egfp_unmod' # Sort combos by mean MRL for nicer ordering mean_mrls = subset_df.groupby('feature_combo')[y].mean().sort_values(ascending=False) print("Mean mrls:\n", mean_mrls) ordered_combos = mean_mrls.index.tolist() # Set up the plot plt.figure(figsize=(4, 5)) sns.set(style="white", font_scale=1.2) # Use boxplot (or use sns.barplot for mean + CI) sns.pointplot( x='feature_combo', y='target_mrl_egfp_unmod', data=subset_df, order=ordered_combos, palette="viridis", errorbar='sd' ) plt.xlabel("") plt.ylabel(y) plt.xticks(rotation=90) sns.despine() # removes top and right spines plt.tight_layout() plt.show() ``` -------------------------------- ### Configure Data and Model Paths Source: https://github.com/morrislab/mrnabench/blob/main/README.md Sets the directories where benchmark data and model weights will be stored. This is a post-installation step. ```python import mrna_bench as mb path_to_dir_to_store_data = "DESIRED_PATH" mb.update_data_path(path_to_dir_to_store_data) path_to_dir_to_store_weights = "DESIRED_PATH_FOR_MODEL_WEIGHTS" mb.update_model_weights_path(path_to_dir_to_store_weights) ``` -------------------------------- ### Load and Access Benchmark Datasets Source: https://github.com/morrislab/mrnabench/blob/main/README.md Demonstrates how to load a specific benchmark dataset (e.g., 'go-mf') and access its data as a pandas DataFrame. ```python import mrna_bench as mb dataset = mb.load_dataset("go-mf") data_df = dataset.data_df ``` -------------------------------- ### Load mrnabench Dataset Source: https://github.com/morrislab/mrnabench/blob/main/experiments/mrl_compositionality.ipynb Loads a sample dataset from the mrnabench library for MRL compositionality analysis. Requires the 'mrna_bench' library. The loaded dataset is stored in a pandas DataFrame. ```python import mrna_bench as mb dataset = mb.load_dataset("mrl-sample-egfp") data_df = dataset.data_df ``` -------------------------------- ### Adding a New Dataset to MRNABench Source: https://github.com/morrislab/mrnabench/blob/main/README.md Guidelines for contributing new datasets to the MRNABench benchmark. New datasets must inherit from `BenchmarkDataset`, process raw data into a specific dataframe format, and adhere to naming conventions. Specific columns are required based on the task, such as `gene` for homology splitting and `cds`, `splice` for six-track embedding. ```APIDOC BenchmarkDataset: __init__(self, ...) # Base class for all datasets. process_raw_data(self, raw_data_path: str) -> pd.DataFrame # Abstract method to process raw data into a pandas DataFrame. # Must be overridden by subclasses. # Input: Path to raw data files. # Output: DataFrame with transcripts as rows. # Requirements for new datasets: # - Dataset names cannot contain underscores. # - Must download raw data and process it. # - DataFrame structure: # - Rows: Transcripts # - 'sequence' column: String encoding of the transcript sequence. # - 'gene' column: Required if homology splitting is needed, containing gene names. # - 'cds' and 'splice' columns: Required for six-track embedding. # - Target column: Name can be specified at time of probing. # - New datasets must be added to DATASET_CATALOG. ``` -------------------------------- ### Submit AIDO.RNA Binary Essentiality SLURM Jobs Source: https://github.com/morrislab/mrnabench/blob/main/scripts/linear_probe/slurm/README.md Submits SLURM jobs for AIDO.RNA analysis focusing on binary essentiality. These commands specify the model, dataset, analysis type (classification), target (essentiality), and experimental condition (haploid or shared). ```bash sbatch modelname_slurm.sh AIDO.RNA aido_rna_1b600m_cds lncrna-ess-hap1 classification essential_HAP1 ss True sbatch modelname_slurm.sh AIDO.RNA aido_rna_1b600m_cds pcg-ess-hap1 classification essential_HAP1 ss True sbatch modelname_slurm.sh AIDO.RNA aido_rna_650m_cds lncrna-ess-hap1 classification essential_HAP1 ss True sbatch modelname_slurm.sh AIDO.RNA aido_rna_650m_cds pcg-ess-hap1 classification essential_HAP1 ss True sbatch modelname_slurm.sh AIDO.RNA aido_rna_1b600m_cds pcg-ess-shared classification essential_SHARED ss True sbatch modelname_slurm.sh AIDO.RNA aido_rna_1b600m_cds lncrna-ess-shared classification essential_SHARED ss True sbatch modelname_slurm.sh AIDO.RNA aido_rna_650m_cds pcg-ess-shared classification essential_SHARED ss True sbatch modelname_slurm.sh AIDO.RNA aido_rna_650m_cds lncrna-ess-shared classification essential_SHARED ss True ``` -------------------------------- ### mRNABench Citation Source: https://github.com/morrislab/mrnabench/blob/main/README.md Provides the BibTeX entry for citing the mRNABench project in academic publications. It includes author, title, publication details, and DOI. ```bibtex @article{shi_dalal_fradkin_2025_mrnabench, author = {Shi, Ruian and Dalal, Taykhoom and Fradkin, Philip and Koyyalagunta, Divya and Chhabria, Simran and Jung, Andrew and Tam, Cyrus and Ceyhan, Defne and Lin, Jessica and Laverty, Kaitlin U. and Baali, Ilyes and Wang, Bo and Morris, Quaid}, title = {mRNABench: A curated benchmark for mature mRNA property and function prediction}, elocation-id = {2025.07.05.662870}, year = {2025}, doi = {10.1101/2025.07.05.662870}, publisher = {Cold Spring Harbor Laboratory}, URL = {https://www.biorxiv.org/content/early/2025/07/08/2025.07.05.662870}, eprint = {https://www.biorxiv.org/content/early/2025/07/08/2025.07.05.662870.full.pdf}, journal = {bioRxiv} } ``` -------------------------------- ### Inspect Loaded Dataset Head Source: https://github.com/morrislab/mrnabench/blob/main/experiments/mrl_compositionality.ipynb Displays the first row of the loaded dataset DataFrame to inspect its structure and column names. This is useful for understanding the available data before further analysis. ```python data_df.head(1) ``` -------------------------------- ### Submit AIDO.RNA Day 14 LogFc SLURM Jobs Source: https://github.com/morrislab/mrnabench/blob/main/scripts/linear_probe/slurm/README.md Submits SLURM jobs for AIDO.RNA analysis to calculate Day 14 LogFc. These commands specify the model, dataset, analysis type (ridge regression), target (log2fc), and experimental condition (haploid). ```bash sbatch modelname_slurm.sh AIDO.RNA aido_rna_1b600m_cds lncrna-ess-hap1 reg_ridge day14_log2fc_HAP1 ss True sbatch modelname_slurm.sh AIDO.RNA aido_rna_1b600m_cds pcg-ess-hap1 reg_ridge day14_log2fc_HAP1 ss True sbatch modelname_slurm.sh AIDO.RNA aido_rna_650m_cds lncrna-ess-hap1 reg_ridge day14_log2fc_HAP1 ss True sbatch modelname_slurm.sh AIDO.RNA aido_rna_650m_cds pcg-ess-hap1 reg_ridge day14_log2fc_HAP1 ss True ``` -------------------------------- ### Count Feature Combinations Source: https://github.com/morrislab/mrnabench/blob/main/experiments/mrl_compositionality.ipynb Calculates and displays the counts for each unique feature combination ('feature_combo') in the processed DataFrame, sorted alphabetically. This helps understand the distribution of data points across different feature groups. ```python subset_df['feature_combo'].value_counts().sort_index() ``` -------------------------------- ### Submit RiNALMo Binary Essentiality SLURM Jobs Source: https://github.com/morrislab/mrnabench/blob/main/scripts/linear_probe/slurm/README.md Submits SLURM jobs for RiNALMo analysis focusing on binary essentiality. These commands specify the model, dataset, analysis type (classification), target (essentiality), and experimental condition (haploid or shared). ```bash sbatch modelname_slurm.sh RiNALMo rinalmo lncrna-ess-hap1 classification essential_HAP1 ss True sbatch modelname_slurm.sh RiNALMo rinalmo pcg-ess-hap1 classification essential_HAP1 ss True sbatch modelname_slurm.sh RiNALMo rinalmo pcg-ess-shared classification essential_SHARED ss True sbatch modelname_slurm.sh RiNALMo rinalmo lncrna-ess-shared classification essential_SHARED ss True ``` -------------------------------- ### Submit RiNALMo Day 14 LogFc SLURM Jobs Source: https://github.com/morrislab/mrnabench/blob/main/scripts/linear_probe/slurm/README.md Submits SLURM jobs for RiNALMo analysis to calculate Day 14 LogFc. These commands specify the model, dataset, analysis type (ridge regression), target (log2fc), and experimental condition (haploid). ```bash sbatch modelname_slurm.sh RiNALMo rinalmo lncrna-ess-hap1 reg_ridge day14_log2fc_HAP1 ss True sbatch modelname_slurm.sh RiNALMo rinalmo pcg-ess-hap1 reg_ridge day14_log2fc_HAP1 ss True ``` -------------------------------- ### Perform Pairwise T-tests and FDR Correction Source: https://github.com/morrislab/mrnabench/blob/main/experiments/mrl_compositionality.ipynb Performs independent samples t-tests between all unique pairs of feature combinations to compare their MRL values. It then applies Benjamini-Hochberg (FDR) correction for multiple comparisons and reports only the statistically significant pairwise comparisons. Requires itertools, scipy.stats, and statsmodels. ```python from itertools import combinations from scipy.stats import ttest_ind from statsmodels.stats.multitest import multipletests # All unique pairs combos = subset_df['feature_combo'].unique() pairs = list(combinations(combos, 2)) # Perform t-tests results = [] for a, b in pairs: group_a = subset_df[subset_df['feature_combo'] == a]['target_mrl_egfp_unmod'] group_b = subset_df[subset_df['feature_combo'] == b]['target_mrl_egfp_unmod'] stat, pval = ttest_ind(group_a, group_b, equal_var=False) results.append((a, b, pval)) # Multiple testing correction pvals = [x[2] for x in results] reject, pvals_corrected, _, _ = multipletests(pvals, method='fdr_bh') # Create a significance table sig_results = pd.DataFrame(results, columns=['Group1', 'Group2', 'raw_pval']) sig_results['adj_pval'] = pvals_corrected sig_results['significant'] = reject # Show significant comparisons only sig_results = sig_results[sig_results['significant']].sort_values('adj_pval') print("Significant pairwise comparisons (FDR-adjusted):") print(sig_results[['Group1', 'Group2', 'adj_pval']]) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.