Skip to content

Commit

Permalink
wip(web): Worker for smithereens
Browse files Browse the repository at this point in the history
+ `web/src/app.d.ts` : define new type `Smithereens`
+ `web/src/lib/constants.ts` : define new type `defaultSmithereens`

Both of `Smithereens` and `defaultSmithereens` have `fragmentsData`, `fragmentsLibrary`, `muropeptidesData` and
`muropeptidesLibrary` defined.

+ Remove `fragmentsLibraries` and `muropeptidesLibraries` from `web/src/lib/pgfinder.ts`
+ Add new `web/src/lib/smithereens.ts` this imports the `defaultSmithereens` and uses it to create a new `smithereens`
  object of type `Smithereens` with values from `defaultSmithereens`. There is then an `async` command which should load
  the `static/data/{reference_masses,target_structures}/index.json` and then `onMount()` when `Ready` return these.
+ `web/src/routes/+page.svelte` then...
  + imports `Smithereens` from `web/src/lib/smithereens.ts` as a worker.
  + Meant to start Smithereens with if/else statements for different messages and hoping to get the
    `fragmentsLibrariesIndex` and `muropeptidesLibrariesIndex` returned but it seems not to happen.

Questions

+
+ What should the types of `proxy` in `postResult()` and `error` in `postError()` (both within
  `web/src/lib/smithereens.ts`) be?
  • Loading branch information
slackline committed May 17, 2024
1 parent f2cb205 commit 8648e52
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions web/src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@
processingSmithereens = false;
})
// Reactively compute if Smithereens is ready
$: SmithereensReady = !loading && !processingSmithereens && smithereens.fragmentsLibrary !== undefined && smithereens.muropeptidesLibrary !== undefined;
$: SmithereensReady = !loading && !processingSmithereens && smithereensWorker.fragmentsLibrary !== undefined && smithereensWorker.muropeptidesLibrary !== undefined;
$: console.log(`SmithereensReady : ${SmithereensReady}`);
// $: console.log(`FragmentsLibraryIndex : ${smithereens.fragmentsLibrary}`);
//$ : console.log(`MuropeptidesLibraryIndex : ${smithereens.muropeptidesLibrary}`);
// $: console.log(`FragmentsLibraryIndex : ${smithereensWorker.fragmentsLibrary}`);
//$ : console.log(`MuropeptidesLibraryIndex : ${smithereensWorker.muropeptidesLibrary}`);
// Send data to Smithereens for processing
function runSmithereensAnalysis() {
Expand Down

0 comments on commit 8648e52

Please sign in to comment.