Skip to content

Commit

Permalink
[skip ci] Fix ability to filter certain fields in BAM/CRAM files (#3694)
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed May 9, 2023
1 parent 2502d5e commit 66e7d74
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion plugins/alignments/src/BamAdapter/BamAdapter.ts
Expand Up @@ -211,7 +211,9 @@ export default class BamAdapter extends BaseFeatureDataAdapter {

if (tagFilter) {
const val = record.get(tagFilter.tag)
if (!(val === '*' ? val !== undefined : val === tagFilter.value)) {
if (
!(val === '*' ? val !== undefined : `${val}` === tagFilter.value)
) {
continue
}
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/alignments/src/CramAdapter/CramAdapter.ts
Expand Up @@ -255,7 +255,7 @@ export default class CramAdapter extends BaseFeatureDataAdapter {
filtered = filtered.filter(record => {
// @ts-expect-error
const val = record[tagFilter.tag]
return val === '*' ? val !== undefined : val === tagFilter.value
return val === '*' ? val !== undefined : `${val}` === tagFilter.value
})
}

Expand Down

0 comments on commit 66e7d74

Please sign in to comment.