Skip to content

Commit

Permalink
Fix read vs ref not finding primary alignment on certain CRAM files (#…
Browse files Browse the repository at this point in the history
…2952)

* Properly report error and get features at coord 0 in read vs ref

* Update cram-js to avoid off-by-one bug compensation
  • Loading branch information
cmdcolin authored May 16, 2022
1 parent f11b35a commit 476bbb3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 16 deletions.
2 changes: 1 addition & 1 deletion plugins/alignments/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"dependencies": {
"@babel/runtime": "^7.17.9",
"@gmod/bam": "^1.1.15",
"@gmod/cram": "^1.6.3",
"@gmod/cram": "^1.6.4",
"@material-ui/icons": "^4.9.1",
"color": "^3.1.2",
"copy-to-clipboard": "^3.3.1",
Expand Down
18 changes: 7 additions & 11 deletions plugins/linear-comparative-view/src/ReadVsRef.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ export function WindowSizeDlg(props: {
const { rpcManager } = getSession(track)
const adapterConfig = getConf(track, 'adapter')
const sessionId = getRpcSessionId(track)
const assemblyNames = getConf(track, 'assemblyNames')

const feats = (await rpcManager.call(sessionId, 'CoreGetFeatures', {
adapterConfig,
sessionId,
Expand All @@ -205,10 +205,10 @@ export function WindowSizeDlg(props: {
refName: saRef,
start: +saStart - 1,
end: +saStart,
assemblyName: assemblyNames[0],
},
],
})) as Feature[]

const result = feats.find(
f =>
f.get('name') === preFeature.get('name') &&
Expand Down Expand Up @@ -496,13 +496,8 @@ export function WindowSizeDlg(props: {
}

return (
<Dialog
open
onClose={handleClose}
aria-labelledby="alert-dialog-title"
aria-describedby="alert-dialog-description"
>
<DialogTitle id="alert-dialog-title">
<Dialog open onClose={handleClose}>
<DialogTitle>
Set window size
<IconButton
aria-label="close"
Expand All @@ -513,7 +508,9 @@ export function WindowSizeDlg(props: {
</IconButton>
</DialogTitle>
<DialogContent>
{!primaryFeature ? (
{error ? (
<Typography color="error">{`${error}`}</Typography>
) : !primaryFeature ? (
<div>
<Typography>
To accurately perform comparison we are fetching the primary
Expand All @@ -527,7 +524,6 @@ export function WindowSizeDlg(props: {
Show an extra window size around each part of the split alignment.
Using a larger value can allow you to see more genomic context.
</Typography>
{error ? <Typography color="error">{`${error}`}</Typography> : null}

<TextField
value={windowSize}
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1419,10 +1419,10 @@
dependencies:
long "^4.0.0"

"@gmod/cram@^1.6.3":
version "1.6.3"
resolved "https://registry.yarnpkg.com/@gmod/cram/-/cram-1.6.3.tgz#250775a681904477cb06988a10ad0253d4dc69aa"
integrity sha512-fuKmrFbhpiQLkUnMj64kujKjF0ZC8ZF2EvL479ilwRq9vsMdlxpWdcC/pmEYdM+OgyHy8aZNBRmkt/rKrDJzrw==
"@gmod/cram@^1.6.4":
version "1.6.4"
resolved "https://registry.yarnpkg.com/@gmod/cram/-/cram-1.6.4.tgz#4c585238ba201381f2e794785f6497b0b2c3bd1a"
integrity sha512-uj3BOukiQmL9JwJFMN7qqkvhfWMVVYhymrUA6+z6YMg3u107azw9Oxip6UEUHlVtrJhh2jyLDYgpewFLghJZew==
dependencies:
"@gmod/binary-parser" "^1.3.5"
"@jkbonfield/htscodecs" "^0.5.1"
Expand Down

0 comments on commit 476bbb3

Please sign in to comment.