Skip to content

Commit

Permalink
Fix issue with tagFilter * in alignments track (#4213)
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Feb 19, 2024
1 parent 75756d5 commit 39a61ca
Show file tree
Hide file tree
Showing 3 changed files with 957 additions and 987 deletions.
6 changes: 5 additions & 1 deletion plugins/alignments/src/BamAdapter/BamAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,11 @@ export default class BamAdapter extends BaseFeatureDataAdapter {

if (tagFilter) {
const v = record.get(tagFilter.tag)
if (!(v === '*' ? v !== undefined : `${v}` === tagFilter.value)) {
if (
!(tagFilter.value === '*'
? v !== undefined
: `${v}` === tagFilter.value)
) {
continue
}
}
Expand Down
6 changes: 5 additions & 1 deletion plugins/alignments/src/CramAdapter/CramAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,11 @@ export default class CramAdapter extends BaseFeatureDataAdapter {
tagFilter.tag === 'RG'
? this.samHeader.readGroups?.[record.readGroupId]
: record.tags[tagFilter.tag]
if (!(v === '*' ? v !== undefined : `${v}` === tagFilter.value)) {
if (
!(tagFilter.value === '*'
? v !== undefined
: `${v}` === tagFilter.value)
) {
continue
}
}
Expand Down
Loading

0 comments on commit 39a61ca

Please sign in to comment.