loom-browser 0.0.13 → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/loom-react.esm.js +235 -46
- package/dist/loom-react.esm.min.js +1 -1
- package/dist/loom-react.esm.min.js.map +1 -1
- package/dist/loom-worker.js +317 -10
- package/dist/loom-worker.min.js +1 -1
- package/dist/loom-worker.min.js.map +1 -1
- package/dist/loom.esm.js +1898 -1674
- package/dist/loom.esm.min.js +1 -1
- package/dist/loom.esm.min.js.map +1 -1
- package/dist/loom.js +1898 -1673
- package/dist/loom.min.js +1 -1
- package/dist/loom.min.js.map +1 -1
- package/dist/tsconfig.src.tsbuildinfo +1 -1
- package/dist/types/browser/headless/headlessGenomeBrowser.d.ts +3 -1
- package/dist/types/browser/headless/trackFactories.d.ts +15 -0
- package/dist/types/dataSources/bigBedDataSource.d.ts +33 -0
- package/dist/types/dataSources/config.d.ts +5 -1
- package/dist/types/formats/formatDetection.d.ts +2 -0
- package/dist/types/genome/genome.d.ts +3 -2
- package/dist/types/index.d.ts +2 -1
- package/dist/types/types.d.ts +1 -1
- package/package.json +1 -1
|
@@ -308,7 +308,7 @@ export declare class HeadlessGenomeBrowser {
|
|
|
308
308
|
*/
|
|
309
309
|
setViewportWidth(width: number): void;
|
|
310
310
|
/** Add a track with an optional data source for automatic data management. */
|
|
311
|
-
addTrack<F>(track: Track, dataSource?: DataSource<F>, dataSourceConfig?: DataSourceConfig, maxTrackHeight?: number, order?: number): string;
|
|
311
|
+
addTrack<F>(track: Track, dataSource?: DataSource<F>, dataSourceConfig?: DataSourceConfig, maxTrackHeight?: number, order?: number, id?: string): string;
|
|
312
312
|
/** Remove a track by reference or by stable string ID. */
|
|
313
313
|
removeTrack(trackOrId: Track | string): void;
|
|
314
314
|
/**
|
|
@@ -507,6 +507,8 @@ export declare class HeadlessGenomeBrowser {
|
|
|
507
507
|
addGeneTrack(options?: import('./trackFactories').AddAnnotationTrackOptions): AnnotationTrackCanvas;
|
|
508
508
|
/** Add a BED/peak annotation track from a URL. */
|
|
509
509
|
addBedTrack(url: string, options?: import('./trackFactories').AddBedTrackOptions): AnnotationTrackCanvas;
|
|
510
|
+
/** Add a BigBed annotation track from a URL. */
|
|
511
|
+
addBigBedTrack(url: string, options?: import('./trackFactories').AddBigBedTrackOptions): AnnotationTrackCanvas;
|
|
510
512
|
/** Add an interaction (arc/BEDPE) track from a URL. */
|
|
511
513
|
addInteractionTrack(url: string, options?: import('./trackFactories').AddInteractionTrackOptions): InteractionTrackCanvas;
|
|
512
514
|
/** Add a BigWig-style signal track backed by in-memory features (no URL required). */
|
|
@@ -74,6 +74,20 @@ export interface AddBedTrackOptions {
|
|
|
74
74
|
/** Static auth config (serializable, worker-safe, session-safe). */
|
|
75
75
|
auth?: StaticAuthConfig;
|
|
76
76
|
}
|
|
77
|
+
export interface AddBigBedTrackOptions {
|
|
78
|
+
config?: Partial<AnnotationRenderConfig>;
|
|
79
|
+
maxTrackHeight?: number;
|
|
80
|
+
name?: string;
|
|
81
|
+
metadata?: Record<string, string>;
|
|
82
|
+
/** Enable feature name indexing for search. Default: true. */
|
|
83
|
+
searchable?: boolean;
|
|
84
|
+
/** Fields to index for search. Default: DEFAULT_SEARCHABLE_FIELDS. */
|
|
85
|
+
searchableFields?: string[];
|
|
86
|
+
/** Full auth provider for this track (main thread, supports token refresh). */
|
|
87
|
+
authProvider?: AuthProvider;
|
|
88
|
+
/** Static auth config (serializable, worker-safe, session-safe). */
|
|
89
|
+
auth?: StaticAuthConfig;
|
|
90
|
+
}
|
|
77
91
|
export interface AddInteractionTrackOptions {
|
|
78
92
|
config?: Partial<InteractionRenderConfig>;
|
|
79
93
|
format?: TextFileFormat;
|
|
@@ -176,6 +190,7 @@ export declare function createWigTrack(ctx: TrackFactoryContext, url: string, op
|
|
|
176
190
|
export declare function createGtxTrack(ctx: TrackFactoryContext, url: string, options: AddGtxTrackOptions): FactoryResult<WigTrackCanvas>;
|
|
177
191
|
export declare function createGeneTrack(ctx: TrackFactoryContext, options?: AddAnnotationTrackOptions): FactoryResult<AnnotationTrackCanvas>;
|
|
178
192
|
export declare function createBedTrack(ctx: TrackFactoryContext, url: string, options?: AddBedTrackOptions): FactoryResult<AnnotationTrackCanvas>;
|
|
193
|
+
export declare function createBigBedTrack(ctx: TrackFactoryContext, url: string, options?: AddBigBedTrackOptions): FactoryResult<AnnotationTrackCanvas>;
|
|
179
194
|
export declare function createInteractionTrack(ctx: TrackFactoryContext, url: string, options?: AddInteractionTrackOptions): FactoryResult<InteractionTrackCanvas>;
|
|
180
195
|
export declare function createWigTrackWithFeatures(ctx: TrackFactoryContext, features: WigFeature[], options?: AddWigTrackWithFeaturesOptions): FactoryResult<WigTrackCanvas>;
|
|
181
196
|
export declare function createBedTrackWithFeatures(ctx: TrackFactoryContext, features: BedFeature[], options?: AddBedTrackWithFeaturesOptions): FactoryResult<AnnotationTrackCanvas>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BigBed data source — fetches BED features from BigBed binary files.
|
|
3
|
+
*
|
|
4
|
+
* Uses @gmod/bbi's BigBed class for binary parsing and range queries.
|
|
5
|
+
* Returns BedFeature[] suitable for annotation track rendering.
|
|
6
|
+
*
|
|
7
|
+
* Mirrors igv.js BWSource behavior for bigbed format:
|
|
8
|
+
* - Features are decoded from BED rest fields via decodeBed()
|
|
9
|
+
* - No zoom-level summarization (unlike BigWig)
|
|
10
|
+
* - Feature density estimation from header dataCount
|
|
11
|
+
*
|
|
12
|
+
* Layer 1 (Data + Layout): no DOM.
|
|
13
|
+
*/
|
|
14
|
+
import type { DataSource, ConfigurableDataSource, Locus, BedFeature } from '../types';
|
|
15
|
+
import type { FetchImpl } from '../io/rangeReader';
|
|
16
|
+
export declare class BigBedDataSource implements DataSource<BedFeature>, ConfigurableDataSource {
|
|
17
|
+
private _resolveChromName?;
|
|
18
|
+
private readonly bb;
|
|
19
|
+
private readonly url;
|
|
20
|
+
private readonly fetchImpl?;
|
|
21
|
+
constructor(url: string, fetchImpl?: FetchImpl);
|
|
22
|
+
/** Set a chromosome name resolver for alias resolution (e.g., "1" → "chr1"). */
|
|
23
|
+
setChromNameResolver(resolver: (chr: string) => string): void;
|
|
24
|
+
fetch(locus: Locus, _bpPerPixel: number, signal: AbortSignal): Promise<BedFeature[]>;
|
|
25
|
+
/**
|
|
26
|
+
* Search for a feature by name via BigBed extra index.
|
|
27
|
+
* Returns matching features, or empty array if not found or not indexed.
|
|
28
|
+
*/
|
|
29
|
+
search(name: string): Promise<BedFeature[]>;
|
|
30
|
+
dispose(): void;
|
|
31
|
+
}
|
|
32
|
+
/** Clear the BigBed reader cache (useful for testing or memory management). */
|
|
33
|
+
export declare function clearBigBedCache(): void;
|
|
@@ -30,12 +30,16 @@ export interface DataSourceAuthConfig {
|
|
|
30
30
|
/** Alias for DataSourceAuthConfig — used on per-track options for clarity. */
|
|
31
31
|
export type StaticAuthConfig = DataSourceAuthConfig;
|
|
32
32
|
/** Discriminated union for data source reconstruction. */
|
|
33
|
-
export type DataSourceConfig = BigWigDataSourceConfig | GtxDataSourceConfig | UCSCDataSourceConfig | TextDataSourceConfig | MemoryDataSourceConfig;
|
|
33
|
+
export type DataSourceConfig = BigWigDataSourceConfig | BigBedDataSourceConfig | GtxDataSourceConfig | UCSCDataSourceConfig | TextDataSourceConfig | MemoryDataSourceConfig;
|
|
34
34
|
export interface BigWigDataSourceConfig extends DataSourceAuthConfig {
|
|
35
35
|
type: 'bigwig';
|
|
36
36
|
url: string;
|
|
37
37
|
windowFunction?: WindowFunction;
|
|
38
38
|
}
|
|
39
|
+
export interface BigBedDataSourceConfig extends DataSourceAuthConfig {
|
|
40
|
+
type: 'bigbed';
|
|
41
|
+
url: string;
|
|
42
|
+
}
|
|
39
43
|
export interface GtxDataSourceConfig extends DataSourceAuthConfig {
|
|
40
44
|
type: 'gtx';
|
|
41
45
|
url: string;
|
|
@@ -21,6 +21,8 @@ export declare function inferFormatFromPath(path: string): string | undefined;
|
|
|
21
21
|
export declare function isBinaryFormat(format: string): boolean;
|
|
22
22
|
/** BigWig/BigBed format set — these use BWSource in igv.js. */
|
|
23
23
|
export declare const bbFormats: Set<string>;
|
|
24
|
+
/** Check if a format string represents a BigBed (annotation) format vs BigWig (quantitative). */
|
|
25
|
+
export declare function isBigBedFormat(format: string): boolean;
|
|
24
26
|
/**
|
|
25
27
|
* Check if a URL is likely tabix-indexed.
|
|
26
28
|
*
|
|
@@ -35,9 +35,10 @@ export declare function createGenomeSync(config: GenomeConfig & {
|
|
|
35
35
|
*/
|
|
36
36
|
export declare function createGenome(config: GenomeConfig): Promise<Genome>;
|
|
37
37
|
/**
|
|
38
|
-
* Pre-built hg38 genome with
|
|
38
|
+
* Pre-built hg38 genome with 2-bit sequence (UCSC API fallback).
|
|
39
39
|
*
|
|
40
40
|
* This is the default genome used by HeadlessGenomeBrowser when no genome
|
|
41
|
-
* is specified.
|
|
41
|
+
* is specified. Matches igv.js's default behavior: 2-bit file as primary
|
|
42
|
+
* sequence source, with UCSC REST API as automatic fallback for resilience.
|
|
42
43
|
*/
|
|
43
44
|
export declare const hg38Genome: Genome;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -40,7 +40,7 @@ export type { CytobandFeature, IdeogramRenderConfig, IdeogramTrackSessionConfig,
|
|
|
40
40
|
export type { DataSource, ConfigurableDataSource, DataSourceConfigMethod, FeatureCacheEntry, DataDrivenTrack, ZoomAwareTrack } from './types';
|
|
41
41
|
export { isZoomAware } from './types';
|
|
42
42
|
export type { PopupDataItem, HitTestResult, TrackInteractionEvent, ContextMenuItem, TrackContextMenuEvent, NumericState, ROI, ROISetConfig, ROIInteractionEvent, FeatureRect } from './types';
|
|
43
|
-
export type { LocusChangeEvent, ReferenceFrameSession, SessionConfig, TrackSessionConfig, WigTrackSessionConfig, AnnotationTrackSessionConfig, RulerTrackSessionConfig, MergedTrackSessionConfig, MergedSessionOverrides, PeakOverlayTrackSessionConfig, PeakOverlaySessionOverrides, WigAnnotationConfig, WigSessionOverrides, AnnotationSessionOverrides, RulerSessionOverrides, DataSourceConfig, DataSourceAuthConfig, BigWigDataSourceConfig, GtxDataSourceConfig, UCSCDataSourceConfig, TextDataSourceConfig, MemoryDataSourceConfig, SequenceProvider, Chromosome, Genome, GenomeConfig, ChromAliasRecord, Strand, TextFileFormat, BedFeature, PeakFeature, BedGraphFeature, GFFRecord, GFFFeature, TextFeature, } from './types';
|
|
43
|
+
export type { LocusChangeEvent, ReferenceFrameSession, SessionConfig, TrackSessionConfig, WigTrackSessionConfig, AnnotationTrackSessionConfig, RulerTrackSessionConfig, MergedTrackSessionConfig, MergedSessionOverrides, PeakOverlayTrackSessionConfig, PeakOverlaySessionOverrides, WigAnnotationConfig, WigSessionOverrides, AnnotationSessionOverrides, RulerSessionOverrides, DataSourceConfig, DataSourceAuthConfig, BigWigDataSourceConfig, BigBedDataSourceConfig, GtxDataSourceConfig, UCSCDataSourceConfig, TextDataSourceConfig, MemoryDataSourceConfig, SequenceProvider, Chromosome, Genome, GenomeConfig, ChromAliasRecord, Strand, TextFileFormat, BedFeature, PeakFeature, BedGraphFeature, GFFRecord, GFFFeature, TextFeature, } from './types';
|
|
44
44
|
export type { IgvSessionObject, IgvReferenceConfig, IgvTrackConfig } from './types/igvCompat';
|
|
45
45
|
export type { Packable } from './pack';
|
|
46
46
|
export { packFeatures } from './pack';
|
|
@@ -147,6 +147,7 @@ export type { FetchGtxOptions, GtxHeader, ChromEntry, ExperimentEntry } from './
|
|
|
147
147
|
export { TabixReader } from './tabix';
|
|
148
148
|
export type { TabixReaderOptions, TabixHeader } from './tabix';
|
|
149
149
|
export { BigWigDataSource } from './dataSources/bigWigDataSource';
|
|
150
|
+
export { BigBedDataSource } from './dataSources/bigBedDataSource';
|
|
150
151
|
export { GtxDataSource } from './dataSources/gtxDataSource';
|
|
151
152
|
export { GeneDataSource } from './dataSources/geneDataSource';
|
|
152
153
|
export { TextFeatureSource } from './dataSources/textFeatureSource';
|
package/dist/types/types.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export type { SequenceType, SequenceRenderConfig } from './tracks/sequence/confi
|
|
|
7
7
|
export type { ArcOrientation, ArcDisplayMode, InteractionRenderConfig } from './tracks/interaction/config';
|
|
8
8
|
export type { MergedRenderConfig } from './tracks/merged/config';
|
|
9
9
|
export type { IdeogramRenderConfig } from './tracks/ideogram/config';
|
|
10
|
-
export type { DataSourceConfig, DataSourceAuthConfig, BigWigDataSourceConfig, GtxDataSourceConfig, UCSCDataSourceConfig, TextDataSourceConfig, MemoryDataSourceConfig, } from './dataSources/config';
|
|
10
|
+
export type { DataSourceConfig, DataSourceAuthConfig, BigWigDataSourceConfig, BigBedDataSourceConfig, GtxDataSourceConfig, UCSCDataSourceConfig, TextDataSourceConfig, MemoryDataSourceConfig, } from './dataSources/config';
|
|
11
11
|
/** Genomic locus — a chromosome region. */
|
|
12
12
|
export interface Locus {
|
|
13
13
|
chr: string;
|