# Transcription

> Transcription copies a gene into mRNA.

Page: https://fframes-kit.pages.dev/docs/biology/transcription/
Cargo feature: `biology` (`fframes-kit = { version = "..", features = ["biology"] }`)

`Transcription` copies a gene into mRNA. The DNA of `coding` (its coding strand on top, the
template strand under it) lies across the figure, `spacing` pixels per base. From `delay`
RNA polymerase moves along it, one base every `base_time` seconds: the strands open into a
bubble around it, the template base it reads lights up in `lit_color`, and the matching RNA
base (`U` across from `A`) drops onto the growing mRNA below. The mRNA is the coding strand
with `U` for `T` (`transcribe(coding)`). With `labels` the rows and the polymerase are
named. Gallery scene: `Transcription`.

Gallery clip of `Transcription`: https://fframes-kit.pages.dev/media/scenes/Transcription-3a8a776e.mp4

```rust
use fframes_kit::prelude::*;
use fframes_kit::kits::biology::transcribe;

assert_eq!(transcribe("ATGGCTTAA"), "AUGGCUUAA");

fn gene<'a>(ui: &mut Ui<'a, '_, '_>) -> Svgr<'a> {
    ui.show(Transcription {
        coding: "ATGAAACGCTAG".into(),
        base_time: 0.3,
        ..ui.defaults()
    })
}
```

## API

Components are plain structs. Set the fields you need and fill the rest with `..ui.defaults()`: the defaults below come from the current theme (`theme.` values are fields of `Theme`).

### Transcription

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `coding` | `String` | `"ATGGCTTCGAAATGGTAA".into()` | The coding strand, written 5' to 3' with the letters `A`, `T`, `G`, `C`; the template strand is its complement and the mRNA copies it with `U` for `T`. |
| `delay` | `f32` | `0.0` | Seconds after the container's start before the polymerase begins to move. |
| `base_time` | `f32` | `0.35` | Seconds the polymerase spends on each base. |
| `center` | `(f64, f64)` | `(0.0, 0.0)` | The middle of the DNA, in units of `ui.space`. |
| `spacing` | `f32` | `52.0` | Pixels between neighbouring bases along the strand. |
| `labels` | `bool` | `true` | Names the strands, the mRNA and the polymerase when `true`. |
| `bases` | `BaseColors` | `BaseColors::default()` | Colour of each base letter. |
| `strand_color` | `Color` | `theme.colors.text` | Colour of the DNA backbones. |
| `rna_color` | `Color` | `theme.colors.highlight` | Colour of the mRNA backbone. |
| `polymerase_color` | `Color` | `theme.colors.accent` | Colour of the RNA polymerase and its label. |
| `lit_color` | `Color` | `theme.colors.title` | Colour the template base being read mixes toward. |
| `base_style` | `TextStyle` | `base_style` | The font of the base letters: family, size in pixels and weight. |
| `label_style` | `TextStyle` | `theme.typography.caption` | The font of the row names: family, size in pixels and weight. |
| `label_color` | `Color` | `theme.colors.muted` | Colour of the row names. |
| `enter` | `Option<FadeIn>` | `None` | Fade in at the start; `None` for none. |
| `exit` | `Option<FadeOut>` | `None` | Fade out before the end; `None` for none. |

Feature `biology` · [Source](https://github.com/khanhthanhdev/fframes-kit/blob/main/fframes-kit/src/kits/biology/expression.rs#L165)
