Start here
  • InstallationAdd Nelumbo to a shadcn project
  • ThemingBrand accent, neutrals, dynamic color
  • Biology componentsSequences, maps, plates and trees
  • katalyx.bio

    Gene Model

    A gene's transcripts as exons and introns: coding blocks and thinner UTRs joined like a connected button group, dotted introns with strand chevrons, exon numbers, compressed introns, isoform stacks, variant lollipops and keyboard focus on exons.

    Install

    npx shadcn@latest add @nelumbo/gene-model

    A gene

    HBB, β-globin: three exons on the minus strand. Coding sequence is the tall block, the UTRs the thinner tonal ends; chevrons point the way it is read.

    Compressed introns

    TP53 spans 19 kb but its exons only 2.5 kb. introns="compressed" shrinks every intron to a short stretch so the exons get the room. The ruler only shows at true scale.

    Isoforms

    Several transcripts share one scale. The canonical one takes the color, the others stay neutral, so the differences read at a glance: exon 9β in p53β, Δ133p53 starting in intron 4.

    Orientation

    Genome browsers draw minus-strand genes right to left. orientation="transcript" turns them so 5' is on the left and exon 1 comes first.

    Variants

    markers stand on a transcript as lollipops with pill labels, stacked when they would collide. Here, TP53 hotspots in the DNA-binding domain.

    Protein domains

    domains takes residue ranges, as UniProt gives them, and maps them through the coding sequence onto the exons that encode them. A domain split by an intron keeps tight corners at the cut and round ones at its true ends, with a dotted line across the gap. Here, p53's domains on TP53.

    • Transactivation1–44
    • DNA-binding102–292
    • NLS305–321
    • Oligomerization325–356
    • Basic368–387

    Selection

    selectable makes the model one keyboard stop, like a chart: Left and Right move between exons, Up and Down between transcripts, Escape clears. The readout follows the pointer.

    4transcripts, TP53

    Colors and sizes

    Any accent role colors the coding blocks; the small size suits lists and tables.

    Props

    PropTypeDefaultNotes
    transcriptsGeneModelTranscript[]id, name, description, strand, exons, cds, canonical. 1-based, inclusive.
    introns"scaled" | "compressed""scaled"Compressed shrinks introns so exons get the room.
    orientation"genome" | "transcript""genome"Transcript turns minus-strand genes so 5' is on the left.
    exonNumbersbooleanfalseIn transcription order: inside the coding block where it fits, under it otherwise.
    rulerbooleanfalseGenomic coordinates along the top. Scaled introns only.
    markersGeneModelMarker[]position, label, color, description: lollipops with pill labels.
    markersOnstringfirst transcriptThe transcript id the markers stand on.
    coloraccent role"blue"The coding blocks of the canonical (or only) transcript.
    size"sm" | "default""default"14 or 20 px coding blocks.
    region{ start, end }the transcripts' spanThe stretch shown.
    selectable / onActiveChangeboolean, (focus | null) => voidKeyboard and pointer focus on exons; focus has transcript, exon and count.
    domainsProteinDomain[]Residue ranges (start, end, name, color), mapped through the coding sequence.
    domainsOn / domainLegendstring, booleancanonical, trueThe transcript whose protein the domains are on; the legend under the model.
    HelpersnumberExons, domainSegments, formatGenomicExons in transcription order; a domain's genomic stretches; coordinates as 7,675,088.