Skip to content
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

[WIP] Implement Sample Sheets #19305

Draft
wants to merge 10 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
"@types/jest": "^29.5.12",
"@vueuse/core": "^10.5.0",
"@vueuse/math": "^10.9.0",
"ag-grid-community": "^30",
"ag-grid-vue": "^30",
"assert": "^2.1.0",
"axios": "^1.6.2",
"babel-runtime": "^6.26.0",
Expand Down Expand Up @@ -106,11 +108,13 @@
"vega-embed": "^6.26.0",
"vega-lite": "^5.21.0",
"vue": "^2.7.14",
"vue-class-component": "^7.2.6",
"vue-echarts": "^7.0.3",
"vue-infinite-scroll": "^2.0.2",
"vue-multiselect": "^2.1.7",
"vue-observe-visibility": "^1.0.0",
"vue-prismjs": "^1.2.0",
"vue-property-decorator": "^9.1.2",
"vue-router": "^3.6.5",
"vue-rx": "^6.2.0",
"vue-virtual-scroll-list": "^2.3.5",
Expand Down
4 changes: 4 additions & 0 deletions client/src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,4 +312,8 @@ export type ObjectExportTaskResponse = components["schemas"]["ObjectExportTaskRe
export type ExportObjectRequestMetadata = components["schemas"]["ExportObjectRequestMetadata"];
export type ExportObjectResultMetadata = components["schemas"]["ExportObjectResultMetadata"];

export type SampleSheetColumnDefinition = components["schemas"]["SampleSheetColumnDefinition"];
export type SampleSheetColumnDefinitionType = SampleSheetColumnDefinition["type"];
export type SampleSheetColumnDefinitions = SampleSheetColumnDefinition[] | null;

export type AsyncTaskResultSummary = components["schemas"]["AsyncTaskResultSummary"];
118 changes: 118 additions & 0 deletions client/src/api/schema/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4060,6 +4060,23 @@ export interface paths {
patch?: never;
trace?: never;
};
"/api/sample_sheet_workbook/generate": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
/** Create an XLSX workbook for a sample sheet definition. */
get: operations["dataset_collections__workbook_download"];
put?: never;
post?: never;
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/api/short_term_storage/{storage_request_id}": {
parameters: {
query?: never;
Expand Down Expand Up @@ -6929,6 +6946,11 @@ export interface components {
* @description The type of the collection, can be `list`, `paired`, or define subcollections using `:` as separator like `list:paired` or `list:list`.
*/
collection_type?: string | null;
/**
* Column Definitions
* @description Specify definitions for row data if collection_type if sample_sheet
*/
column_definitions?: components["schemas"]["SampleSheetColumnDefinition"][] | null;
/**
* Content
* @description Depending on the `source` it can be:
Expand Down Expand Up @@ -6982,6 +7004,13 @@ export interface components {
* @description The name of the new collection.
*/
name?: string | null;
/**
* Row data
* @description Specify rows of metadata data corresponding to an indentifier if collection_type is sample_sheet
*/
rows?: {
[key: string]: (string | number | boolean)[];
} | null;
/**
* Source
* @description The source of the content. Can be other history element to be copied or library elements.
Expand Down Expand Up @@ -7136,6 +7165,11 @@ export interface components {
* @description The type of the collection, can be `list`, `paired`, or define subcollections using `:` as separator like `list:paired` or `list:list`.
*/
collection_type?: string | null;
/**
* Column Definitions
* @description Specify definitions for row data if collection_type if sample_sheet
*/
column_definitions?: components["schemas"]["SampleSheetColumnDefinition"][] | null;
/**
* Copy Elements
* @description Whether to create a copy of the source HDAs for the new collection.
Expand Down Expand Up @@ -7174,6 +7208,13 @@ export interface components {
* @description The name of the new collection.
*/
name?: string | null;
/**
* Row data
* @description Specify rows of metadata data corresponding to an indentifier if collection_type is sample_sheet
*/
rows?: {
[key: string]: (string | number | boolean)[];
} | null;
};
/** CreatePagePayload */
CreatePagePayload: {
Expand Down Expand Up @@ -7774,6 +7815,11 @@ export interface components {
* @description Dataset Collection Element summary information.
*/
DCESummary: {
/**
* Columns
* @description A row (or list of columns) of data associated with this element
*/
columns?: (string | number | boolean)[] | null;
/**
* Element Identifier
* @description The actual name of this element.
Expand Down Expand Up @@ -10376,6 +10422,11 @@ export interface components {
* @description The type of the collection, can be `list`, `paired`, or define subcollections using `:` as separator like `list:paired` or `list:list`.
*/
collection_type?: string | null;
/**
* Column Definitions
* @description Column data associated with each element of this collection.
*/
column_definitions?: components["schemas"]["SampleSheetColumnDefinition"][] | null;
/**
* Contents URL
* @description The relative URL to access the contents of this History.
Expand Down Expand Up @@ -10515,6 +10566,11 @@ export interface components {
* @description The type of the collection, can be `list`, `paired`, or define subcollections using `:` as separator like `list:paired` or `list:list`.
*/
collection_type: string;
/**
* Column Definitions
* @description Column data associated with each element of this collection.
*/
column_definitions?: components["schemas"]["SampleSheetColumnDefinition"][] | null;
/**
* Contents URL
* @description The relative URL to access the contents of this History.
Expand Down Expand Up @@ -15735,6 +15791,24 @@ export interface components {
RootModel_Dict_str__int__: {
[key: string]: number;
};
/** SampleSheetColumnDefinition */
SampleSheetColumnDefinition: {
/** Description */
description?: string | null;
/** Name */
name: string;
/** Restrictions */
restrictions?: string[] | null;
/** Suggestions */
suggestions?: string[] | null;
/**
* Type
* @enum {string}
*/
type: "string" | "int" | "float" | "boolean";
/** Validators */
validators?: Record<string, never>[] | null;
};
/** SearchJobsPayload */
SearchJobsPayload: {
/**
Expand Down Expand Up @@ -31902,6 +31976,50 @@ export interface operations {
};
};
};
dataset_collections__workbook_download: {
parameters: {
query: {
/** @description Base64 encoding of column definitions. */
column_definitions: string;
/** @description Filename of the workbook download to generate */
filename?: string | null;
};
header?: {
/** @description The user ID that will be used to effectively make this API call. Only admins and designated users can make API calls on behalf of other users. */
"run-as"?: string | null;
};
path?: never;
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Successful Response */
200: {
headers: {
[name: string]: unknown;
};
content?: never;
};
/** @description Request Error */
"4XX": {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["MessageExceptionModel"];
};
};
/** @description Server Error */
"5XX": {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["MessageExceptionModel"];
};
};
};
};
serve_api_short_term_storage__storage_request_id__get: {
parameters: {
query?: never;
Expand Down
10 changes: 10 additions & 0 deletions client/src/components/Collections/CollectionCreatorModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import type { CollectionType, DatasetPair } from "../History/adapters/buildColle
import ListCollectionCreator from "./ListCollectionCreator.vue";
import PairCollectionCreator from "./PairCollectionCreator.vue";
import PairedListCollectionCreator from "./PairedListCollectionCreator.vue";
import SampleSheetCollectionCreator from "./SampleSheetCollectionCreator.vue";
import Heading from "@/components/Common/Heading.vue";
import GenericItem from "@/components/History/Content/GenericItem.vue";
import LoadingSpan from "@/components/LoadingSpan.vue";
Expand Down Expand Up @@ -313,6 +314,15 @@ function resetModal() {
:extensions="props.extensions"
@clicked-create="createPairedCollection"
@on-cancel="hideModal" />
<SampleSheetCollectionCreator
v-else-if="props.collectionType === 'sample_sheet'"
:history-id="props.historyId"
:initial-elements="creatorItems || []"
:default-hide-source-items="props.defaultHideSourceItems"
:from-selection="fromSelection"
:extensions="props.extensions"
@clicked-create="createPairedCollection"
@on-cancel="hideModal" />
</BModal>
</template>

Expand Down
32 changes: 32 additions & 0 deletions client/src/components/Collections/SampleSheetCollectionCreator.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<script lang="ts" setup>
import SampleSheetGrid from "./sheet/SampleSheetGrid.vue";

const initialElements = [
["https://zenodo.org/records/3263975/files/DRR000770.fastqsanger.gz", 1, "treatment1", false],
["https://zenodo.org/records/3263975/files/DRR000771.fastqsanger.gz", 2, "treatment1", false],
["https://zenodo.org/records/3263975/files/DRR000772.fastqsanger.gz", 1, "none", true],
["https://zenodo.org/records/3263975/files/DRR000773.fastqsanger.gz", 1, "treatment2", false],
["https://zenodo.org/records/3263975/files/DRR000774.fastqsanger.gz", 2, "treatment3", false],
];

const columnDefinitions = [
{ name: "replicate number", type: "int", description: "The replicate number of this sample." },
{
name: "treatment",
type: "string",
restrictions: ["treatment1", "treatment2", "none"],
description: "The treatment code for this sample.",
},
{
name: "is control?",
type: "boolean",
description: "Was this sample a control? If TRUE, please ensure treatment is set to none.",
},
];
</script>

<template>
<div class="sample-sheet-collection-creator">
<SampleSheetGrid :initial-elements="initialElements" :columnDefinitions="columnDefinitions" />

Check warning on line 30 in client/src/components/Collections/SampleSheetCollectionCreator.vue

View workflow job for this annotation

GitHub Actions / client-unit-test (18)

Attribute ':columnDefinitions' must be hyphenated
</div>
</template>
Loading
Loading