Skip to content

Enhance auto layout with RNApuzzler, covariation rectangles, and font adjustments#209

Merged
AntonPetrov merged 7 commits intomainfrom
develop
Mar 29, 2026
Merged

Enhance auto layout with RNApuzzler, covariation rectangles, and font adjustments#209
AntonPetrov merged 7 commits intomainfrom
develop

Conversation

@AntonPetrov
Copy link
Copy Markdown
Member

No description provided.

Run RNApuzzler as part of the template-free auto layout selection and adjust ordering/selection logic. The puzzler run is now executed (with work/result folders created and exceptions handled), its overlap count compared alongside R2R and RNArtist, and candidate ordering/printing updated. The CLI --auto option is changed to --auto/--no-auto and defaults to true; auto mode only runs when no specific engine is chosen. Added example input (examples/rnapuzzler-auto.fasta) and expected SVG fixture (tests/examples/rnapuzzler-auto/9ZCC.colored.svg) and updated tests accordingly.
Draw coloured rectangles spanning both nucleotides of a base pair instead
of per-nucleotide circles. Dual rectangles are drawn when a pair has both
pair-level (dark green) and helix-level (light green) covariation signals.
Scale nucleotide font size based on median nearest-neighbour spacing:
  new_font = max(current, min(20, max(2, 0.56 * median_nn)))
Never decreases existing fonts. Replaces the old nucleotide-count
heuristic that only ran for Rfam/GtRNAdb.
Update documentation to describe rectangle-based visualization.
Regenerate 9LEL images with rectangles and adjusted font size (14px).
ViennaRNA's RNA.svg_rna_plot produces nan coordinates for hairpin
loops with fewer than 3 unpaired bases (e.g. '()' or '(.)').

Add _remove_small_hairpins() to iteratively strip such pairs before
layout generation. Both template and target FASTA files are kept in
sync so Traveler does not attempt to draw pairs without coordinates.

Add _write_linear_colored_svg() fallback for when hairpin removal
strips all base pairs, producing a Traveler-compatible SVG directly
from ViennaRNA coordinates.

Update 9MME reference SVG to reflect font-size adjustment.
Split normalization into two structures: layout_structure (all bracket types mapped to () for ViennaRNA coordinate generation) and template_structure (only original () retained; other brackets become dots so Traveler sees the same pair-tree topology). Apply small-hairpin removal to both, detect removed pairs by comparing against the original ()-only template, and write the template FASTA using template_structure. This preserves pseudoknot rendering in the final target while ensuring coordinates and template topology match.
Improve R-scape alignment processing
@github-actions
Copy link
Copy Markdown

Docker image tag(s) pushed:

rnacentral/r2dt:pr-209

Labels added to images:

org.opencontainers.image.created=2026-03-29T10:00:37.597Z
org.opencontainers.image.description=Visualise RNA secondary structure in consistent, reproducible and recognisable layouts
org.opencontainers.image.licenses=Apache-2.0
org.opencontainers.image.revision=e7356baeace615d715d412484b0fadd6900e959e
org.opencontainers.image.source=https://github.com/r2dt-bio/R2DT
org.opencontainers.image.title=R2DT
org.opencontainers.image.url=https://github.com/r2dt-bio/R2DT
org.opencontainers.image.version=pr-209

@AntonPetrov AntonPetrov merged commit 530e0bd into main Mar 29, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant