@@ -105,10 +105,10 @@ def cosmx(
105105 if not labels_dir .exists ():
106106 raise FileNotFoundError (f"Labels directory not found: { labels_dir } ." )
107107
108- counts = pd .read_csv (path / counts_file , header = 0 , index_col = CosmxKeys .INSTANCE_KEY )
108+ counts = pd .read_csv (counts_file , header = 0 , index_col = CosmxKeys .INSTANCE_KEY )
109109 counts .index = counts .index .astype (str ).str .cat (counts .pop (CosmxKeys .FOV ).astype (str ).values , sep = "_" )
110110
111- obs = pd .read_csv (path / meta_file , header = 0 , index_col = CosmxKeys .INSTANCE_KEY )
111+ obs = pd .read_csv (meta_file , header = 0 , index_col = CosmxKeys .INSTANCE_KEY )
112112 obs [CosmxKeys .FOV ] = pd .Categorical (obs [CosmxKeys .FOV ].astype (str ))
113113 obs [CosmxKeys .REGION_KEY ] = pd .Categorical (obs [CosmxKeys .FOV ].astype (str ).apply (lambda s : s + "_labels" ))
114114 obs [CosmxKeys .INSTANCE_KEY ] = obs .index .astype (np .int64 )
@@ -254,9 +254,9 @@ def cosmx(
254254 import pyarrow .parquet as pq
255255
256256 with tempfile .TemporaryDirectory () as tmpdir :
257- print ("converting .csv to .parquet to improve the speed of the slicing operations... " , end = "" )
257+ print ("converting .csv to .parquet to improve the speed of the slicing operations... " , end = "" , flush = True )
258258 assert transcripts_file is not None
259- transcripts_data = pd .read_csv (path / transcripts_file , header = 0 )
259+ transcripts_data = pd .read_csv (transcripts_file , header = 0 )
260260 transcripts_data .to_parquet (Path (tmpdir ) / "transcripts.parquet" )
261261 print ("done" )
262262
0 commit comments