sv-core
Auto-generated from exported functions tagged #api in the source. See
imports and re-exports for how to
import these from a plugin.
breakendLocKey
A breakend locstring reduced to the form two spellings of one locus compare equal in.
Case, because that is what the two halves of one record disagree about:
nanomonsv writes CHROM chr3 and spells the same contig CHR3 inside the ALT
bracket, and all 66 BND records of the COLO829 callset the cancer_sv demo
serves do it. Case is also the whole of the fallback getCanonicalRefName
makes, through lowerCaseRefNameAliases.
For grouping two ends of one junction, not for navigation: chr10 against
10 still needs an assembly, and the callers here — the overlay's alt
matching and its breakend bucketing — hold features and no assembly. A
producer that has one resolves properly instead, through
toCanonicalRefName.
// type signature
(locString: string) => stringbreakendTickPx
Screen-x of the far end of a breakend's direction tick at screen-x x.
keepsDir is genomic (see breakendKeepsDirections) and reversed is what
turns it into a screen direction, so both are required: a caller cannot
compile without answering the question. A reversed displayed region mirrors
the axis, so a tick that ignores it points at the side the derivative
discards rather than the side it keeps.
// type signature
(x: number, keepsDir: number, reversed: boolean, lengthPx?: number) => numberbreakpointBpPerPx
bpPerPx that fits windowSize bp on each side of a breakpoint across the
view width. Falls back to a zoomed-in default when no window is requested.
// type signature
(windowSize: number, width: number) => numberbreakpointSplitViewId
Stable id for the breakpoint split view a given launcher spawns, so repeated
launches from the same place reuse one view instead of stacking a new one
each time. ownerId is whatever the launcher is: a spreadsheet view (shared
by the sheet's row menu and the SV inspector's chord clicks, which then land
in the same view), or a variant feature widget.
Spelling it out inline is the same string until it isn't — the dialog appends its own shape suffix to whatever it is handed, so a launcher that respells the prefix gets a second view instead of reusing the first, and nothing reports it.
// type signature
(ownerId: string, assemblyName: string) => stringgetBreakendAssemblyRegions
Loads the assembly for a breakend feature and resolves the two regions its endpoints span. Throws if the assembly, its regions, or either endpoint's region cannot be found.
// type signature
({ feature, session, assemblyName, }: { feature: Feature; session: AssemblyHost; assemblyName: string; }) => Promise<…>getBreakendCoveringRegions
The two canonical-refName junction positions a breakend/SV feature spans,
through junctionEnds; a record naming no other end spans its own extent.
// type signature
({…}: { feature: Feature; assembly: ModelInstanceTypeProps<…> & {…} & {…} & {…} & {…} & {…} & {…} & {…} & {…} & {…} & {…} & {…} & {…} & {…} & { isCircularRefName(refName: string): boolean; getRefNamePosition(refName: string): number | undefined; getAliasesForRefName(refName: string): string[]; getRefNameMapForAdapter(adapterConf: AdapterConf, options: BaseOptions): Promise<…>; getRefNameMismatch(adapterCacheKey: string): RefNameMismatch | undefined; } & IStateTreeNode<…>; }) => { pos: number; refName: string; mateRefName: string; matePos: number; }linearGenomeViewOf
A feature widget's view when a launch can copy its tracks: a linear genome view, never a circle, whose tracks carry displays a linear panel cannot draw.
// type signature
(view?: {…} | undefined) => (ModelInstanceTypeProps<…> & {…} & {…} & {…} & {…} & {…} & {…} & {…} & {…} & {…} & {…} & {…} & {…} & {…} & {…} & {…} & {…} & {…} & {…} & {…} & {…} & {…} & {…} & {…} & {…} & {…} & {…} & { flyTo: (centerBp: number, windowWidthBp: number) => void; flyToCenter(coord: number, refName: string, displayedRegionIndex?: number | undefined): void; flyToFit(centerBp: number, fitWidthBp: number): void; } & { afterCreate(): void; afterAttach(): void; } & IStateTreeNode<…>) | undefinedmakeFeaturePair
Both ends of a paired record, off whichever of the two things a producer
states the far one with: the mate field a paired adapter fills in, or a VCF
ALT this parses. paired is false for a record that names no other end,
and k2 is then a placeholder no view resolves.
One resolver where there were three — the arc display's endpoint pair,
svMateLocus's far end for a chain walk, and pairedEndsLocString's two
windows for the row menu. Each spelled the 1-based-to-interbase shift itself
(parseSvAlt reports VCF's 1-based position while mate.start is already
0-based) and two of them read ALT ahead of mate while the third read
mate first.
// type signature
(feature: Feature, alt?: string | undefined) => { k1: { refName: string; start: number; end: number; mateDirection: number; }; k2: FeatureEnd; paired: boolean; }navToLoc
Navigate a feature widget's view to locString. A view that cannot navigate
to a locus, such as the circular view, opens the locus in a linear genome
view of its first assembly with the widget's track.
// type signature
(locString: string, model: IAnyStateTreeNode, grow?: number | undefined) => voidpairedEndsLocString
Both ends of a paired record as one loc string an LGV opens side by side,
windowBp either side of each junction. Each panel is turned so the sequence
its end keeps reads left to right into the join. Two ends of one contig
closer than a window collapse to the single span between them. undefined
for a record with one end.
// type signature
(feature: Feature, windowBp: number) => string | undefinedpanelIsTurned
Whether the panel showing an end has to be turned for the join to read left to right across the seam: an end keeping the sequence to its RIGHT is reversed on the left panel, one keeping its LEFT is reversed on the right.
// type signature
(keeps: number, side: "left" | "right") => booleansplitRegionAtPosition
Splits a region at pos into two halves that both include pos, so a
breakend there stays visible in each.
// type signature
<T extends { refName: string; start: number; end: number; }>(region: T, pos: number, assemblyName?: string | undefined) => [T & { assemblyName?: string | undefined; }, T & { assemblyName?: string | undefined; }]svMateLocus
Where a record's other end is, in the feature's own refName namespace and 0-based like every other coordinate on a feature.
undefined when the record names no other end, which is most of a VCF: a
plain SNV, or an indel that is only ever its own span.
// type signature
(feature: Feature) => { refName: string; pos: number; } | undefinedRelated links
- Developer guide: Dependencies and re-exports