What this project is actually solving
The goal of the competition was to predict RNA 3D structure from sequence alone. That sounds simple, but the challenge is that RNA folds through long-range spatial interactions, and those interactions can involve sequences far beyond the context window of a normal model. In practice, that means a good solution has to do more than "run a model": it has to manage sequence length, select the right method for the right target, and still produce a valid final submission under a strict runtime budget.
My solution uses a hybrid strategy. When a target has a strong known template, I adapt that template through alignment-based mapping. When it does not, I hand the target to Protenix for de-novo inference. For the hardest cases, I also support a second deep-learning pass with a different seed to improve diversity across the 10 required prediction slots. That is the same runtime flow documented in the project's main entry point.
Why the pipeline is hybrid instead of single-model
The reason this project is interesting is that it does not bet everything on one method. The pipeline starts with Template-Based Modeling because an aligned and valid template is often much cheaper and more reliable than starting from scratch. The repository's TBM phase searches for homologous sequences, adapts coordinates to the target, and fills the remaining slots with physically plausible variants instead of random noise.
Anything TBM cannot confidently fill moves to Protenix. That stage handles the de-novo predictions,
including the logic for overlapping chunks when the RNA sequence is longer than the model context.
The code in protenix_inference.py explicitly builds chunked tasks, runs inference per chunk, and
then stitches the outputs back together.
The code path from start to finish
The actual runtime order is easy to describe because main.py is built like a pipeline controller.
It preprocesses the input, builds the template pool, creates the exact-match index, runs TBM first,
sends the leftover targets to Protenix, optionally attempts RhoFold+, and then assembles the final
submission. That sequence is not an interpretation; it is the project's top-level design.
def main():
...
template_preds, protenix_queue = tbm_phase(
test_df, combined_seqs, train_coords, segments_map, exact_idx=exact_idx
)
protenix_preds = run_protenix(protenix_queue, work_dir, code_dir, root_dir, seed=101)
if USE_RHOFOLD and protenix_queue:
rhofold_preds = run_rhofold(protenix_queue, work_dir_rho, combined_seqs, exact_idx)
...
Note: This is the part that shows the system-level design: template first, neural inference second, and final assembly at the end.
Template-Based Modeling: what it does and why it matters
TBM is the part that makes the project feel like an engineered system instead of a single-model
notebook. In tbm.py, the code builds a global aligner, searches the training set for similar
sequences, adapts template coordinates to the query, and then produces structured variants by
perturbing the adapted backbone. That means the first prediction slot is not just a copied
template; it is a target-aligned structure that has been adjusted to fit the query sequence.
The part I would highlight in an interview is that the diversity steps are not random. The code explicitly generates physically plausible variants through hinge rotations, rigid-body shifts, and smooth deformations so that the 10 required outputs are not redundant copies. The repository explains this as a deliberate strategy because the scorer chooses the best of the 10 samples.
Representative TBM snippet
aln = next(iter(_aligner.align(query_seq, template_seq)))
new_c = np.full((len(query_seq), 3), np.nan)
for (qs, qe), (ts, te) in zip(*aln.aligned):
chunk = template_coords[ts:te]
if len(chunk) == (qe - qs):
new_c[qs:qe] = chunk
return np.nan_to_num(new_c)
Long-sequence handling and stitching
One of the hardest engineering problems in this project is length. The model has a fixed context window, but some competition targets are thousands of nucleotides long. The repository solves that with overlapping windows. The sequence is split into chunks, the chunks are capped when the target is very long, and then the results are stitched back together using Kabsch alignment so the coordinate frame stays consistent across chunk boundaries.
This is a big deal because a naive split-and-concatenate approach would leave discontinuities at the boundaries. The project avoids that by aligning the overlap region before merging the next chunk into the assembled structure. In other words, the stitching step is not cosmetic; it is what makes the long-sequence solution usable.
if seq_len > MAX_SEQ_LEN:
raw_chunks = split_into_chunks(seq_len, MAX_SEQ_LEN, CHUNK_OVERLAP)
chunks = cap_chunks(raw_chunks, seq_len, target_id)
Configuration choices that shape the whole system
The configuration file makes the design choices very explicit. MAX_SEQ_LEN is set to 512, overlap is
192, and the dual-seed strategy is restricted to shorter hard targets so the second pass only happens
where it actually adds structural diversity. The pLDDT discard filter is disabled by design because the
project notes show it caused scoring instability, while USE_RHOFOLD is left off because the RNA-FM
tokenisation path was causing CUDA device-side asserts.
MAX_SEQ_LEN = 512
CHUNK_OVERLAP = 192
DUAL_SEED_MAX_SEQ_LEN = 600
PLDDT_DISCARD_THRESHOLD = -99.0
USE_RHOFOLD = False
What happened with RhoFold+
RhoFold+ is included in the repository because I did evaluate it, but it is not part of the final
active runtime path. The notes in rhofold_inference.py explain that the RNA-FM tokenisation path
was producing out-of-range token IDs, which triggered CUDA device-side asserts and risked corrupting
the GPU state for the rest of the run. Because of that, the code disables RhoFold+ rather than forcing
an unstable dependency into the submission pipeline.
Why the result is worth showing
The final outcome was a top 17% Kaggle finish, with a score of 0.426 lDDT, and the project handled test targets ranging from 19 nucleotides up to 4,640 nucleotides. That is a meaningful result because it shows the system worked across small, medium, and very large structures rather than only on easy cases.
For a portfolio, this project is valuable because it demonstrates system design, sequence alignment, model orchestration, GPU-aware inference, and practical debugging under competition constraints. It is not just "I ran a model"; it is "I built the pipeline that made the model usable."
Back to Portfolio