Skip to content

Commit

Permalink
fix none windowFunction for wig track in bedgraph format (#1910)
Browse files Browse the repository at this point in the history
* fix none windowFunction for wig track in bedgraph format

* change test
  • Loading branch information
1pratham authored Nov 5, 2024
1 parent 34e312e commit 7bc9971
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion js/feature/wigTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ class WigTrack extends TrackBase {
*/
function summarizeData(features, startBP, bpPerPixel, windowFunction = "mean") {

if (bpPerPixel <= 1 || !features || features.length === 0) {
if (bpPerPixel <= 1 || !features || features.length === 0 || windowFunction === "none") {
return features
}

Expand Down
3 changes: 3 additions & 0 deletions test/testWig.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ suite("testWig", function () {
summarizedData = summarizeData(features, start, bpPerPixel, windowFunction)
assert.equal(summarizedData.length, 953)

windowFunction = "none"
summarizedData = summarizeData(features, start, bpPerPixel, windowFunction)
assert.equal(summarizedData.length, 24546)

// first bin
// console.log(features[0].start)
Expand Down

0 comments on commit 7bc9971

Please sign in to comment.