Jw allen metadata update - #198
Open
jessicaway wants to merge 5 commits into
Open
jessicaway wants to merge 5 commits into
jessicaway wants to merge 5 commits into
Conversation
Contributor
There was a problem hiding this comment.
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_nameCLI argument to H5AD creation scripts and use it for bothobscolumns andunsattributes. - 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. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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