-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathtest_pipeline.sh
More file actions
executable file
·103 lines (87 loc) · 5.17 KB
/
test_pipeline.sh
File metadata and controls
executable file
·103 lines (87 loc) · 5.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#!/bin/bash
set -e
SP_DIR=resources_test/common/2023_10x_mouse_brain_xenium_rep1
SC_DIR=resources_test/common/2023_yao_mouse_brain_scrnaseq_10xv2
OUT_DIR="resources_test/task_ist_preprocessing/mouse_brain_combined"
rm -rf $OUT_DIR
mkdir -p $OUT_DIR
# run dataset preprocessor
viash run src/data_processors/process_dataset/config.vsh.yaml -- \
--dataset_id mouse_brain_combined \
--dataset_name "Test data mouse brain combined 2023 tenx Xenium replicate 1 2023 Yao scRNAseq" \
--dataset_url "https://www.10xgenomics.com/datasets/fresh-frozen-mouse-brain-replicates-1-standard;https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE246717" \
--dataset_reference "https://www.10xgenomics.com/datasets/fresh-frozen-mouse-brain-replicates-1-standard;10.1038/s41586-023-06812-z" \
--dataset_summary "Demonstration of gene expression profiling for fresh frozen mouse brain on the Xenium platform using the pre-designed Mouse Brain Gene Expression Panel (v1);A high-resolution scRNAseq atlas of cell types in the whole mouse brain" \
--dataset_description "Demonstration of gene expression profiling for fresh frozen mouse brain on the Xenium platform using the pre-designed Mouse Brain Gene Expression Panel (v1). Replicate results demonstrate the high reproducibility of data generated by the platform. 10x Genomics obtained tissue from a C57BL/6 mouse from Charles River Laboratories. Three adjacent 10µm sections were placed on the same slide. Tissues were prepared following the demonstrated protocols Xenium In Situ for Fresh Frozen Tissues - Tissue Preparation Guide (CG000579) and Xenium In Situ for Fresh Frozen Tissues - Fixation & Permeabilization (CG000581).;See dataset_reference for more information. Note that we only took the 10xv2 data from the dataset." \
--dataset_organism "mus_musculus" \
--input_sc $SC_DIR/dataset.h5ad \
--input_sp $SP_DIR/dataset.zarr \
--output_sc $OUT_DIR/scrnaseq_reference.h5ad \
--output_sp $OUT_DIR/raw_ist.zarr
# run a segmentation method
viash run src/methods_segmentation/custom_segmentation/config.vsh.yaml -- \
--input $OUT_DIR/raw_ist.zarr \
--labels_key cell_labels \
--output $OUT_DIR/segmentation.zarr
# run an assignment method
viash run src/methods_transcript_assignment/basic_transcript_assignment/config.vsh.yaml -- \
--input_ist $OUT_DIR/raw_ist.zarr \
--input_segmentation $OUT_DIR/segmentation.zarr \
--transcripts_key transcripts \
--coordinate_system global \
--output $OUT_DIR/transcript_assignments.zarr
# run a count aggregation method
viash run src/methods_count_aggregation/basic_count_aggregation/config.vsh.yaml -- \
--input $OUT_DIR/transcript_assignments.zarr \
--output $OUT_DIR/spatial_aggregated_counts.h5ad
# run a cell volume method
viash run src/methods_calculate_cell_volume/alpha_shapes/config.vsh.yaml -- \
--input $OUT_DIR/transcript_assignments.zarr \
--output $OUT_DIR/cell_volumes.h5ad
# run a normalization method
viash run src/methods_normalization/normalize_by_volume/config.vsh.yaml -- \
--input_spatial_aggregated_counts $OUT_DIR/spatial_aggregated_counts.h5ad \
--input_cell_volumes $OUT_DIR/cell_volumes.h5ad \
--output $OUT_DIR/spatial_normalized_counts.h5ad
# run a cell type annotation method
viash run src/methods_cell_type_annotation/ssam/config.vsh.yaml -- \
--input_spatial_normalized_counts $OUT_DIR/spatial_normalized_counts.h5ad \
--input_transcript_assignments $OUT_DIR/transcript_assignments.zarr \
--input_scrnaseq_reference $OUT_DIR/scrnaseq_reference.h5ad \
--output $OUT_DIR/spatial_with_cell_types.h5ad
# run a gene efficiency correction method
viash run src/methods_expression_correction/gene_efficiency_correction/config.vsh.yaml -- \
--input_spatial_with_cell_types $OUT_DIR/spatial_with_cell_types.h5ad \
--input_scrnaseq_reference $OUT_DIR/scrnaseq_reference.h5ad \
--output $OUT_DIR/spatial_corrected_counts.h5ad
# run a QC filter method
viash run src/methods_qc_filter/basic_qc_filter/config.vsh.yaml -- \
--input $OUT_DIR/spatial_corrected_counts.h5ad \
--output $OUT_DIR/spatial_qc_col.h5ad
# run a metric
viash run src/metrics/similarity/config.vsh.yaml -- \
--input $OUT_DIR/spatial_corrected_counts.h5ad \
--input_qc_col $OUT_DIR/spatial_qc_col.h5ad \
--input_sc $OUT_DIR/scrnaseq_reference.h5ad \
--input_transcript_assignments $OUT_DIR/transcript_assignments.zarr \
--output $OUT_DIR/score.h5ad
# create a state file
cat >> $OUT_DIR/state.yaml <<EOL
id: mouse_brain_combined
output_sp: !file raw_ist.zarr
output_sc: !file scrnaseq_reference.h5ad
output_segmentation: !file segmentation.zarr
output_transcript_assignments: !file transcript_assignments.zarr
output_spatial_aggregated_counts: !file spatial_aggregated_counts.h5ad
output_cell_volumes: !file cell_volumes.h5ad
output_spatial_normalized_counts: !file spatial_normalized_counts.h5ad
output_spatial_with_cell_types: !file spatial_with_cell_types.h5ad
output_spatial_corrected_counts: !file spatial_corrected_counts.h5ad
output_spatial_qc_col: !file spatial_qc_col.h5ad
output_score: !file score.h5ad
EOL
# sync test resources
aws s3 sync --profile op \
"resources_test/task_ist_preprocessing/mouse_brain_combined" \
"s3://openproblems-data/resources_test/task_ist_preprocessing/mouse_brain_combined" \
--delete --dryrun