# rakib-hasan-rahad/rna-3d-structure-guided-refinement-of-rfam-alignments architecture

> Architecture diagram of the GitHub repository rakib-hasan-rahad/rna-3d-structure-guided-refinement-of-rfam-alignments, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rakib-hasan-rahad/rna-3d-structure-guided-refinement-of-rfam-alignments
- Repository: https://github.com/rakib-hasan-rahad/rna-3d-structure-guided-refinement-of-rfam-alignments

## Overview

This repository supports a research workflow that links Rfam seed sequences to experimentally observed RNA structures, aligns selected cross-species pairs with STAR3D, and evaluates correspondence disagreements using structural annotations and geometry. The current version-2 path proceeds from review and selection through staging, alignment, analysis, figures, and an interactive results browser; it also offers a minimum-stack-size supplement. The retained version-1 scripts cover inventory, preparation, comparison, interpretation, and interim results. Connections for unsampled stages follow the README’s documented workflow; source-level details are limited to the excerpts and SOURCE INDEX.

Main entry points: [`scripts/realign/r4b_metrics.py`](https://github.com/rakib-hasan-rahad/rna-3d-structure-guided-refinement-of-rfam-alignments/blob/main/scripts/realign/r4b_metrics.py) (Compute metrics), [`outputs_realign/r3/returned/star3d_runner.py`](https://github.com/rakib-hasan-rahad/rna-3d-structure-guided-refinement-of-rfam-alignments/blob/main/outputs_realign/r3/returned/star3d_runner.py) (STAR3D runner), [`scripts/realign/r2a_review_new.py`](https://github.com/rakib-hasan-rahad/rna-3d-structure-guided-refinement-of-rfam-alignments/blob/main/scripts/realign/r2a_review_new.py) (Review intervals), [`scripts/step2/s04_coordinates.py`](https://github.com/rakib-hasan-rahad/rna-3d-structure-guided-refinement-of-rfam-alignments/blob/main/scripts/step2/s04_coordinates.py) (Review coordinates)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_selection["Selection and staging"]
  node_r2review["Review intervals<br/>[r2a_review_new.py]"]
  node_discover["Discover candidates<br/>[s01_discover.py]"]
  node_sequence["Sequence evidence"]
  node_coordinates["Review coordinates<br/>[s04_coordinates.py]"]
  node_select["Select and prepare"]
end

subgraph group_alignment["Structure alignment"]
  node_jobs["Build alignment jobs<br/>[r3_jobs.py]"]
  node_star3d["STAR3D runner<br/>[star3d_runner.py]"]
end

subgraph group_analysis["Comparison and evidence"]
  node_fr3d["FR3D annotation<br/>[run_fr3d.py]"]
  node_compare["Compare alignments<br/>[r4_analysis.py]"]
  node_metrics["Compute metrics<br/>[r4b_metrics.py]"]
  node_supplement["Stack-size supplement<br/>[recompute.py]"]
end

subgraph group_results["Results and interpretation"]
  node_figures["Analysis figures<br/>[r6_figures.py]"]
  node_site_data["Results site data<br/>[r7_results_site.py]"]
  node_browser["Results browser"]
end

subgraph group_legacy["Retained workflow"]
  node_step4compare["Legacy comparison<br/>[s41_compare.py]"]
  node_motifs["Motif analysis<br/>[s42_motifs.py]"]
  node_step5["Interim results app<br/>[build_app.py]"]
  node_step5data["Interim data builder<br/>[build_step5.py]"]
  node_rules["Interpretation rules<br/>[rules.py]"]
  node_regions["Interaction regions"]
end

node_researcher(("Researcher"))
node_rfam[("Rfam seeds")]
node_structures[("RNA structures")]

node_researcher -->|"runs workflow"| node_r2review
node_rfam -->|"supplies seed context"| node_r2review
node_structures -->|"supplies coordinates"| node_coordinates
node_discover -->|"screens candidates"| node_sequence
node_sequence -->|"supports review"| node_coordinates
node_coordinates -->|"informs selection"| node_select
node_r2review -->|"adds review results"| node_select
node_select -->|"provides selected pairs"| node_jobs
node_jobs -->|"dispatches pairs"| node_star3d
node_star3d -->|"provides alignments"| node_compare
node_star3d -->|"provides run outputs"| node_fr3d
node_fr3d -->|"provides annotations"| node_compare
node_compare -->|"produces comparison tables"| node_metrics
node_metrics -->|"supports stack-size comparison"| node_supplement
node_metrics -->|"supplies analysis results"| node_figures
node_metrics -->|"supplies result data"| node_site_data
node_site_data -->|"feeds browser"| node_browser
node_researcher -->|"explores results"| node_browser
node_step4compare -->|"provides comparison tables"| node_motifs
node_step4compare -->|"provides analysis tables"| node_step5data
node_motifs -->|"provides motif results"| node_step5data
node_step5data -->|"builds interim app data"| node_step5
node_rules -->|"defines interpretation rules"| node_regions

click node_r2review "https://github.com/rakib-hasan-rahad/rna-3d-structure-guided-refinement-of-rfam-alignments/blob/main/scripts/realign/r2a_review_new.py"
click node_discover "https://github.com/rakib-hasan-rahad/rna-3d-structure-guided-refinement-of-rfam-alignments/blob/main/scripts/step2/s01_discover.py"
click node_sequence "https://github.com/rakib-hasan-rahad/rna-3d-structure-guided-refinement-of-rfam-alignments/blob/main/scripts/step2/s03_sequence_evidence.py"
click node_coordinates "https://github.com/rakib-hasan-rahad/rna-3d-structure-guided-refinement-of-rfam-alignments/blob/main/scripts/step2/s04_coordinates.py"
click node_select "https://github.com/rakib-hasan-rahad/rna-3d-structure-guided-refinement-of-rfam-alignments/blob/main/scripts/step2/s05_select_prepare.py"
click node_jobs "https://github.com/rakib-hasan-rahad/rna-3d-structure-guided-refinement-of-rfam-alignments/blob/main/scripts/realign/r3_jobs.py"
click node_star3d "https://github.com/rakib-hasan-rahad/rna-3d-structure-guided-refinement-of-rfam-alignments/blob/main/outputs_realign/r3/returned/star3d_runner.py"
click node_fr3d "https://github.com/rakib-hasan-rahad/rna-3d-structure-guided-refinement-of-rfam-alignments/blob/main/outputs_realign/r5/fr3d/run_fr3d.py"
click node_compare "https://github.com/rakib-hasan-rahad/rna-3d-structure-guided-refinement-of-rfam-alignments/blob/main/scripts/realign/r4_analysis.py"
click node_metrics "https://github.com/rakib-hasan-rahad/rna-3d-structure-guided-refinement-of-rfam-alignments/blob/main/scripts/realign/r4b_metrics.py"
click node_supplement "https://github.com/rakib-hasan-rahad/rna-3d-structure-guided-refinement-of-rfam-alignments/blob/main/outputs_realign/min_stack_2/recompute.py"
click node_figures "https://github.com/rakib-hasan-rahad/rna-3d-structure-guided-refinement-of-rfam-alignments/blob/main/scripts/realign/r6_figures.py"
click node_site_data "https://github.com/rakib-hasan-rahad/rna-3d-structure-guided-refinement-of-rfam-alignments/blob/main/scripts/realign/r7_results_site.py"
click node_browser "https://github.com/rakib-hasan-rahad/rna-3d-structure-guided-refinement-of-rfam-alignments/blob/main/scripts/realign/r10_results_browser.py"
click node_step4compare "https://github.com/rakib-hasan-rahad/rna-3d-structure-guided-refinement-of-rfam-alignments/blob/main/scripts/step4/s41_compare.py"
click node_motifs "https://github.com/rakib-hasan-rahad/rna-3d-structure-guided-refinement-of-rfam-alignments/blob/main/scripts/step4/s42_motifs.py"
click node_step5 "https://github.com/rakib-hasan-rahad/rna-3d-structure-guided-refinement-of-rfam-alignments/blob/main/scripts/step5/build_app.py"
click node_step5data "https://github.com/rakib-hasan-rahad/rna-3d-structure-guided-refinement-of-rfam-alignments/blob/main/scripts/step5/build_step5.py"
click node_rules "https://github.com/rakib-hasan-rahad/rna-3d-structure-guided-refinement-of-rfam-alignments/blob/main/scripts/step6/rules.py"
click node_regions "https://github.com/rakib-hasan-rahad/rna-3d-structure-guided-refinement-of-rfam-alignments/blob/main/scripts/step6/s63_interactions_regions.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_r2review,node_discover,node_sequence,node_coordinates,node_select toneBlue
class node_jobs,node_star3d,node_rfam,node_structures toneAmber
class node_fr3d,node_compare,node_metrics,node_supplement toneMint
class node_figures,node_site_data,node_browser toneRose
class node_step4compare,node_motifs,node_step5,node_step5data,node_rules,node_regions,node_researcher toneIndigo
```

## Components

### Selection and staging

- [Review intervals](https://github.com/rakib-hasan-rahad/rna-3d-structure-guided-refinement-of-rfam-alignments/blob/main/scripts/realign/r2a_review_new.py): `scripts/realign/r2a_review_new.py`
- [Discover candidates](https://github.com/rakib-hasan-rahad/rna-3d-structure-guided-refinement-of-rfam-alignments/blob/main/scripts/step2/s01_discover.py): `scripts/step2/s01_discover.py`
- [Sequence evidence](https://github.com/rakib-hasan-rahad/rna-3d-structure-guided-refinement-of-rfam-alignments/blob/main/scripts/step2/s03_sequence_evidence.py): `scripts/step2/s03_sequence_evidence.py`
- [Review coordinates](https://github.com/rakib-hasan-rahad/rna-3d-structure-guided-refinement-of-rfam-alignments/blob/main/scripts/step2/s04_coordinates.py): `scripts/step2/s04_coordinates.py`
- [Select and prepare](https://github.com/rakib-hasan-rahad/rna-3d-structure-guided-refinement-of-rfam-alignments/blob/main/scripts/step2/s05_select_prepare.py): `scripts/step2/s05_select_prepare.py`

### Structure alignment

- [Build alignment jobs](https://github.com/rakib-hasan-rahad/rna-3d-structure-guided-refinement-of-rfam-alignments/blob/main/scripts/realign/r3_jobs.py): `scripts/realign/r3_jobs.py`
- [STAR3D runner](https://github.com/rakib-hasan-rahad/rna-3d-structure-guided-refinement-of-rfam-alignments/blob/main/outputs_realign/r3/returned/star3d_runner.py): `outputs_realign/r3/returned/star3d_runner.py`

### Comparison and evidence

- [FR3D annotation](https://github.com/rakib-hasan-rahad/rna-3d-structure-guided-refinement-of-rfam-alignments/blob/main/outputs_realign/r5/fr3d/run_fr3d.py): `outputs_realign/r5/fr3d/run_fr3d.py`
- [Compare alignments](https://github.com/rakib-hasan-rahad/rna-3d-structure-guided-refinement-of-rfam-alignments/blob/main/scripts/realign/r4_analysis.py): `scripts/realign/r4_analysis.py`
- [Compute metrics](https://github.com/rakib-hasan-rahad/rna-3d-structure-guided-refinement-of-rfam-alignments/blob/main/scripts/realign/r4b_metrics.py): `scripts/realign/r4b_metrics.py`
- [Stack-size supplement](https://github.com/rakib-hasan-rahad/rna-3d-structure-guided-refinement-of-rfam-alignments/blob/main/outputs_realign/min_stack_2/recompute.py): `outputs_realign/min_stack_2/recompute.py`

### Results and interpretation

- [Analysis figures](https://github.com/rakib-hasan-rahad/rna-3d-structure-guided-refinement-of-rfam-alignments/blob/main/scripts/realign/r6_figures.py): `scripts/realign/r6_figures.py`
- [Results site data](https://github.com/rakib-hasan-rahad/rna-3d-structure-guided-refinement-of-rfam-alignments/blob/main/scripts/realign/r7_results_site.py): `scripts/realign/r7_results_site.py`
- [Results browser](https://github.com/rakib-hasan-rahad/rna-3d-structure-guided-refinement-of-rfam-alignments/blob/main/scripts/realign/r10_results_browser.py): `scripts/realign/r10_results_browser.py`

### Retained workflow

- [Legacy comparison](https://github.com/rakib-hasan-rahad/rna-3d-structure-guided-refinement-of-rfam-alignments/blob/main/scripts/step4/s41_compare.py): `scripts/step4/s41_compare.py`
- [Motif analysis](https://github.com/rakib-hasan-rahad/rna-3d-structure-guided-refinement-of-rfam-alignments/blob/main/scripts/step4/s42_motifs.py): `scripts/step4/s42_motifs.py`
- [Interim results app](https://github.com/rakib-hasan-rahad/rna-3d-structure-guided-refinement-of-rfam-alignments/blob/main/scripts/step5/build_app.py): `scripts/step5/build_app.py`
- [Interim data builder](https://github.com/rakib-hasan-rahad/rna-3d-structure-guided-refinement-of-rfam-alignments/blob/main/scripts/step5/build_step5.py): `scripts/step5/build_step5.py`
- [Interpretation rules](https://github.com/rakib-hasan-rahad/rna-3d-structure-guided-refinement-of-rfam-alignments/blob/main/scripts/step6/rules.py): `scripts/step6/rules.py`
- [Interaction regions](https://github.com/rakib-hasan-rahad/rna-3d-structure-guided-refinement-of-rfam-alignments/blob/main/scripts/step6/s63_interactions_regions.py): `scripts/step6/s63_interactions_regions.py`

### Other components

- **Researcher**
- **Rfam seeds**
- **RNA structures**

## Connections

- Researcher → Review intervals: runs workflow
- Rfam seeds → Review intervals: supplies seed context (evidence: `scripts/realign/r2a_review_new.py`)
- RNA structures → Review coordinates: supplies coordinates (evidence: `scripts/step2/s04_coordinates.py`)
- Discover candidates → Sequence evidence: screens candidates
- Sequence evidence → Review coordinates: supports review
- Review coordinates → Select and prepare: informs selection (evidence: `scripts/step2/s05_select_prepare.py`)
- Review intervals → Select and prepare: adds review results (evidence: `scripts/realign/r2a_review_new.py`)
- Select and prepare → Build alignment jobs: provides selected pairs
- Build alignment jobs → STAR3D runner: dispatches pairs
- STAR3D runner → Compare alignments: provides alignments
- STAR3D runner → FR3D annotation: provides run outputs
- FR3D annotation → Compare alignments: provides annotations
- Compare alignments → Compute metrics: produces comparison tables (evidence: `scripts/realign/r4b_metrics.py`)
- Compute metrics → Stack-size supplement: supports stack-size comparison (evidence: `outputs_realign/min_stack_2/recompute.py`)
- Compute metrics → Analysis figures: supplies analysis results
- Compute metrics → Results site data: supplies result data
- Results site data → Results browser: feeds browser (evidence: `scripts/realign/r10_results_browser.py`)
- Researcher → Results browser: explores results
- Legacy comparison → Motif analysis: provides comparison tables (evidence: `scripts/step4/s42_motifs.py`)
- Legacy comparison → Interim data builder: provides analysis tables (evidence: `scripts/step5/build_step5.py`)
- Motif analysis → Interim data builder: provides motif results (evidence: `scripts/step5/build_step5.py`)
- Interim data builder → Interim results app: builds interim app data (evidence: `scripts/step5/build_app.py`)
- Interpretation rules → Interaction regions: defines interpretation rules (evidence: `scripts/step6/s63_interactions_regions.py`)
