add metadata/copy_modality_slots component#1166
Conversation
DriesSchaumont
left a comment
There was a problem hiding this comment.
This PR and #1163 look very similar. Are separete components required?
…/copy_modality_slots
… add-insert-partial-items-component # Conflicts: # CHANGELOG.md # src/authors/luke_zappia.yaml
lazappi
left a comment
There was a problem hiding this comment.
How would this be used to replicate the move_layer component which moves or copies a single layer/X in one MuData? I guess you could input the same file twice and set the arguments correctly? I don't think this has any way of handling X though which is the main use of move_layer.
The aim here wasn't to replace |
lazappi
left a comment
There was a problem hiding this comment.
This looks good to me but Dries should check to see it matches OP
Changelog
Adds a new
metadata/copy_modality_slotscomponent, consolidating PR #1166 (originallydataflow/insert_partial_items) and PR #1163 (dataflow/move_anndata_slots) into a single component covering both use cases.What it does
Copies items (
.obs,.var,.layers,.obsm,.varm,.obsp,.varp,.uns) from a modality in a source MuData file into a modality in a target MuData file. Cross-modality transfers are supported via--source_modality/--target_modality.Behavior
.obs/.varindex sets must match. Source is reindexed to target order if needed.--allow_partial: source's indices may be a strict subset of target's. Missing rows/cols are NaN-filled (with the appropriate sentinel for nullable DataFrame columns).--allow_overwrite: opt-in; by default the component errors if a key already exists in the target.__auto__token: per slot, automatically include items present in source but missing from target.--var_match_column: rewrite source.varindex from a named column before matching — useful when an upstream step has sanitised gene names.PR #1163 will be closed.
Checklist before requesting a review
I have performed a self-review of my code
Conforms to the Contributor's guide
Check the correct box. Does this PR contain:
Proposed changes are described in the CHANGELOG.md
CI tests succeed!