Skip to content

Commit

Permalink
Make the breakpoint split view use the flags variable instead of flag…
Browse files Browse the repository at this point in the history
…s helpers
  • Loading branch information
cmdcolin committed Dec 9, 2020
1 parent 20b12f3 commit 2032c4c
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions plugins/breakpoint-split-view/src/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ export default function stateModelFactory(pluginManager: any) {

// Paired reads are handled slightly differently than split reads
hasPairedReads(trackConfigId: string) {
return this.getTrackFeatures(trackConfigId).find(f =>
f.get('multi_segment_first'),
return this.getTrackFeatures(trackConfigId).find(
f => f.get('flags') & 64,
)
},

Expand Down Expand Up @@ -170,7 +170,9 @@ export default function stateModelFactory(pluginManager: any) {

// this finds candidate features that share the same name
for (const feature of features.values()) {
if (!alreadySeen.has(feature.id()) && !feature.get('unmapped')) {
const id = feature.id()
const unmapped = feature.get('flags') & 4
if (!alreadySeen.has(id) && !unmapped) {
const n = feature.get('name')
if (!candidates[n]) {
candidates[n] = []
Expand All @@ -192,11 +194,12 @@ export default function stateModelFactory(pluginManager: any) {

// this finds candidate features that share the same name
for (const feature of features.values()) {
if (
!alreadySeen.has(feature.id()) &&
!feature.get('multi_segment_all_correctly_aligned') &&
!feature.get('unmapped')
) {
const flags = feature.get('flags')
const id = feature.id()
const unmapped = flags & 4
const correctlyPaired = flags & 2

if (!alreadySeen.has(id) && !correctlyPaired && !unmapped) {
const n = feature.get('name')
if (!candidates[n]) {
candidates[n] = []
Expand Down

0 comments on commit 2032c4c

Please sign in to comment.