Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
dbolotin committed Sep 7, 2024
1 parent a85c181 commit b951bb1
Show file tree
Hide file tree
Showing 18 changed files with 484 additions and 67 deletions.
44 changes: 32 additions & 12 deletions model/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,39 @@ export const platforma = BlockModel.create<BlockArgs>('Heavy')

.output('qc', (ctx) =>
parseResourceMap(ctx.outputs?.resolve({ field: 'qc', assertFieldType: 'Input' }), (acc) =>
acc.getRemoteFileHandle()
acc.getFileHandle()
)
)

.output('reports', (ctx) =>
parseResourceMap(ctx.outputs?.resolve({ field: 'reports', assertFieldType: 'Input' }), (acc) =>
acc.getRemoteFileHandle()
acc.getFileHandle()
)
)

.output('logs', (ctx) => {
return parseResourceMap(
ctx.outputs?.resolve({ field: 'logs', assertFieldType: 'Input' }),
(acc) => acc.getLogHandle()
);
return ctx.outputs !== undefined
? parseResourceMap(ctx.outputs?.resolve({ field: 'logs', assertFieldType: 'Input' }), (acc) =>
acc.getLogHandle()
)
: undefined;
})

.output('progress', (ctx) => {
return parseResourceMap(
ctx.outputs?.resolve({ field: 'logs', assertFieldType: 'Input' }),
(acc) => acc.getProgressLog(ProgressPrefix)
);
return ctx.outputs !== undefined
? parseResourceMap(ctx.outputs?.resolve({ field: 'logs', assertFieldType: 'Input' }), (acc) =>
acc.getProgressLog(ProgressPrefix)
)
: undefined;
})

.output('done', (ctx) => {
return ctx.outputs !== undefined
? parseResourceMap(
ctx.outputs?.resolve({ field: 'clns', assertFieldType: 'Input' }),
(acc) => true
).data.map((e) => e.key[0] as string)
: undefined;
})

.output('clones', (ctx) => {
Expand Down Expand Up @@ -124,11 +135,19 @@ export const platforma = BlockModel.create<BlockArgs>('Heavy')

// if (sampleLabelsObj.obj.data.resourceType.name !== 'PColumn/Json') return undefined;

return sampleLabelsObj.obj.data.getDataAsJson();
return Object.fromEntries(
Object.entries(sampleLabelsObj.obj.data.getDataAsJson<Record<string, string>>()).map((e) => [
JSON.parse(e[0])[0],
e[1]
])
) satisfies Record<string, string>;
})

.sections((ctx) => {
return [{ type: 'link', href: '/', label: 'Settings' }];
return [
{ type: 'link', href: '/', label: 'Settings' },
{ type: 'link', href: '/reports', label: 'Reports' }
];
})

.inputsValid((ctx) => BlockArgsValid.safeParse(ctx.args).success)
Expand All @@ -139,4 +158,5 @@ export type BlockOutputs = InferOutputsType<typeof platforma>;
export type Href = InferHrefType<typeof platforma>;
export * from './args';
export * from './helpers';
export * from './logs';
export { BlockArgs };
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
"@milaboratory/pl-middle-layer": "file:/Volumes/Data/Projects/MiLaboratory/platforma/ts-pl-middle-layer",
"@milaboratory/sdk-ui": "file:/Volumes/Data/Projects/MiLaboratory/platforma/ts-sdk-ui",
"@milaboratory/sdk-test": "file:/Volumes/Data/Projects/MiLaboratory/platforma/ts-sdk-test",
"@milaboratory/sdk-vue": "file:/Volumes/Data/Projects/MiLaboratory/platforma/sdk-vue",
"@milaboratory/milaboratories.samples-and-data.workflow": "file:/Volumes/Data/Projects/MiLaboratory/blocks-beta/block-samples-and-data/workflow"
}
}
Expand Down
78 changes: 57 additions & 21 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ catalog:
'@milaboratory/pl-block-tools': ^2.1.5
'@milaboratory/block-builder': ^1.2.3

'@milaboratory/sdk-ui': ^0.12.21
'@milaboratory/sdk-ui': ^0.12.22
'@milaboratory/sdk-test': ^1.5.5

'@milaboratory/tengo-sdk': ^1.2.1
'@milaboratory/pframes-conv': ^0.4.25

'@milaboratory/mixcr': 4.7.0-68-develop
'@milaboratory/mixcr': 4.7.0-70-develop

'@milaboratory/platforma-uikit': ^1.1.2
'@milaboratory/platforma-uikit': ^1.1.4
'@milaboratory/sdk-vue': ^1.1.1
'@milaboratory/helpers': ^1.5.3

Expand Down
6 changes: 4 additions & 2 deletions test/assets/expected_results/mixcr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@

set -e

mixcr exportPreset --preset-name milab-human-dna-xcr-7genes-multiplex preset.json
mixcr analyze milab-human-dna-xcr-7genes-multiplex ../small_data_R1.fastq.gz ../small_data_R2.fastq.gz result
mixcr exportPreset --preset-name milab-human-dna-xcr-7genes-multiplex -f preset.json

# --add-step assembleContigs
mixcr analyze milab-human-dna-xcr-7genes-multiplex -f ../small_data_R1.fastq.gz ../small_data_R2.fastq.gz result
12 changes: 6 additions & 6 deletions test/src/wf.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ blockTest(
]
} satisfies SamplesAndDataBlockArgs);
await project.runBlock(sndBlockId);
await helpers.awaitBlockDone(sndBlockId);
await helpers.awaitBlockDone(sndBlockId, 4000);
const sndBlockState = project.getBlockState(sndBlockId);
const clonotypingBlockState = project.getBlockState(clonotypingBlockId);

Expand Down Expand Up @@ -128,9 +128,9 @@ blockTest(
)) as InferBlockState<typeof platforma>;

const outputs2 = wrapOutputs<BlockOutputs>(clonotypingStableState2.outputs);
console.dir(outputs2.sampleLabels, { depth: 5 });
console.log(JSON.stringify([sample1Id]));
expect(outputs2.sampleLabels[JSON.stringify([sample1Id])]).toBeDefined();
// console.dir(outputs2.sampleLabels, { depth: 5 });
// console.log(JSON.stringify([sample1Id]));
expect(outputs2.sampleLabels[sample1Id]).toBeDefined();

await project.runBlock(clonotypingBlockId);
const clonotypingStableState3 = (await helpers.awaitBlockDoneAndGetStableBlockState(
Expand All @@ -155,7 +155,7 @@ blockTest(
).toString('utf8')
);

console.dir(alignJsonReport, { depth: 5 });
// console.dir(alignJsonReport, { depth: 5 });
expect(alignJsonReport.aligned).toBeDefined();
expect(alignJsonReport.aligned).greaterThan(2);

Expand All @@ -165,7 +165,7 @@ blockTest(

const clonesPfColumnList = await ml.driverKit.pFrameDriver.listColumns(clonesPfHandle);

console.log(clonesPfColumnList);
// console.log(clonesPfColumnList);
expect(clonesPfColumnList).length.to.greaterThanOrEqual(1);

// console.dir(clonotypingStableState3, { depth: 8 });
Expand Down
Empty file removed ui/src/Report.vue
Empty file.
Loading

0 comments on commit b951bb1

Please sign in to comment.