-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
63 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import scanpy as sc | ||
import spatialdata as sd | ||
|
||
### VIASH START | ||
par = { | ||
"input_sc": "resources_test/common/2023_yao_mouse_brain_scrnaseq_10xv2/dataset.h5ad", | ||
"input_sp": "resources_test/common/2023_10x_mouse_brain_xenium/dataset.zarr", | ||
"output_sc": "resources_test/preprocessing_imagingbased_st/2023_yao_mouse_brain_scrnaseq_10xv2/dataset.h5ad", | ||
"output_sp": "resources_test/preprocessing_imagingbased_st/2023_10x_mouse_brain_xenium/dataset.zarr" | ||
} | ||
### VIASH END | ||
|
||
# Load the single-cell data | ||
adata_sc = sc.read(par["input_sc"]) | ||
|
||
# Load the spatial data | ||
adata_sp = sd.read_zarr(par["input_sp"]) | ||
|
||
# Process if need be | ||
|
||
# Save the single-cell data | ||
adata_sc.write_h5ad(par["output_sc"]) | ||
|
||
# Save the spatial data | ||
adata_sp.write(par["output_sp"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,33 @@ | ||
#!/bin/bash | ||
|
||
# Run this prior to executing this script: | ||
# bin/viash_build -q 'batch_integration' | ||
|
||
# get the root of the directory | ||
REPO_ROOT=$(git rev-parse --show-toplevel) | ||
|
||
# ensure that the command below is run from the root of the repository | ||
cd "$REPO_ROOT" | ||
|
||
set -e | ||
|
||
DATASETS_DIR="resources_test/common" | ||
OUTPUT_DIR="output/process_datasets_test" | ||
|
||
if [ ! -d "$OUTPUT_DIR" ]; then | ||
mkdir -p "$OUTPUT_DIR" | ||
fi | ||
|
||
export NXF_VER=24.04.3 | ||
cat > /tmp/params.yaml <<EOF | ||
param_list: | ||
- id: my_dataset_id0 | ||
input_sp: path/to/my_dataset0/dataset.h5ad | ||
input_sc: path/to/my_dataset0/dataset.csv | ||
- id: my_dataset_id1 | ||
input_sp: path/to/my_dataset1/dataset.h5ad | ||
input_sc: path/to/my_dataset1/dataset.csv | ||
reference: my_reference.csv | ||
EOF | ||
|
||
nextflow run . \ | ||
-main-script target/nextflow/workflows/process_datasets/main.nf \ | ||
-profile docker \ | ||
-entry auto \ | ||
-c common/nextflow_helpers/labels_ci.config \ | ||
--id run_test \ | ||
--input_states "$DATASETS_DIR/**/state.yaml" \ | ||
--rename_keys 'input:output_dataset' \ | ||
--settings '{"output_train": "train.h5ad", "output_test": "test.h5ad"}' \ | ||
--publish_dir "$OUTPUT_DIR" \ | ||
--output_state "state.yaml" | ||
-params-file /tmp/params.yaml \ | ||
--publish_dir output \ | ||
--output_sp '$id/output_sp.zarr' \ | ||
--output_sc '$id/output_sc.h5ad' | ||
|
||
# created files: | ||
# output/my_dataset_id0.process_datasets.output_sp.zarr | ||
# output/my_dataset_id0.process_datasets.output_sc.h5ad | ||
# output/my_dataset_id1.process_datasets.output_sp.zarr | ||
# output/my_dataset_id1.process_datasets.output_sc.h5ad | ||
|
||
# created files: | ||
# output/my_dataset_id0/output_sp.zarr | ||
# output/my_dataset_id0/output_sc.h5ad | ||
# output/my_dataset_id1/output_sp.zarr | ||
# output/my_dataset_id1/output_sc.h5ad |