This repository contains scripts and data for analyzing double gyrase gene sequences and their mutations.
double_gyrae/
├── input/ # Input FASTA files and logits
├── figures/ # Generated plots and visualizations
├── scripts/ # Analysis scripts
├── output/ # Generated output files
├── run_evo.sh # EVO model execution script
└── README.md
- Sequences are provided in
input/double_genes.fastawith the following entries:double_83_ref: Reference double gyrase sequencedouble_83_TTT: Mutant sequence with TTT mutationdouble_random: Random sequence of the same length
From the project root directory, run:
# Run the EVO model
./run_evo.sh double-genes input/double_genes.fasta inputThis will:
- Create necessary directories under the specified output directory (e.g.,
input/output,input/jobs,input/figures) - Submit the job to the EVO model
- Download results when complete
- Save logits as
input_[sequence_name]_logits.npyinside<OUTPUT_DIR>/jobs/<JOB_ID>-v1/output/(with the example above:input/jobs/double-genes-v1/output/)
For the R analysis scripts, ensure the .npy files exist at:
input/input_[sequence_name]_logits.npy
If you used a different <OUTPUT_DIR>, copy or symlink the files from <OUTPUT_DIR>/jobs/<JOB_ID>-v1/output/ into input/ with the names input_[sequence_name]_logits.npy.
The analysis is performed using R scripts in the following order:
- Initialize Data Processing
scripts/handle_EVO2_output_v1.R # Handles logits file processing
scripts/evo2_analysis_functions_v1.R # Core analysis functions- Main Analysis Script
scripts/EVO_learned_resist.R # Generates all figuresThis script performs:
- Loads and processes logits data
- Calculates log-likelihoods
- Generates difference plots between sequences
- Creates visualizations for:
- Reference vs Random comparisons
- Mutant vs Random comparisons
- Second gene region analysis
- Transition region analysis
The analysis produces several PDF figures in the figures/ directory:
double_ref-random.pdf: Comparison of reference to random sequencedouble_mut-random.pdf: Comparison of mutant to random sequence83_TTT_2nd.pdf,83_ref_2nd.pdf: Analysis of second gene regiontrans_*.pdf: Analysis of transition regions
- R packages:
- Biostrings
- ggplot2
- reticulate (for Python integration)
- Python with numpy
- Clone the repository
- Place your FASTA files in the
input/directory - From the project root directory, run the EVO model:
./run_evo.sh double-genes input/double_genes.fasta input- Run the R analysis script:
source("scripts/EVO_learned_resist.R")- This analysis of double genes indicates that evo2 7b memorizes the gene sequence within ~25bp and can then accurately predict every bp of the repeated gene going forward
- The highlighted nucleotides are the first 3 nucleotides of the repeated gene