Skip to content

Commit

Permalink
resolved requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
shreyasun committed May 30, 2024
1 parent 2c0d5d6 commit 67cb6e3
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/util/tubemap.js
Original file line number Diff line number Diff line change
Expand Up @@ -730,9 +730,7 @@ function placeReads() {
});
});

console.log("elementsWithoutNode before sort:", elementsWithoutNode)
elementsWithoutNode.sort(compareNoNodeReads);
console.log("elementsWithoutNode:", elementsWithoutNode)
elementsWithoutNode.forEach((element) => {
const segment = reads[element.readIndex].path[element.pathIndex];
segment.y = bottomY[segment.order];
Expand Down Expand Up @@ -876,18 +874,18 @@ function setOccupiedUntil(map, read, pathIndex, y, node) {
}
}

// compare read segments which are outside of nodes
// by the y-coord of where they are coming from
// compare read segments which are outside of nodes to sort them in a good horizontal
// and then vertical display order.
function compareNoNodeReads(a, b) {
// Sort by order by segments
const readA = reads[a.readIndex];
const readB = reads[b.readIndex];
const segmentA = readA.path[a.pathIndex];
const segmentB = readB.path[b.pathIndex];
// Sort by order by segments
if (segmentA.order !== segmentB.order) {
return segmentA.order - segmentB.order;
}
// Sort by reads' source track
const readA = reads[a.readIndex];
const readB = reads[b.readIndex];
if (readA.sourceTrackID !== readB.sourceTrackID){
return readA.sourceTrackID - readB.sourceTrackID;
}
Expand Down

0 comments on commit 67cb6e3

Please sign in to comment.