diff --git a/src/api/comp_assignment_method.yaml b/src/api/comp_assignment_method.yaml index 3765d13d..51bff2f3 100644 --- a/src/api/comp_assignment_method.yaml +++ b/src/api/comp_assignment_method.yaml @@ -6,9 +6,17 @@ info: description: An assignment method assigns transcripts to cells based on the spatial data and the cell segmentation. arguments: - name: "--input" + required: true + direction: input + __merge__: file_spatialdata.yaml + - name: "--segmentation_input" + required: false + direction: input __merge__: file_spatialdata_segmented.yaml + - name: "--input_sc" + required: false direction: input - required: true + __merge__: file_singlecell.yaml - name: "--output" __merge__: file_spatialdata_assigned.yaml direction: output @@ -18,3 +26,6 @@ arguments: # dest: resources_test/common/pancreas # - type: python_script # path: /common/component_tests/run_and_check_output.py + + + \ No newline at end of file diff --git a/src/api/comp_celltype_annotation_method.yaml b/src/api/comp_celltype_annotation_method.yaml index 51ca5f35..9cbd37d9 100644 --- a/src/api/comp_celltype_annotation_method.yaml +++ b/src/api/comp_celltype_annotation_method.yaml @@ -8,7 +8,15 @@ arguments: - name: --input required: true direction: input - __merge__: /src/api/file_spatial_norm_counts.yaml + __merge__: file_spatial_norm_counts.yaml + - name: --input_transcripts + __merge__: file_spatialdata_assigned.yaml + direction: input + required: false + - name: --input_sc + required: false + direction: input + __merge__: file_singlecell.yaml - name: --celltype_key required: false direction: input @@ -17,7 +25,7 @@ arguments: - name: --output required: true direction: output - __merge__: /src/api/file_spatial_with_celltypes.yaml + __merge__: file_spatial_with_celltypes.yaml # test_resources: # - path: /resources_test/common/pancreas # dest: resources_test/common/pancreas diff --git a/src/api/comp_expr_correction_method.yaml b/src/api/comp_expr_correction_method.yaml index 128c3306..dcccd0aa 100644 --- a/src/api/comp_expr_correction_method.yaml +++ b/src/api/comp_expr_correction_method.yaml @@ -9,6 +9,10 @@ arguments: required: true direction: input __merge__: /src/api/file_spatial_with_celltypes.yaml + - name: --input_sc + required: false + direction: input + __merge__: /src/api/file_singlecell.yaml - name: --output required: true direction: output diff --git a/src/api/comp_normalisation_method.yaml b/src/api/comp_normalisation_method.yaml index b1ad112e..a2c02af2 100644 --- a/src/api/comp_normalisation_method.yaml +++ b/src/api/comp_normalisation_method.yaml @@ -9,11 +9,16 @@ arguments: - name: --input required: true direction: input - __merge__: /src/api/file_spatial_raw_counts.yaml + __merge__: file_spatial_raw_counts.yaml + - name: --input_volume + type: file + description: H5ad with an obs column of cell volumes calculated from spatial transcriptomics data. + required: false + __merge__: file_cell_volumes.yaml - name: --output required: true direction: output - __merge__: /src/api/file_spatial_norm_counts.yaml + __merge__: file_spatial_norm_counts.yaml # test_resources: # - path: /resources_test/common/pancreas diff --git a/src/assignment_methods/basic/config.vsh.yaml b/src/assignment_methods/basic/config.vsh.yaml index f0370341..8fa0abb6 100644 --- a/src/assignment_methods/basic/config.vsh.yaml +++ b/src/assignment_methods/basic/config.vsh.yaml @@ -1,27 +1,17 @@ name: basic namespace: assignment_methods +__merge__: /src/api/comp_assignment_method.yaml + arguments: - - name: --input - required: true - direction: input - __merge__: /src/api/file_spatialdata.yaml - name: --transcripts_key type: string description: The key of the transcripts within the points of the spatial data required: true - - name: --segmentation_input - required: true - direction: input - __merge__: /src/api/file_spatialdata_segmented.yaml - name: --coordinate_system type: string description: The key of the pixel space coordinate system within the spatial data required: true - - name: --output - required: true - direction: output - __merge__: /src/api/file_spatialdata_assigned.yaml resources: - type: python_script diff --git a/src/assignment_methods/basic/script.py b/src/assignment_methods/basic/script.py index d257e48b..ae9a8b74 100644 --- a/src/assignment_methods/basic/script.py +++ b/src/assignment_methods/basic/script.py @@ -21,6 +21,10 @@ # if par['coordinate_system'] == None: # par['coordinate_system'] = 'global' +# Optional parameter check: For this specific assignment method the par['segmentation_input'] is required +assert par['segmentation_input'] is not None, 'Segmentation input is required for this assignment method.' + + # Read input print('Reading input files', flush=True) sdata = sd.read_zarr(par['input']) diff --git a/src/cell_volume_methods/alpha_shapes/config.vsh.yaml b/src/cell_volume_methods/alpha_shapes/config.vsh.yaml index f71bceac..ffbe8030 100644 --- a/src/cell_volume_methods/alpha_shapes/config.vsh.yaml +++ b/src/cell_volume_methods/alpha_shapes/config.vsh.yaml @@ -1,20 +1,14 @@ name: alpha_shapes namespace: cell_volume_methods +__merge__: /src/api/comp_cell_volume_method.yaml + arguments: - - name: --input - required: true - direction: input - __merge__: /src/api/file_spatialdata_assigned.yaml - name: --alpha type: double description: Alpha parameter for calculating the alpha shape (0.0 refers to the convex hull) required: false default: 0.0 - - name: --output - required: true - direction: output - __merge__: /src/api/file_cell_volumes.yaml resources: - type: python_script diff --git a/src/celltype_annotation_methods/ssam/config.vsh.yaml b/src/celltype_annotation_methods/ssam/config.vsh.yaml index 002c608f..6b8717e0 100644 --- a/src/celltype_annotation_methods/ssam/config.vsh.yaml +++ b/src/celltype_annotation_methods/ssam/config.vsh.yaml @@ -1,33 +1,14 @@ name: ssam namespace: celltype_annotation_methods +__merge__: /src/api/comp_celltype_annotation_method.yaml + arguments: - - name: --input - required: true - direction: input - __merge__: /src/api/file_spatial_norm_counts.yaml - - name: --input_transcripts - required: true - direction: input - __merge__: /src/api/file_spatialdata_assigned.yaml - - name: --input_sc - required: true - direction: input - __merge__: /src/api/file_singlecell.yaml - name: --um_per_pixel # TODO: Should be able to infer this from transcripts required: false direction: input type: double default: 0.5 - - name: --celltype_key - required: false - direction: input - type: string - default: cell_type - - name: --output - required: true - direction: output - __merge__: /src/api/file_spatial_with_celltypes.yaml resources: - type: python_script diff --git a/src/celltype_annotation_methods/ssam/script.py b/src/celltype_annotation_methods/ssam/script.py index 985a2aa6..5c7c6c52 100644 --- a/src/celltype_annotation_methods/ssam/script.py +++ b/src/celltype_annotation_methods/ssam/script.py @@ -18,6 +18,9 @@ } ## VIASH END +# Optional parameter check: For this specific annotation method the par['input_transcripts'] and par['input_sc'] are required +assert par['input_transcripts'] is not None, 'Transcripts input is required for this annotation method.' +assert par['input_sc'] is not None, 'Single cell input is required for this annotation method.' # Read input print('Reading input files', flush=True) diff --git a/src/count_aggregation/basic/config.vsh.yaml b/src/count_aggregation/basic/config.vsh.yaml index 59e843e5..cb5d4593 100644 --- a/src/count_aggregation/basic/config.vsh.yaml +++ b/src/count_aggregation/basic/config.vsh.yaml @@ -1,15 +1,7 @@ name: basic namespace: count_aggregation -arguments: - - name: --input - required: true - direction: input - __merge__: /src/api/file_spatialdata_assigned.yaml - - name: --output - required: true - direction: output - __merge__: /src/api/file_spatial_raw_counts.yaml +__merge__: /src/api/comp_count_aggregation.yaml resources: - type: python_script diff --git a/src/expr_correction_methods/gene_efficiency_correction/config.vsh.yaml b/src/expr_correction_methods/gene_efficiency_correction/config.vsh.yaml index c574be73..f99acb33 100644 --- a/src/expr_correction_methods/gene_efficiency_correction/config.vsh.yaml +++ b/src/expr_correction_methods/gene_efficiency_correction/config.vsh.yaml @@ -1,24 +1,14 @@ name: gene_efficiency_correction namespace: expr_correction_methods +__merge__: /src/api/comp_expr_correction_method.yaml + arguments: - - name: --input - required: true - direction: input - __merge__: /src/api/file_spatial_with_celltypes.yaml - - name: --input_sc - required: true - direction: input - __merge__: /src/api/file_singlecell.yaml - name: --celltype_key required: false direction: input type: string default: cell_type - - name: --output - required: true - direction: output - __merge__: /src/api/file_spatial_corrected.yaml resources: - type: python_script diff --git a/src/expr_correction_methods/gene_efficiency_correction/script.py b/src/expr_correction_methods/gene_efficiency_correction/script.py index 53b2e4b5..f4be3098 100644 --- a/src/expr_correction_methods/gene_efficiency_correction/script.py +++ b/src/expr_correction_methods/gene_efficiency_correction/script.py @@ -15,6 +15,8 @@ } ## VIASH END +# Optional parameter check: For this specific correction method the par['input_sc'] is required +assert par['input_sc'] is not None, 'Single cell input is required for this expr correction method.' # Read input print('Reading input files', flush=True) diff --git a/src/normalisation_methods/normalise_by_volume/config.vsh.yaml b/src/normalisation_methods/normalise_by_volume/config.vsh.yaml index 9f9e1906..7eb4ecbd 100644 --- a/src/normalisation_methods/normalise_by_volume/config.vsh.yaml +++ b/src/normalisation_methods/normalise_by_volume/config.vsh.yaml @@ -1,20 +1,7 @@ name: normalise_by_volume namespace: normalisation_methods -arguments: - - name: --input - required: true - direction: input - __merge__: /src/api/file_spatial_raw_counts.yaml - - name: --input_volume - type: file - description: H5ad with an obs column of cell volumes calculated from spatial transcriptomics data. - required: true - __merge__: /src/api/file_cell_volumes.yaml - - name: --output - required: true - direction: output - __merge__: /src/api/file_spatial_norm_counts.yaml +__merge__: /src/api/comp_normalisation_method.yaml resources: - type: python_script diff --git a/src/normalisation_methods/normalise_by_volume/script.py b/src/normalisation_methods/normalise_by_volume/script.py index 75670b0d..4c783f8d 100644 --- a/src/normalisation_methods/normalise_by_volume/script.py +++ b/src/normalisation_methods/normalise_by_volume/script.py @@ -14,6 +14,8 @@ } ## VIASH END +# Optional parameter check: For this specific normalisation method the par['input_volume'] is required +assert par['input_volume'] is not None, 'Volume input is required for this normalisation method.' # Read input print('Reading input files', flush=True) diff --git a/src/segmentation_methods/custom/config.vsh.yaml b/src/segmentation_methods/custom/config.vsh.yaml index 3f1e01de..34d20c68 100644 --- a/src/segmentation_methods/custom/config.vsh.yaml +++ b/src/segmentation_methods/custom/config.vsh.yaml @@ -1,19 +1,13 @@ name: custom namespace: segmentation_methods +__merge__: /src/api/comp_segmentation_method.yaml + arguments: - - name: --input - required: true - direction: input - __merge__: /src/api/file_spatialdata.yaml - name: --labels_key type: string description: The key of the segmentation within the labels of the spatial data required: true - - name: --output - required: true - direction: output - __merge__: /src/api/file_spatialdata_segmented.yaml resources: - type: python_script