Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 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 CHANGELOG.MD
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# openpipeline_qc 0.2.0

## NEW FEATURES

* Add support for CosMx data in the QC Reporting workflow (PR #12).

## MINOR CHANGES

* `src/workflows/generate_qc_report`: Add min and max constraints to `--max_samples_per_report`, to limit the number of samples per report between 1 and 20 (PR #11).
Expand Down
8 changes: 8 additions & 0 deletions resources_test_scripts/qc_sample_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,14 @@ viash run src/ingestion_qc/h5mu_to_qc_json/config.vsh.yaml --engine docker -- \
--output "$OUT_DIR_SPATIAL"/xenium_dataset.json \
--output_reporting_json "$OUT_DIR_SPATIAL"/xenium_report_structure.json

viash run src/ingestion_qc/h5mu_to_qc_json/config.vsh.yaml --engine docker -- \
--input "$OUT_DIR_SPATIAL"/Lung5_Rep2_tiny.qc.h5mu \
--input "$OUT_DIR_SPATIAL"/Lung5_Rep2_tiny.qc.h5mu \
--ingestion_method cosmx \
--min_num_nonzero_vars 1 \
--output "$OUT_DIR_SPATIAL"/cosmx_dataset.json \
--output_reporting_json "$OUT_DIR_SPATIAL"/cosmx_report_structure.json

# remove all state yaml files
rm "$OUT_DIR"/*.yaml
rm "$OUT_DIR_SPATIAL"/*.yaml
Expand Down
5 changes: 2 additions & 3 deletions src/ingestion_qc/generate_html/config.vsh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,8 @@ engines:
- git
- type: docker
run: |
npm install -g pnpm@latest-10 \
&& cd /opt && git clone -b v0.2.0 https://github.com/openpipelines-bio/siqc.git \
&& cd siqc && pnpm install \
cd /opt && git clone -b v0.2.0 https://github.com/openpipelines-bio/siqc.git \
&& cd siqc && npm install \
&& true

runners:
Expand Down
12 changes: 1 addition & 11 deletions src/ingestion_qc/generate_html/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,4 @@ ABSOLUTE_OUTPUT=$(realpath $par_output_qc_report)
cd /opt/siqc
mkdir src/data

echo "Compressing input data..."
pnpm run compress_data "$ABSOLUTE_INPUT_DATA" "src/data/dataset.ts"

echo "Compressing report structure..."
pnpm run compress_data "$ABSOLUTE_INPUT_STRUCTURE" "src/data/report_structure.ts"

echo "Generating HTML..."
pnpm run build

echo "Copying HTML to output directory..."
cp dist/index.html "$ABSOLUTE_OUTPUT"
npm run cli render -- --data "$ABSOLUTE_INPUT_DATA" --structure "$ABSOLUTE_INPUT_STRUCTURE" --output "$ABSOLUTE_OUTPUT"
37 changes: 36 additions & 1 deletion src/ingestion_qc/h5mu_to_qc_json/config.vsh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ argument_groups:
choices:
- cellranger_multi
- xenium
- cosmx
description: Method that was used to ingest the data - this will define the structure of the report that is generated.
- name: --obs_sample_id
type: string
Expand Down Expand Up @@ -132,7 +133,41 @@ argument_groups:
description: The key in the h5mu .obs field that contains the number of control codewords.
default: control_codeword_counts

# - name: Options for CosMx reports
- name: Options for CosMx reports
arguments:
- name: --obs_area
type: string
description: The key in the h5mu .obs field that contains the cell area.
default: Area
- name: --obs_aspect_ratio
type: string
description: The key in the h5mu .obs field that contains the aspect ratio.
default: AspectRatio
- name: --obs_dapi_stain
type: string
multiple: true
description: The keys in the h5mu .obs field that contains the DAPI stain intensity.
default: [Mean.DAPI, Max.DAPI]
- name: --obs_membrane_stain
type: string
multiple: true
description: The keys in the h5mu .obs field that contains the membrane stain intensity.
default: [Mean.MembraneStain, Max.MembraneStain]
- name: --obs_panck_stain
type: string
multiple: true
description: The keys in the h5mu .obs field that contains the PanCK stain intensity.
default: [Mean.PanCK, Max.PanCK]
- name: --obs_cd45_stain
type: string
multiple: true
description: The keys in the h5mu .obs field that contains the CD45 stain intensity.
default: [Mean.CD45, Max.CD45]
- name: --obs_cd3_stain
type: string
multiple: true
description: The keys in the h5mu .obs field that contains the CD3 stain intensity.
default: [Mean.CD3, Max.CD3]

resources:
- type: python_script
Expand Down
211 changes: 211 additions & 0 deletions src/ingestion_qc/h5mu_to_qc_json/report_structure/cosmx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,211 @@
{
"categories": [
{
"name": "Sample QC",
"key": "sample_summary_stats",
"additionalAxes": false,
"defaultFilters": []
},
{
"name": "Cell RNA QC",
"key": "cell_rna_stats",
"additionalAxes": true,
"defaultFilters": [
{
"type": "histogram",
"visualizationType": "histogram",
"field": "total_counts",
"label": "Total UMI per cell",
"description": "Total number of RNA molecules detected per cell. Low values typically indicate empty droplets or low-quality cells that should be filtered out.",
"cutoffMin": null,
"cutoffMax": null,
"zoomMax": null,
"nBins": 50,
"groupBy": "sample_id",
"yAxisType": "linear"
},
{
"type": "histogram",
"visualizationType": "histogram",
"field": "num_nonzero_vars",
"label": "Number of non-zero genes per cell",
"description": "Count of unique genes detected in each cell. Low gene counts often indicate poor-quality cells.",
"cutoffMin": null,
"cutoffMax": null,
"zoomMax": null,
"nBins": 50,
"groupBy": "sample_id",
"yAxisType": "linear"
},
{
"type": "histogram",
"visualizationType": "histogram",
"field": "fraction_mitochondrial",
"label": "Fraction UMI of mitochondrial genes per cell",
"description": "Proportion of cell's RNA from mitochondrial genes.",
"cutoffMin": null,
"cutoffMax": null,
"nBins": 50,
"groupBy": "sample_id",
"yAxisType": "linear"
},
{
"type": "histogram",
"visualizationType": "histogram",
"field": "fraction_ribosomal",
"label": "Fraction UMI of ribosomal genes per cell",
"description": "Proportion of cell's RNA from ribosomal protein genes. Extreme values may indicate stress responses or cell cycle abnormalities.",
"cutoffMin": null,
"cutoffMax": null,
"nBins": 50,
"groupBy": "sample_id",
"yAxisType": "linear"
},
{
"type": "histogram",
"visualizationType": "histogram",
"field": "Area",
"label": "Cell Area",
"description": "Area of the segmented cells.",
"cutoffMin": null,
"cutoffMax": null,
"nBins": 50,
"groupBy": "sample_id",
"yAxisType": "linear"
},
{
"type": "histogram",
"visualizationType": "histogram",
"field": "AspectRatio",
"label": "Aspect Ratio",
"description": "Aspect ratio of the segmented cells.",
"cutoffMin": null,
"cutoffMax": null,
"nBins": 50,
"groupBy": "sample_id",
"yAxisType": "linear"
},
{
"type": "histogram",
"visualizationType": "histogram",
"field": "Mean.DAPI",
"label": "Mean DAPI Intensity",
"description": "Mean intensity of DAPI stain.",
"cutoffMin": null,
"cutoffMax": null,
"nBins": 50,
"groupBy": "sample_id",
"yAxisType": "linear"
},
{
"type": "histogram",
"visualizationType": "histogram",
"field": "Mean.MembraneStain",
"label": "Mean Membrane Stain Intensity",
"description": "Mean intensity of Membrane stain.",
"cutoffMin": null,
"cutoffMax": null,
"nBins": 50,
"groupBy": "sample_id",
"yAxisType": "linear"
},
{
"type": "histogram",
"visualizationType": "histogram",
"field": "Mean.PanCK",
"label": "Mean PanCK Intensity",
"description": "Mean intensity of PanCK stain.",
"cutoffMin": null,
"cutoffMax": null,
"nBins": 50,
"groupBy": "sample_id",
"yAxisType": "linear"
},
{
"type": "histogram",
"visualizationType": "histogram",
"field": "Mean.CD45",
"label": "Mean CD45 Intensity",
"description": "Mean intensity of CD45 stain.",
"cutoffMin": null,
"cutoffMax": null,
"nBins": 50,
"groupBy": "sample_id",
"yAxisType": "linear"
},
{
"type": "histogram",
"visualizationType": "histogram",
"field": "Mean.CD3",
"label": "Mean CD3 Intensity",
"description": "Mean intensity of CD3 stain.",
"cutoffMin": null,
"cutoffMax": null,
"nBins": 50,
"groupBy": "sample_id",
"yAxisType": "linear"
},
{
"type": "histogram",
"visualizationType": "histogram",
"field": "Max.DAPI",
"label": "Max DAPI Intensity",
"description": "Maximum intensity of DAPI stain.",
"cutoffMin": null,
"cutoffMax": null,
"nBins": 50,
"groupBy": "sample_id",
"yAxisType": "linear"
},
{
"type": "histogram",
"visualizationType": "histogram",
"field": "Max.MembraneStain",
"label": "Max Membrane Stain Intensity",
"description": "Maximum intensity of Membrane stain.",
"cutoffMin": null,
"cutoffMax": null,
"nBins": 50,
"groupBy": "sample_id",
"yAxisType": "linear"
},
{
"type": "histogram",
"visualizationType": "histogram",
"field": "Max.PanCK",
"label": "Max PanCK Intensity",
"description": "Maximum intensity of PanCK stain.",
"cutoffMin": null,
"cutoffMax": null,
"nBins": 50,
"groupBy": "sample_id",
"yAxisType": "linear"
},
{
"type": "histogram",
"visualizationType": "histogram",
"field": "Max.CD45",
"label": "Max CD45 Intensity",
"description": "Maximum intensity of CD45 stain.",
"cutoffMin": null,
"cutoffMax": null,
"nBins": 50,
"groupBy": "sample_id",
"yAxisType": "linear"
},
{
"type": "histogram",
"visualizationType": "histogram",
"field": "Max.CD3",
"label": "Max CD3 Intensity",
"description": "Maximum intensity of CD3 stain.",
"cutoffMin": null,
"cutoffMax": null,
"nBins": 50,
"groupBy": "sample_id",
"yAxisType": "linear"
}
]
}
]
}
Loading