UNPKG

@gmod/bbi

Version:

Parser for BigWig/BigBed files

46 lines (45 loc) 2.05 kB
import { Observable } from 'rxjs'; import { BlockView } from './block-view.ts'; import type { BigWigFeatureArrays, BigWigHeaderWithRefNames, Feature, RequestOptions2, RequestOptions, SummaryFeatureArrays } from './types.ts'; import type { GenericFilehandle } from 'generic-filehandle2'; export declare abstract class BBI { protected bbi: GenericFilehandle; private headerP?; protected renameRefSeqs: (a: string) => string; getHeader(opts?: RequestOptions): Promise<BigWigHeaderWithRefNames>; constructor(args: { filehandle?: GenericFilehandle; path?: string; url?: string; renameRefSeqs?: (a: string) => string; }); private _getHeader; private _getMainHeader; private _readChromosomeTree; protected getUnzoomedView(opts?: RequestOptions): Promise<BlockView>; protected abstract getView(scale: number, opts?: RequestOptions): Promise<BlockView>; /** * Gets features from a BigWig file * * @param refName - The chromosome name * * @param start - The start of a region * * @param end - The end of a region * * @param opts - An object containing basesPerSpan (e.g. pixels per basepair) * or scale used to infer the zoomLevel to use */ getFeatureStream(refName: string, start: number, end: number, opts?: RequestOptions2): Promise<Observable<Feature[]>>; getFeatures(refName: string, start: number, end: number, opts?: RequestOptions2): Promise<any[]>; /** * Gets features from a BigWig file as typed arrays (more efficient than getFeatures) * * @param refName - The chromosome name * @param start - The start of a region * @param end - The end of a region * @param opts - Options including basesPerSpan or scale * @returns Promise with typed arrays: starts, ends, scores (and minScores/maxScores for summary data) */ getFeaturesAsArrays(refName: string, start: number, end: number, opts?: RequestOptions2): Promise<BigWigFeatureArrays | SummaryFeatureArrays>; }