Skip to content
Snippets Groups Projects
Commit ab36c255 authored by Andrey Aristov's avatar Andrey Aristov
Browse files

fix saving tvec

parent 409828c0
No related branches found
No related tags found
No related merge requests found
......@@ -65,17 +65,7 @@ def align_multichip(
counts = [o['counts'] for o in out]
tvecs = [o['tvec'] for o in out]
def prep_tvec(transform_dict):
transform_dict["tvec"] = List(transform_dict["tvec"])
return transform_dict
try:
transform_data = [map(prep_tvec, tvecs)]
with open(out_path.replace('.zarr', '.transform.json'), 'w') as f:
json.dump(transform_data, fp=f)
except Exception as e:
print('saving transform json failed: ', e.args)
save_tvecs(tvecs, out_path.replace('.zarr', '.transform.json'))
df = pd.concat(counts, ignore_index=True).sort_values(['[AB]','label'])
df.to_csv(table_path)
......@@ -91,7 +81,19 @@ def align_multichip(
)
return out_path
def prep_tvec(transform_dict):
t = transform_dict.copy()
t["tvec"] = list(t["tvec"])
return t
def save_tvecs(tvecs, path):
try:
transform_data = list(map(prep_tvec, tvecs))
with open(path, 'w') as f:
json.dump(transform_data, fp=f)
except Exception as e:
print('saving transform json failed: ', e.args)
def align_parallel(args, **kwargs):
return align2D(*args, **kwargs)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment