-
Notifications
You must be signed in to change notification settings - Fork 0
fix(MILAB-5944): tsv from remote fails #38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
4a7083b
9219654
7d858db
2c7913b
eefebf0
9f53c36
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| --- | ||
| '@platforma-open/milaboratories.immune-assay-data.workflow': minor | ||
| '@platforma-open/milaboratories.immune-assay-data.model': minor | ||
| '@platforma-open/milaboratories.immune-assay-data.ui': minor | ||
| '@platforma-open/milaboratories.immune-assay-data': minor | ||
| --- | ||
|
|
||
| Fix assay file import to support remote (non-local) files | ||
|
|
||
| Previously, column detection used `lsDriver.getLocalFileContent()` which only works for locally-mounted files. Files from remote storages would silently fail, leaving the block unconfigurable. | ||
|
|
||
| Now uses a prerun workflow step to import the file and expose it as a blob, and `ReactiveFileContent` in the UI to read it via `blobDriver` — the same pattern used by samples-and-data. This works for both local and remote files. |
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,3 @@ | ||
| import type { LocalImportFileHandle } from '@platforma-sdk/model'; | ||
| import { getRawPlatformaInstance } from '@platforma-sdk/model'; | ||
|
|
||
| export interface FastaRecord { | ||
| header: string; | ||
| sequence: string; | ||
|
|
@@ -124,27 +121,3 @@ export function fastaToTable(records: FastaRecord[]): string { | |
| // Combine header and data | ||
| return [headerRow, ...dataRows].join('\n'); | ||
| } | ||
|
|
||
| /** | ||
| * Process FASTA file and convert to table format | ||
| */ | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This function combined file I/O (
|
||
| export async function processFastaFile(file: LocalImportFileHandle): Promise<{ content: string; error?: string }> { | ||
| try { | ||
| const rawContent = await getRawPlatformaInstance().lsDriver.getLocalFileContent(file); | ||
| const content = new TextDecoder().decode(rawContent); | ||
|
|
||
| const parseResult = parseFastaContent(content); | ||
|
|
||
| if (parseResult.error) { | ||
| return { content: '', error: parseResult.error }; | ||
| } | ||
|
|
||
| const tableContent = fastaToTable(parseResult.records); | ||
| return { content: tableContent }; | ||
| } catch (error) { | ||
| return { | ||
| content: '', | ||
| error: `Failed to read FASTA file: ${error instanceof Error ? error.message : 'Unknown error'}`, | ||
| }; | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| wf := import("@platforma-sdk/workflow-tengo:workflow") | ||
| file := import("@platforma-sdk/workflow-tengo:file") | ||
|
|
||
| wf.body(func(args) { | ||
| if is_undefined(args.fileHandle) { | ||
| return { outputs: {}, exports: {} } | ||
| } | ||
|
|
||
| importedFile := file.importFile(args.fileHandle) | ||
|
PaulNewling marked this conversation as resolved.
|
||
|
|
||
| return { | ||
| outputs: { | ||
| assayFile: file.exportFile(importedFile.file) | ||
| }, | ||
| exports: {} | ||
| } | ||
| }) | ||
Uh oh!
There was an error while loading. Please reload this page.