Skip to content

Commit

Permalink
Fix plaintext indexing desktop
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Sep 19, 2024
1 parent 03e1d91 commit f3d9323
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 deletions.
36 changes: 33 additions & 3 deletions packages/text-indexing/src/TextIndexing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,22 @@ async function* indexFiles({
indexingAttributes: attributesToIndex = idx1,
} = textSearching || {}
let myTotalBytes: number | undefined
if (type === 'Gff3TabixAdapter' || type === 'Gff3Adapter') {
if (type === 'Gff3Adapter') {
yield* indexGff3({
config: track,
attributesToIndex,
inLocation: getLoc('gffLocation', track),
outDir,
featureTypesToExclude,
onStart: totalBytes => {
myTotalBytes = totalBytes
},
onUpdate: progressBytes => {
statusCallback(`${progressBytes}/${myTotalBytes}`)
},
})
}
if (type === 'Gff3TabixAdapter') {
yield* indexGff3({
config: track,
attributesToIndex,
Expand All @@ -229,7 +244,20 @@ async function* indexFiles({
statusCallback(`${progressBytes}/${myTotalBytes}`)
},
})
} else if (type === 'VcfTabixAdapter' || type === 'VcfAdapter') {
} else if (type === 'VcfAdapter') {
yield* indexVcf({
config: track,
attributesToIndex,
inLocation: getLoc('vcfLocation', track),
outDir,
onStart: totalBytes => {
myTotalBytes = totalBytes
},
onUpdate: progressBytes => {
statusCallback(`${progressBytes}/${myTotalBytes}`)
},
})
} else if (type === 'VcfTabixAdapter') {
yield* indexVcf({
config: track,
attributesToIndex,
Expand All @@ -252,7 +280,9 @@ function getLoc(attr: string, config: Track) {
| { uri: string; localPath: string }
| undefined
if (!elt) {
throw new Error('none')
throw new Error(
`can't get find ${attr} from ${config.adapter} for text indexing`,
)
}
return elt.uri || elt.localPath
}
Expand Down
1 change: 1 addition & 0 deletions products/jbrowse-desktop/src/indexJobsModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ export default function jobsModelFactory(_pluginManager: PluginManager) {
}
}
} catch (e) {
console.error(e)
if (isAbortException(e)) {
self.session?.notify('Cancelled job', 'info')
} else {
Expand Down

0 comments on commit f3d9323

Please sign in to comment.