@jbrowse/plugin-variants
Auto-generated from exported functions tagged #api in the source. See
imports and re-exports for how to
import these from a plugin.
variantDensityAlpha
Each record's alpha factor where records too short to see share pixels at
bpPerPx, as the multi-sample variant display fades a zoomed-out row
(recordDensityAlpha) at the power of two bpPerPx rounds to: 1 where a
record covers its pixels alone. For a host that draws the cells at its own
scale.
// type signature
({ start, end, bpPerPx, }: { start: readonly number[]; end: readonly number[]; bpPerPx: number; }) => number[]variantRecordTables
The VCF columns of the records a feature table lists, by its features.id,
for a host drawing a VCF as the plain variant display does, which draws
every record, a record calling no genotype included:
records: each one'sref,alt(its alleles joined by,) andfilter, aligned toids.infoandinfoFields: its INFO, asvariantTablesgives them.samples: a row per record and sample in header order,feature(an index intoids) andsample;format, a column per FORMAT key aligned to it, typed as INFO is; andformatFields, each key's declaration.annotationsandannotationFields: its ANN or CSQ consequences, asvariantTablesgives them,featurean index intoids.
// type signature
(pluginManager: PluginManager, { adapterConfig, sequenceAdapter, regions, ids, }: {…}) => Promise<{ samples: {…}; format: Record<string, unknown[]>; formatFields: { key: string[]; number: string[]; type: string[]; description: string[]; }; annotations: { [x: string]: number[] | string[] | (string | null)[]; key: string[]; }; annotationFields: { key: string[]; field: string[]; }; info: Record<string, unknown[]>; infoFields: { key: string[]; number: string[]; type: string[]; description: string[]; }; records: { ref: string[]; alt: string[]; filter: (string | null)[]; }; }>variantTables
A region of a multi-sample VCF as the multi-sample variant display fetches,
filters and paints it, as tables: variants, each record the display
keeps, with its lane color and its filter; info, each INFO key's
values aligned to variants, and infoFields, the header's declaration
of each key; annotations, each record's SnpEff ANN or VEP CSQ
consequences, a row per record and consequence, which then leave info
(consequenceTables); cells, each sample's (or under
unit: 'haplotype' each haplotype's) cell at each record, with its
genotype, its dosage and the fill the display paints it; rows, the
rows the cells name, top to bottom as the display arranges them by rows
and stacks them in facet's bands, each with its label and band; bands,
each band's value, label and the rows it spans; and legend and ramps,
the key the display shows. Under referenceDrawingMode: 'skip', the default,
a reference call draws no cell. Several regions share the rows and the key,
as the display's regions do: a record crossing regions is listed in each,
under one key, every variants and cells row names its region's
index, and cells.variant indexes the joined variants. For a host that
draws them itself, such as R through V8. The adapters must be registered on
pluginManager (registerVariantAdapters).
// type signature
(pluginManager: PluginManager, { adapterConfig, sequenceAdapter, region, regions, display, byteLimit, }: VariantTablesArgs) => Promise<{ cells: {…}; rows: {…}; legend: {…}; ramps: {…}[]; rowLegend: {…}; rowLegendTitle: string; bands: {…}; config: Record<…>; warnings: string[]; annotations: {…}; annotationFields: {…}; info: Record<…>; infoFields: {…}; variants: { start: number[]; end: number[]; id: string[]; name: string[]; ref: string[]; alt: string[]; type: string[]; color: string[]; filter: (string | null)[]; region: number[]; key: number[]; }; }>