Skip to content

Types v1.0.60

This page only covers top-level config types — those used when constructing TranscriptBrowserRenderer and not bound to a specific Manager. Types tightly coupled to a particular Manager are documented on the corresponding Manager page.


Top-level config

IRBrowerConfig

type

The constructor input for TranscriptBrowserRenderer (mind the spelling: a single s). The historical name ITRConfig is kept as a @deprecated alias; the two are equivalent.

interface IRBrowerConfig {
  renderer: IRendererConfig;
  /** Initial locus. rna is required (trans_name or trans_id); dna is optional (derived from annotation/API when absent).
   *  locus.mode selects the startup coordinate space (default "rna"). */
  locus: IDefaultLocus;
  /** Structured reference description (species / assembly / transcriptome / genome). */
  reference?: IReferenceConfig;
  /** Behavioural / visual settings: panel toggles, grid, axis, loading, channel-label. */
  settings?: ISettingsConfig;
  /** Predefined highlight regions loaded at init time. */
  highlight?: IHighlightRegion[];
  channels: IChannel[];
}

/** @deprecated Use IRBrowerConfig; kept as a transitional alias. */
type ITRConfig = IRBrowerConfig;

The type of locus is IDefaultLocus; each channels item is an IChannel; each highlight item is an IHighlightRegion.

IRendererConfig

type

interface IRendererConfig {
  containerId: string;
  theme?: "light" | "dark";
  backgroundColor?: string;
  resolution: "auto" | number;
  maxConcurrentWorkers?: number;
  /** Inertia scrolling after drag release (default true). */
  enableInertia?: boolean;
  /**
   * Render quality. "high": textured rendering using ele_grays textures; "low": flat color.
   * Default "high"; auto-falls back to "low" when WebGL2 is unavailable.
   */
  mode?: RenderQuality;
}

The visibility of the left sidebar and header toolbar buttons is configured via settings.panels, not here.

ITargetConfig

type

interface ITargetConfig {
  dna: string;
  rna: string;
  upOffset: number;   // upstream offset bp
  downOffset: number; // downstream offset bp
}

IRegionConfig

type

interface IRegionConfig {
  chr: string;
  start: number;
  end: number;
  offset: number;
}

IGridConfig

type

interface IGridConfig {
  display?: GridDisplay;
  color?: string;
}

IAnnotationConfig

type

Legacy loose annotation config. New code should use IReferenceConfig (the two can coexist; reference takes priority).

interface IAnnotationConfig {
  /** assembly name, e.g. "GRCh38". */
  transcriptome?: string;
  /** UCSC-format chromsizes file URL (chr\tsize), used for per-chromosome hard boundaries. */
  chromsizes?: string;
  /** RNA transcript API endpoint base, used to resolve the "NAME:FLANK" notation, e.g.
   *  "https://api.rbrowser.org/api/v1/rna/hg38". */
  transcripts?: string;
  /** UCSC-format cytoband file URL (plain text or gzip), rendered as the ideogram on the axis. */
  cytoband?: string;
}

Reference config

IReferenceConfig

type

Top-level reference config, aggregating species / assembly / transcriptome / genome. Managed by ReferenceManager.

interface IReferenceConfig {
  species?: ISpeciesInfo;
  assembly: IAssemblyInfo;             // required
  transcriptome: ITranscriptomeReference; // required
  genome: IGenomeReference;            // required
  /** Default locus to navigate to when this reference becomes active (IDefaultLocus). */
  defaultLocus?: IDefaultLocus;
  /** Whether this is a "curated" reference: shown with a star badge and pinned to the top of the reference menu. */
  curated?: boolean;
  /** Whether assembled at runtime from local files (blob: URLs, not persisted). */
  custom?: boolean;
}

ISpeciesInfo

type

interface ISpeciesInfo {
  name?: string;     // scientific name, e.g. "Homo sapiens"
  label?: string;    // display name, e.g. "Human"
  taxonId?: number;  // NCBI taxonomy ID, e.g. 9606
  icon?: string;     // species icon URL in the reference menu
}

IAssemblyInfo

type

interface IAssemblyInfo {
  name: string;      // required, canonical assembly name, e.g. "GRCh38"
  build?: string;    // UCSC short name, e.g. "hg38"
  version?: string;  // annotation version, e.g. "GENCODE v44"
}

ITranscriptomeReference

type

interface ITranscriptomeReference {
  /** Optional REST API base (preferred when set), e.g. "https://api.rbrowser.org/api/v1/rna/hg38". */
  api?: string;
  /** transcriptome FASTA (bgzip + .fai + .gzi). May be absent for some references. */
  fasta?: IFastaReference;
  /** Required, transcriptome annotation (gff3.gz / gtf.gz + tabix). */
  annotation: IAnnotationReference;
  /**
   * Whether the api provides per-tissue expression scores for the built-in Exon + Splice Junction channels.
   * When true, these two channels use score_rect / score_curve (colored by score); otherwise plain GFF3 solid rect / arc.
   */
  scoreExonJunction?: boolean;
}

scoreExonJunction only GRCh38

Currently only GRCh38 exposes this dataset. Other references may set api (a shared search endpoint) yet have no score data — so this is a dedicated explicit discriminator field, and you must not infer it from "whether api is present".

IFastaReference / IAnnotationReference / IGenomeReference / IChromSizesReference / ICytobandReference

type

/** bgzip + indexed FASTA (url + fai + gzi). */
interface IFastaReference {
  url: string;
  fai: string;
  gzi: string;
}

/** Indexed annotation (.gff3.gz / .gtf.gz + .tbi). */
interface IAnnotationReference {
  url: string;
  index: string;
  /** Optional read-only SQLite catalogue URL, used for transcript / gene / alias name search (sql.js-httpvfs over HTTP Range). */
  transcripts?: string;
}

/** genome FASTA + optional chromsizes / cytoband. */
interface IGenomeReference {
  fasta?: IFastaReference;        // optional: locally assembled custom references may omit it
  chromSizes?: IChromSizesReference;
  cytoband?: ICytobandReference;
}

interface IChromSizesReference { url: string; }
interface ICytobandReference { url: string; }

Settings

ISettingsConfig

type

interface ISettingsConfig {
  panels?: IPanelsSettings;        // panel visibility (left sidebar + header toolbar)
  grid?: IGridSettings;            // grid overlay
  axis?: IAxisConfig;              // bottom axis
  loading?: ILoadingConfig;        // loading indicator
  channelLabel?: IChannelLabelConfig; // channel-label badge
}

IPanelsSettings / IHeaderPanelsSettings / IPanelToggle

type

/** Generic toggle. */
interface IPanelToggle {
  enabled?: boolean;   // default true
}

/** Panel visibility (left sidebar + header toolbar). */
interface IPanelsSettings {
  left?: IPanelToggle;             // left control panel (hidden by default)
  header?: IHeaderPanelsSettings;  // header toolbar buttons (all shown by default)
}

/** Header toolbar button visibility (public shape, note the plural "Panels"). */
interface IHeaderPanelsSettings {
  enabled?: boolean;   // master switch for the whole header toolbar (default true)
  history?: IPanelToggle;
  favorites?: IPanelToggle;
  download?: IPanelToggle;
  channelLabel?: IPanelToggle;
  legend?: IPanelToggle;
  grid?: IPanelToggle;
  tooltip?: IPanelToggle;
  highlight?: IPanelToggle;
  cursor?: IPanelToggle;
}

IGridSettings

type

interface IGridSettings {
  enabled?: boolean;       // default true
  mode?: GridDisplay;      // which axes draw grid lines
  color?: string;
}

IHeaderPanelConfig

type

This is the legacy internal shape, not IHeaderPanelsSettings

IHeaderPanelConfig (no plural) is the legacy internal flat shape ({ enable } toggles) used by HeaderPanelManager.applyConfig. When configuring the renderer, use settings.panels.header (i.e. IHeaderPanelsSettings).

interface IHeaderPanelConfig {
  history?: { enable?: boolean };
  favourites?: { enable?: boolean };
  download?: { enable?: boolean };
  channel_label?: { enable?: boolean };
  legend?: { enable?: boolean };
  grid?: { enable?: boolean };
  tooltip?: { enable?: boolean };
  highlight?: { enable?: boolean };
  cursor?: { enable?: boolean };
}

IChannelLabelConfig

type

interface IChannelLabelConfig {
  enabled?: boolean;        // default true
  fontSize?: number;        // default 10
  maxLength?: number;       // max characters before truncation, default 20
  backgroundColor?: string; // default rgba(255,255,255,0.8)
  borderColor?: string;     // default #000000
  borderWidth?: number;     // default 0.5
  borderRadius?: number;    // default 0
  textColor?: string;       // default #000000
  padding?: number;         // default 4
  offset?: { x: number; y: number }; // default { x: 8, y: 8 }
}

Sub-module config

IAxisConfig

type

interface IAxisConfig {
  enabled?: boolean;          // default true
  height?: number;            // axis row height px, default 30
  color?: string;             // tick / label color
  backgroundColor?: string;   // default "#f1f2f6"
  fontSize?: number;          // default 11
  tickCount?: number;         // approximate major tick count (default auto by width)
  minorTickCount?: number;    // minor ticks between major ticks, default 4
  majorTickHeight?: number;   // default 8
  minorTickHeight?: number;   // default 4
}

ILoadingConfig

type

type LoadingPosition =
  | "rightBottom" | "rightTop" | "leftTop" | "leftBottom" | "left" | "right";
type LoadingLogoSize = "small" | "middle" | "large";

interface ILoadingConfig {
  enabled?: boolean;          // default true
  position?: LoadingPosition; // default "rightBottom"
  size?: LoadingLogoSize;     // default "small"
  fadeOutDuration?: number;   // fade-out animation ms, default 300
  logoType?: "css" | "svg";   // default "svg"
}

Events / interaction / enums

IDomain / InteractionMode

type

interface IDomain {
  start: number;
  end: number;
}

type InteractionMode = "pan" | "zoom";

GridDisplay / RenderQuality / ViewMode

type

type GridDisplay = "x" | "y" | "x+y" | "none";
type RenderQuality = "high" | "low";

/** Renderer startup coordinate space.
 *  "dna" genomic coordinates; "rna" TSS-relative coordinates (default); "cds" CDS-relative coordinates. */
type ViewMode = "dna" | "rna" | "cds";

TooltipMode / TooltipTrigger

type

type TooltipMode = "detailed" | "compact";
type TooltipTrigger = "hover" | "click" | "off";

CursorMode / CursorCoordMode

type

type CursorMode = "compact" | "detailed" | "each";

/** Optional coordinate-mode info passed to the Cursor, so labels show RNA / CDS relative coordinates instead of raw genomic coordinates. */
interface CursorCoordMode {
  mode: "rna" | "cds";
  tssPos?: number;        // TSS genomic coordinate for RNA mode
  strand: "+" | "-";
  cdsMapper?: { genomicToCDS(pos: number): number; totalCDSLength: number }; // CDS mode
}