Skip to content

Add annotation-based color schemes (RF, R2R_LABEL, covariation) #5

@jayhesselberth

Description

@jayhesselberth

Summary

Add new color schemes that color residues based on GC annotation data from R2R and R-scape tools.

New Color Schemes

1. RF Match (:color rf)

Color residues by match/mismatch to the reference sequence (#=GC RF):

  • Green - matches RF consensus
  • Red - differs from RF consensus

2. R2R Label (:color r2r)

Color by structural element labels from R2R (#=GC R2R_LABEL):

  • Different colors for labeled regions (pseudoknots, groups, etc.)

3. Covariation (:color cov)

Color base pairs by R-scape covariation significance:

  • Green - significant covariation (cov_SS_cons = 2)
  • Light green - in significant helix (cov_h_SS_cons = 3)
  • Blue - paired but no covariation data

R-scape Annotation Format

R-scape outputs .R2R.sto Stockholm files with these GC annotations:

Annotation Values Meaning
cov_SS_cons . or 2 . = no covariation, 2 = significant
cov_h_SS_cons . or 3 . = not in helix, 3 = significant helix
RF A/C/G/U Reference sequence (upper=conserved)

Implementation

Files to Modify

File Changes
src/app.rs Add RfMatch, R2rLabel, Covariation to ColorScheme enum
src/color/schemes.rs Implement color functions, add match arms in get_color()
src/stockholm/types.rs Add get_gc_annotation() helper method

Command Aliases

  • "rf" / "rfmatch" → RfMatch
  • "r2r" / "label" → R2rLabel
  • "cov" / "covariation" → Covariation

Testing

  1. Load R-scape output file (.R2R.sto) with covariation annotations
  2. Test :color rf, :color cov, :color r2r commands
  3. Verify graceful fallback when annotations are missing

References

  • R-scape annotation code: ext/R-scape/src/r2rdepict.c
  • R2R demo files: ext/R2R/R2R-1.0.7/demo/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions