troutpy.tl.create_urna_metadata#
- troutpy.tl.create_urna_metadata(sdata, layer='transcripts', gene_key='gene', copy=False)#
Creates a new table within the SpatialData object that contains a ‘gene’ column with the unique gene names extracted from the specified points layer.
- Parameters:
sdata (spatialdata.SpatialData) – The SpatialData object to modify.
layer (str) – The name of the layer in
sdata.pointsfrom which to extract gene names. Default is ‘transcripts’.gene_key (str) – The key in the
layerdataframe that contains the gene names.Default is ‘gene’.copy (
bool(default:False)) – IfTrue, returns a copy of thespatialdata.SpatialDataobject with the new table added.
- Return type:
- Returns:
SpatialData | None If
copyisTrue, returns a copy of the modifiedspatialdata.SpatialDataobject. Otherwise, returnsNone.