Functions
Index
Base.getindexBase.getindexBase.setindex!Base.sizeBase.viewBase.writeBase.writeMuon.get_optionMuon.isbackedMuon.obs_names_make_unique!Muon.obs_names_make_unique!Muon.pull_obs!Muon.pull_var!Muon.push_obs!Muon.push_var!Muon.readh5adMuon.readh5muMuon.readzarradMuon.readzarrmuMuon.set_optionsMuon.update!Muon.update_obs!Muon.update_var!Muon.var_names_make_unique!Muon.var_names_make_unique!Muon.writeh5adMuon.writeh5muMuon.writezarradMuon.writezarrmu
All functions
Base.getindex — Functiongetindex(
data::Union{AbstractAnnData, AbstractMuData},
I::Union{OrdinalRange, Colon, AbstractVector{<:Integer}, AbstractVector{<:AbstractString}, Number, AbstractString},
J::Union{OrdinalRange, Colon, AbstractVector{<:Integer}, AbstractVector{<:AbstractString}, Number, AbstractString},
)Subset data to observations I and variables J.
Indexing can be performed by numerical index or by name, where names are looked up in data.obs_names and data.var_names.
Base.getindex — Methodgetindex(mdata::AbstractMuData, modality::Union{AbstractString, Symbol})::AnnDataGet a modality from mdata.
Base.setindex! — Methodsetindex!(mdata::AbstractMuData, ad::AnnData, key::Union{AbstractString, Symbol})Insert or overwrite a modality in mdata.
Base.size — Functionsize(data::Union{AbstractAnnData, AbstractMuData}, [dim::Integer])Return a tuple containing the number of observations and variables of adata. Optionally you can specify a dimension to get just the length of that dimension.
Base.view — Functionview(data::Union{AbstractAnnData, AbstractMuData},
I::Union{OrdinalRange, Colon, AbstractVector{<:Integer}, AbstractVector{<:AbstractString}, Number, AbstractString},
J::Union{OrdinalRange, Colon, AbstractVector{<:Integer}, AbstractVector{<:AbstractString}, Number, AbstractString},
)Like getindex, but returns a lightweight object that lazily references the parent object.
Base.write — Functionwrite(data::Union{AbstractAnnData, AbstractMuData}; compress::UInt8=0x9)
write(parent::Union{HDF5.File, HDF5.Group, ZGroup}, data::Union{AbstractAnnData, AbstractMuData}; compress::UInt8=0x9)Write the data to disk.
The first form writes the metadata of a backed AnnData or MuData object to disk. The second form writes the data to an already open HDF5 or Zarr file into the group parent.
Base.write — Methodwrite(parent::Union{HDF5.File, HDF5.Group, ZGroup}, name::AbstractString, adata::AbstractAnnData; compress::UInt8=0x9)Write the adata to an already open HDF5 or Zarr file into the group parent as a subgroup with name name.
Muon.get_option — Methodget_option(name::String)Get package-specific options. See set_options for the list of available options.
Muon.isbacked — Methodisbacked(ad::Union{AbstractMuData, AbstractAnnData})::BoolReturn true if ad is backed on disk, and false otherwise.
See also readh5ad, readzarrad, readh5mu, readzarrmu.
Muon.obs_names_make_unique! — Functionobs_names_make_unique!(mdata::MuData, join='-')Call obs_names_make_unique! for each modality.
If there are obs_names which are the same for multiple modalities, the modality name is prepended to al obs_names.
See also var_names_make_unique!(::MuData), obs_names_make_unique!(::AnnData), var_names_make_unique!(::AnnData)
Muon.obs_names_make_unique! — Functionobs_names_make_unique!(ad::AnnData, join='-')Make ad.obs_names unique by appending join and sequential numbers (1, 2, 3 etc) to duplicate elements, leaving the first unchanged.
See also var_names_make_unique!(::AnnData).
Muon.pull_obs! — Methodpull_obs!(
mdata::MuData;
columns::Union{AbstractVector{<:AbstractString}, NTuple{N, <:AbstractString}, AbstractString, Nothing}=nothing,
mods::Union{AbstractVector{<:AbstractString}, NTuple{M, <:AbstractString}, AbstractString, Nothing}=nothing,
common::Union{Bool, Nothing}=nothing,
join_common::Union{Bool, Nothing}=nothing,
nonunique::Union{Bool, Nothing}=nothing,
join_nonunique::Bool=false,
unique::Union{Bool, Nothing}=nothing,
prefix_unique::Bool=true,
drop::Bool=false,
only_drop::Bool=false,
) where {N, M}Copy metadata from the .obs of the individual modalities to the global .obs of the MuData object, overwriting or updating existing columns.
Arguments
mdata: TheMuDataobject.columns: Columns to pull from the modalities. Pulls everything by default.mods: Modalities to pull from. Pull from all modalities by default.common: Whether to pull common columns. Common columns exist in all modalities. Cannot be used together withcolumns. Defaults totrue.join_common: Whether to join common columns. Joined columns do not have a modality prefix. Defaults totrueifmdata.axis == 0x1(shared.obs),falseotherwise.nonunique: Whether to pull nonunique columns. Non-unique columns exist in at least two, but not all modalities. Cannot be used together withcolumns. Defaults totrue.join_nonunique: Whether to join non-unique columns. Joined columns do not have a modality prefix.unique: Whether to pull unique columns. Unique columns exist in exactly one modality. Cannot be used together withcolumns. Defaults totrue.prefix_unique: Whether to prefix unique columns with the modality name.drop: Whether to delete columns from the modalities after pulling.only_drop: Whether to only delete the columns from the modalities, but not actually pull them. Impliesdrop=true.
Muon.pull_var! — Methodpull_var!(
mdata::MuData;
columns::Union{AbstractVector{<:AbstractString}, NTuple{N, <:AbstractString}, AbstractString, Nothing}=nothing,
mods::Union{AbstractVector{<:AbstractString}, NTuple{M, <:AbstractString}, AbstractString, Nothing}=nothing,
common::Union{Bool, Nothing}=nothing,
join_common::Union{Bool, Nothing}=nothing,
nonunique::Union{Bool, Nothing}=nothing,
join_nonunique::Bool=false,
unique::Union{Bool, Nothing}=nothing,
prefix_unique::Bool=true,
drop::Bool=false,
only_drop::Bool=false,
) where {N, M}Copy metadata from the .var of the individual modalities to the global .var of the MuData object, overwriting or updating existing columns.
Arguments
mdata: TheMuDataobject.columns: Columns to pull from the modalities. Pulls everything by default.mods: Modalities to pull from. Pull from all modalities by default.common: Whether to pull common columns. Common columns exist in all modalities. Cannot be used together withcolumns. Defaults totrue.join_common: Whether to join common columns. Joined columns do not have a modality prefix. Defaults totrueifmdata.axis == 0x1(shared.obs),falseotherwise.nonunique: Whether to pull nonunique columns. Non-unique columns exist in at least two, but not all modalities. Cannot be used together withcolumns. Defaults totrue.join_nonunique: Whether to join non-unique columns. Joined columns do not have a modality prefix.unique: Whether to pull unique columns. Unique columns exist in exactly one modality. Cannot be used together withcolumns. Defaults totrue.prefix_unique: Whether to prefix unique columns with the modality name.drop: Whether to delete columns from the modalities after pulling.only_drop: Whether to only delete the columns from the modalities, but not actually pull them. Impliesdrop=true.
Muon.push_obs! — Methodpush_obs!(
mdata::MuData;
columns::Union{AbstractVector{<:AbstractString}, NTuple{N, <:AbstractString}, AbstractString, Nothing}=nothing,
mods::Union{AbstractVector{<:AbstractString}, NTuple{M, <:AbstractString}, AbstractString, Nothing}=nothing,
common::Union{Bool, Nothing}=nothing,
prefixed::Union{Bool, Nothing}=nothing,
drop::Bool=false,
only_drop::Bool=false,
) where {N, M}Copy metadata from mdata.obs to the .obs of the individual modalities, overwriting existing columns.
Arguments
mdata: TheMuDataobject.columns: Columns to push. Pushes everything by default.mods: Modalities to push to. Pushes to all modalities by default.common: Whether to push common columns. Common columns do not have modality prefixes. Cannot be used together withcolumns. Defaults totrue.prefixed: Whether to push columns with a modality prefix. Only push to the respective modalities. Cannot be used together withcolumns. Defaults totrue.drop: Whether to delete columns frommdata.obsafter pushing.only_drop: Whether to only delete the columns frommdata.obs, but not actually push them. Impliesdrop=true.
Muon.push_var! — Methodpush_var!(
mdata::MuData;
columns::Union{AbstractVector{<:AbstractString}, NTuple{N, <:AbstractString}, AbstractString, Nothing}=nothing,
mods::Union{AbstractVector{<:AbstractString}, NTuple{M, <:AbstractString}, AbstractString, Nothing}=nothing,
common::Union{Bool, Nothing}=nothing,
prefixed::Union{Bool, Nothing}=nothing,
drop::Bool=false,
only_drop::Bool=false,
) where {N, M}Copy metadata from mdata.var to the .var of the individual modalities, overwriting existing columns.
Arguments
mdata: TheMuDataobject.columns: Columns to push. Pushes everything by default.mods: Modalities to push to. Pushes to all modalities by default.common: Whether to push common columns. Common columns do not have modality prefixes. Cannot be used together withcolumns. Defaults totrue.prefixed: Whether to push columns with a modality prefix. Only push to the respective modalities. Cannot be used together withcolumns. Defaults totrue.drop: Whether to delete columns frommdata.obsafter pushing.only_drop: Whether to only delete the columns frommdata.obs, but not actually push them. Impliesdrop=true.
Muon.readh5ad — Methodreadh5ad(filename::AbstractString; backed=false)::AnnDataRead an AnnData object stored in an h5ad file.
In backed mode, matrices X and layers are not read into memory, but are instead represented by proxy objects reading the required matrix elements from disk upon access.
See also readzarrad, writeh5ad, writezarrad, isbacked.
Muon.readh5mu — Methodreadh5mu(filename::AbstractString; backed=false)::MuDataRead a MuData object stored in an h5mu file.
In backed mode, matrices X and layers for each modality are not read into memory, but are instead represented by proxy objects reading the required matrix elements from disk upon access.
See also readzarrmu, writeh5mu, writezarrmu, isbacked.
Muon.readzarrad — Methodreadzarrad(filename::AbstractString; backed=false)::AnnDataRead an AnnData object stored in a Zarr file.
In backed mode, matrices X and layers are not read into memory, but are instead represented by proxy objects reading the required matrix elements from disk upon access.
See also readh5ad, writeh5ad, writezarrad, isbacked.
Muon.readzarrmu — Methodreadzarr(filename::AbstractString; backed=false)::MuDataRead a MuData object stored in a Zarr file.
In backed mode, matrices X and layers for each modality are not read into memory, but are instead represented by proxy objects reading the required matrix elements from disk upon access.
See also readh5mu, writeh5mu, writezarrmu, isbacked.
Muon.set_options — Methodset_options(; kwargs...)Set package-specific options.
These will be written to LocalPreferences.toml in your active project. Supported options are:
pull_on_update::Bool(defaults tofalse): Controls whether to automatically runpull_obs!/pull_var!afterupdate_obs!/update_var!.
See also get_option.
Muon.update! — Methodupdate!(mdata::MuData)Update the MuData object with information from all modalities.
This function should be called after adding or removing modalities. It will update the MuData's obs_names and var_names as well as the obsmap and `varmap.
See also update_obs!, update_var!.
Muon.update_obs! — Methodupdate_obs!(mdata::MuData)Update the MuData's obs_names and obsmap with information from all modalities.
See also update_var!, update!.
Muon.update_var! — Methodupdate_var!(mdata::MuData)Update the MuData's var_names and varmap with information from all modalities.
See also update_obs!, update!.
Muon.var_names_make_unique! — Functionvar_names_make_unique!(mdata::MuData, join='-')Call var_names_make_unique! for each modality.
If there are var_names which are the same for multiple modalities, the modality name is prepended to al var_names.
See also obs_names_make_unique!(::MuData), obs_names_make_unique!(::AnnData), var_names_make_unique!(::AnnData)
Muon.var_names_make_unique! — Functionvar_names_make_unique!(ad::AnnData, join='-')Make ad.var_names unique by appending join and sequential numbers (1, 2, 3 etc) to duplicate elements, leaving the first unchanged.
See also obs_names_make_unique!(::AnnData).
Muon.writeh5ad — Methodwriteh5ad(filename::AbstractString, adata::AbstractAnnData; compress::UInt8=0x9)Write an AnnData object to disk using the h5ad format (HDF5 with a particular structure).
compress indicates the level of compression to apply, from 0 (no compression) to 9 (highest compression).
See also writezarrad, readh5ad, readzarrad.
Muon.writeh5mu — Methodwriteh5mu(filename::AbstractString, mudata::AbstractMuData; compress::UInt8=0x9)Write a MuData object to disk using the h5mu format (HDF5 with a particular structure).
compress indicates the level of compression to apply, from 0 (no compression) to 9 (highest compression).
See also writezarrmu, readh5mu, readzarrmu.
Muon.writezarrad — Methodwritezarrad(filename::AbstractString, adata::AbstractAnnData; compress::UInt8=0x9)Write an AnnData object to disk using the Zarr format.
compress indicates the level of compression to apply, from 0 (no compression) to 9 (highest compression).
See also writeh5ad, readh5ad, readzarrad.
Muon.writezarrmu — Methodwritezarrmu(filename::AbstractString, mudata::AbstractMuData; compress::UInt8=0x9)Write a MuData object to disk using the Zarr format.
compress indicates the level of compression to apply, from 0 (no compression) to 9 (highest compression).
See also writeh5mu, readh5mu, readzarrmu.