Skip to content

Jw allen metadata update - #198

Open
jessicaway wants to merge 5 commits into
developfrom
jw_allen_metadata_update
Open

jessicaway wants to merge 5 commits into
developfrom
jw_allen_metadata_update

Conversation

@jessicaway

@jessicaway jessicaway commented Jun 3, 2026

Copy link
Copy Markdown
Member

Description

This PR adds an optional input parameter that allows customization of the metadata field name used for the sample identifier stored in the H5AD outputs.

The Allen Institute requested that the identifier currently used in the H5AD output filenames (i.e. input_id) also be represented within the H5AD metadata itself. After review, we confirmed that this value is already included in the outputs under the "input_id" field.

This change makes the field name configurable so that workflows can label the value more appropriately (for example, as barcoded_cell_sample_local_name) when desired. By default, the field name remains input_id, which matches the current behavior and maintains backward compatibility.


The corresponding Warp PR is here: broadinstitute/warp#1857

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR primarily adds a configurable metadata key name for storing the input_id value inside generated H5AD outputs (both obs and uns), keeping the default as "input_id" for backward compatibility. It also includes additional updates to the AoU mito coverage DB builder (median semantics, dtype inference/overflow checking) plus minor version/tag comment updates.

Changes:

  • Add --input_id_name CLI argument to H5AD creation scripts and use it for both obs columns and uns attributes.
  • Bump the warp-tools Docker build version/changelog entry for the release.
  • Update the AoU mito coverage DB builder behavior and its smoke test/docs (median definition, dtype choice, overflow guard).

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tools/warp-tools.changelog.md Adds a 2.7.1 changelog entry documenting the new --input_id_name option.
tools/scripts/create_snrna_optimus_full_h5ad.py Uses a configurable key name for storing input_id in obs/uns and adds a new CLI arg.
tools/scripts/create_h5ad_optimus.py Uses a configurable key name for storing input_id in obs/uns and adds a new CLI arg.
tools/docker_build.sh Updates the warp-tools image version used for tagging builds.
3rd-party-tools/aou_mito_coverage_db/scripts/coverage_db/smoke_test_build_coverage_db.py Updates expectations and adds coverage for the new median semantics.
3rd-party-tools/aou_mito_coverage_db/scripts/coverage_db/README.md Updates documentation on even-N median rounding semantics.
3rd-party-tools/aou_mito_coverage_db/scripts/coverage_db/build_coverage_db.py Changes median computation semantics, defaults dtype inference to uint32, adds an overflow guard.
3rd-party-tools/aou_mito_coverage_db/Dockerfile Updates the example build tag comment.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +354 to +355
# add input_id to col_attrs using the configurable key name
col_attrs[args.input_id_name] = np.repeat(args.input_id, expr_sp_t.shape[1])
Comment on lines +298 to +299
# add input_id to col_attrs using the configurable key name
col_attrs[args.input_id_name] = np.repeat(args.input_id, expr_sp_t.shape[1])
return out


def _infer_uint_dtype(max_value: int) -> np.dtype:
Comment on lines 35 to +37
- Median definition: we match the usual median of a multiset. For even N, we
use the average of the two middle values and then cast to int32 to match the
Hail schema (`median: int32`).
This is the most likely behavior of `hl.median` on integer arrays.
If parity testing reveals a different rounding rule, we can adjust the
even-N path.
use the average of the two middle values (floor division) and cast to int32
to match the Hail schema (`median: int32`) and `hl.median` behavior.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants