metadata/copy_modality_slots
Description
Copy items (.obs, .var, .layers, .obsm, .varm, .obsp, .varp, .uns) from a
modality in a source MuData file into a modality in the input MuData file.
By default the source and input modalities must have identical .obs and
.var index sets (ordering may differ; source is reindexed to match the
input). With --allow_partial, the source's .obs/.var indices may be a
strict subset of the input's; rows or columns of the input that are not
represented in the source are filled with NaN for numeric slots and with
the appropriate missing-value sentinel for DataFrame columns.
Existing keys in the input are not overwritten by default. Use
--allow_overwrite to allow overwriting (a warning is emitted for each
overwritten key).
Each slot argument restricts the copy to the named items. If a slot
argument is not specified, every item present in the source modality but
missing from the input modality is copied for that slot.
Inputs
Name | Type & Properties | Description |
|---|---|---|
--input -i | file required | The input data to copy slots into. Should be a .h5mu file. |
--modality | string | Which modality to copy slots into. |
Source
Name | Type & Properties | Description |
|---|---|---|
--source | file required | The source data to copy slots from. Should be a .h5mu file. |
--source_modality | string | Which modality in the source data to copy slots from. Defaults to the value of --modality. |
--source_var_gene_names | string | The name of the .var column in the source data containing gene names to match against the input .var index; when not provided, the source .var index is used. Useful when an upstream step has rewritten the source .var index (e.g. by sanitising gene names) and the original, input-compatible names are preserved in a column. |
Slots to copy
Name | Type & Properties | Description |
|---|---|---|
--obs | string multiple | .obs columns to copy. If not specified, all .obs columns present in the source but missing from the input are copied. |
--var | string multiple | .var columns to copy. If not specified, all .var columns present in the source but missing from the input are copied. |
--layers | string multiple | .layers keys to copy. If not specified, all .layers keys present in the source but missing from the input are copied. |
--obsm | string multiple | .obsm keys to copy. If not specified, all .obsm keys present in the source but missing from the input are copied. |
--varm | string multiple | .varm keys to copy. If not specified, all .varm keys present in the source but missing from the input are copied. |
--obsp | string multiple | .obsp keys to copy. If not specified, all .obsp keys present in the source but missing from the input are copied. |
--varp | string multiple | .varp keys to copy. If not specified, all .varp keys present in the source but missing from the input are copied. |
--uns | string multiple | .uns keys to copy. If not specified, all .uns keys present in the source but missing from the input are copied. |
Options
Name | Type & Properties | Description |
|---|---|---|
--allow_overwrite | boolean_true | Allow overwriting keys that already exist in the input modality. By default the component raises an error if a key already exists; when enabled, existing keys are overwritten with a warning. |
--allow_partial | boolean_true | Allow the source's .obs/.var indices to be a strict subset of the input's. Rows or columns of the input that are not represented in the source are filled with missing values (NaN for numeric data; appropriate sentinel for DataFrame columns). By default the two index sets must be equal. |
Outputs
Name | Type & Properties | Description |
|---|---|---|
--output -o | file required output | Output h5mu file (the input with slots copied from the source). |
--output_compression | string | Compression format to use for the output AnnData and/or Mudata H5 files. By default no compression is applied. |
Run this component
Run the following command to execute this component with Nextflow:
cat > params.yaml <<'EOM'
modality: [ "rna" ]
output: "$id.$key.output.h5mu"
id: "run"
publish_dir: "output/"
EOM
nextflow run https://packages.viash-hub.com/vsh/openpipeline.git \
-revision v5.0.0 \
-main-script target/nextflow/metadata/copy_modality_slots/main.nf \
-params-file params.yaml Relationships
Used by
Current component
Uses
No component dependencies found.