Skip to content

Commit bbbfa24

Browse files
spio.cosmx appends path two times to the file name
Fixes #298
1 parent b227052 commit bbbfa24

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/spatialdata_io/readers/cosmx.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ def cosmx(
6767
-------
6868
:class:`spatialdata.SpatialData`
6969
"""
70+
print("This is the local version")
7071
path = Path(path)
7172

7273
# tries to infer dataset_id from the name of the counts file
@@ -102,10 +103,12 @@ def cosmx(
102103
if not labels_dir.exists():
103104
raise FileNotFoundError(f"Labels directory not found: {labels_dir}.")
104105

105-
counts = pd.read_csv(path / counts_file, header=0, index_col=CosmxKeys.INSTANCE_KEY)
106+
counts = pd.read_csv(counts_file, header=0, index_col=CosmxKeys.INSTANCE_KEY)
107+
print(counts.head())
106108
counts.index = counts.index.astype(str).str.cat(counts.pop(CosmxKeys.FOV).astype(str).values, sep="_")
107109

108-
obs = pd.read_csv(path / meta_file, header=0, index_col=CosmxKeys.INSTANCE_KEY)
110+
obs = pd.read_csv(meta_file, header=0, index_col=CosmxKeys.INSTANCE_KEY)
111+
print(obs.head())
109112
obs[CosmxKeys.FOV] = pd.Categorical(obs[CosmxKeys.FOV].astype(str))
110113
obs[CosmxKeys.REGION_KEY] = pd.Categorical(obs[CosmxKeys.FOV].astype(str).apply(lambda s: s + "_labels"))
111114
obs[CosmxKeys.INSTANCE_KEY] = obs.index.astype(np.int64)

0 commit comments

Comments
 (0)