Purpose
- This model was developed to practice development of ncRNA sequence generation
- It is highly experimental, and should not be used in any real-world environments where accuracy is paramount
Methodology
- We utilize a GATv2Conv (Graph Attention Network v2) architecture to predict RNA sequences that would fold towards a given structure
- The model takes a secondary structure in dot-bracket notation as input and predicts a nucleotide (A, U, G, C) at each position in a single forward pass (non-autoregressive)
- The idea is that a researcher might want to have a ncRNA with a specific structure that will fold into a desired shape
- They might know what structure would make this shape, but they do not know the sequence that makes that structure
Training Data
- Trained on synthetic RNA subsequences (25–50 nt) from three RFam families: RF04135 (medium conservation), RF04185 (low conservation), and RF04331 (high conservation)
- Sequences generated by cmemit from Infernal covariance models; secondary structures predicted by RhoFold and stored as .ct files
- 1,000 sequences per family, 10,000 subsequences total
Training Details
- Four GATv2Conv layers with 4-head attention, hidden dimension 128, LayerNorm, ELU activation, residual connections, and dropout (0.3)
- Adam optimizer with learning rate 1e-3, weight decay 1e-3, gradient clipping at norm 1.0
- ReduceLROnPlateau scheduler (factor 0.5, patience 5 epochs)
- Early stopping with patience of 15 epochs prevents overfitting
- Train/validation split is a seeded random 80/20 split
- Maximum 200 epochs, batch size 32
Usage
- For proper usage, view the GNN_Training_Example.ipynb file
AI Disclosure
- The code in this repo was written with assistance from Claude Code CLI tool.
The RhoDesign_Model/ folder contains the scripts used to process RNA data, prepare the fine-tuning dataset, fine-tune the RhoDesign model, and test the fine-tuned model on a single PDB file.
The full RhoDesign workflow is:
- Use the RhoFold pipeline to create or convert the generated subsequence dataset into the required structure files, including SSCT, PDB, and related outputs.
- Prepare the RhoDesign training dataset from the RhoFold output folder.
- Fine-tune the RhoDesign model using the prepared dataset.
- Test the fine-tuned model on a single PDB file.
This script is used first. It runs or organizes the RhoFold prediction pipeline and creates the needed output files, including SSCT, PDB, and other prediction-related files.
These outputs are later used for preparing the RhoDesign fine-tuning dataset.
python "Rhofold Prediction+Folder Seperation.py"This script prepares the dataset for RhoDesign fine-tuning.
It extracts and organizes data from the output folder generated by the RhoFold predictions. This preparation step was needed because the fine-tuning dataset used approximately 1000 samples from each RNA family.
python "prepare_rhodesign_daset for training.py"This is the main fine-tuning script.
It uses the prepared dataset to fine-tune the RhoDesign model on the processed RNA structure data.
python finetune_rhodesign_model.pyThis script is used after fine-tuning.
It tests the fine-tuned RhoDesign model on a single PDB file and generates an RNA sequence design for that structure.
python design_single_pdb_spyder.pyFrom inside the repository:
cd RhoDesign_Model
python "Rhofold Prediction+Folder Seperation.py"
python "prepare_rhodesign_daset for training.py"
python finetune_rhodesign_model.py
python design_single_pdb_spyder.pyBefore running the scripts, update any dataset paths, output folder paths, model checkpoint paths, and configuration paths so they match your local environment.