@gmod/bbi
Version:
Parser for BigWig/BigBed files
70 lines • 1.79 kB
JavaScript
export class ArrayFeatureView {
starts;
ends;
scores;
minScores;
maxScores;
isSummary;
_source;
_refName;
constructor(arrays, source, refName) {
this.starts = arrays.starts;
this.ends = arrays.ends;
this.scores = arrays.scores;
this.isSummary = arrays.isSummary;
this.minScores = arrays.isSummary ? arrays.minScores : undefined;
this.maxScores = arrays.isSummary ? arrays.maxScores : undefined;
this._source = source;
this._refName = refName;
}
get length() {
return this.starts.length;
}
get source() {
return this._source;
}
get refName() {
return this._refName;
}
start(i) {
return this.starts[i];
}
end(i) {
return this.ends[i];
}
score(i) {
return this.scores[i];
}
minScore(i) {
return this.minScores?.[i];
}
maxScore(i) {
return this.maxScores?.[i];
}
id(i) {
return `${this._source}:${this._refName}:${this.starts[i]}-${this.ends[i]}`;
}
get(i, key) {
switch (key) {
case 'start':
return this.starts[i];
case 'end':
return this.ends[i];
case 'score':
return this.scores[i];
case 'refName':
return this._refName;
case 'source':
return this._source;
case 'minScore':
return this.minScores?.[i];
case 'maxScore':
return this.maxScores?.[i];
case 'summary':
return this.isSummary;
default:
return undefined;
}
}
}
//# sourceMappingURL=array-feature-view.js.map