File tree Expand file tree Collapse file tree
src/spatialdata_io/readers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -271,17 +271,18 @@ def cosmx(
271271 sub_table [CosmxKeys .INSTANCE_KEY ] = sub_table [CosmxKeys .INSTANCE_KEY ].astype ("category" )
272272 # we rename z because we want to treat the data as 2d
273273 sub_table .rename (columns = {"z" : "z_raw" }, inplace = True )
274- points [f"{ fov } _points" ] = PointsModel .parse (
275- sub_table ,
276- coordinates = {"x" : CosmxKeys .X_LOCAL_TRANSCRIPT , "y" : CosmxKeys .Y_LOCAL_TRANSCRIPT },
277- feature_key = CosmxKeys .TARGET_OF_TRANSCRIPT ,
278- instance_key = CosmxKeys .INSTANCE_KEY ,
279- transformations = {
280- fov : Identity (),
281- "global" : aff ,
282- "global_only_labels" : aff ,
283- },
284- )
274+ if len (sub_table ) > 0 :
275+ points [f"{ fov } _points" ] = PointsModel .parse (
276+ sub_table ,
277+ coordinates = {"x" : CosmxKeys .X_LOCAL_TRANSCRIPT , "y" : CosmxKeys .Y_LOCAL_TRANSCRIPT },
278+ feature_key = CosmxKeys .TARGET_OF_TRANSCRIPT ,
279+ instance_key = CosmxKeys .INSTANCE_KEY ,
280+ transformations = {
281+ fov : Identity (),
282+ "global" : aff ,
283+ "global_only_labels" : aff ,
284+ },
285+ )
285286
286287 # TODO: what to do with fov file?
287288 # if fov_file is not None:
You can’t perform that action at this time.
0 commit comments