Skip to content
Snippets Groups Projects
Commit b60a3891 authored by Constantin Pape's avatar Constantin Pape
Browse files

Fix issues with segmentation attributes derived from virtual cells

parent b0dbb207
No related branches found
No related tags found
No related merge requests found
......@@ -60,7 +60,6 @@ def correct_intensities_test(target='local', max_jobs=32):
target=target, max_jobs=max_jobs)
# FIXME scale 0 is damaged in the h5 file !
def correct_intensities(target='slurm', max_jobs=250):
raw_path = '../data/rawdata/sbem-6dpf-1-whole-raw.h5'
tmp_folder = './tmp_intensity_correction'
......@@ -185,6 +184,6 @@ def make_extrapolation_mask():
if __name__ == '__main__':
# correct_intensities('slurm', 125)
make_subsampled_volume()
correct_intensities('local', 1)
# make_subsampled_volume()
# make_extrapolation_mask()
......@@ -50,9 +50,9 @@ def make_cell_tables(old_folder, folder, name, tmp_folder, resolution,
tmp_folder, target)
# make table with gene mapping via VCs
vc_vol_path = os.path.join('segmentations', 'prospr-6dpf-1-whole-virtual-cells-labels.xml')
vc_vol_path = get_h5_path_from_xml(vc_vol_path, return_absolute_path=True)
vc_expression_path = os.path.join('tables', 'prospr-6dpf-1-whole-virtual-cells-labels', 'profile_clust_curated.csv')
vc_vol_path = get_seg_path(folder, 'prospr-6dpf-1-whole-virtual-cells-labels', 't00000/s00/0/cells')
vc_expression_path = os.path.join(folder, 'tables',
'prospr-6dpf-1-whole-virtual-cells-labels', 'profile_clust_curated.csv')
med_expression_path = gene_out
vc_out = os.path.join(table_folder, 'vc_assignments.csv')
vc_assignment_table(seg_path, vc_vol_path, vc_expression_path,
......
......@@ -3,8 +3,10 @@ import json
from cluster_tools.cluster_tasks import BaseClusterTask
DEFAULT_GROUP = os.environ.get('PLATYBROWSER_GROUP', 'kreshuk')
# DEFAULT_SHEBANG = os.environ.get('PLATYBROWSER_SHEBANG',
# '#! /g/arendt/EM_6dpf_segmentation/platy-browser-data/software/conda/miniconda3/envs/platybrowser/bin/python')
DEFAULT_SHEBANG = os.environ.get('PLATYBROWSER_SHEBANG',
'#! /g/arendt/EM_6dpf_segmentation/platy-browser-data/software/conda/miniconda3/envs/platybrowser/bin/python')
'#! /g/kreshuk/pape/Work/software/conda/miniconda3/envs/cluster_env37/bin/python')
DEFAULT_BLOCK_SHAPE = [64, 512, 512]
......
......@@ -58,16 +58,24 @@ def update_table(name, seg_dict, folder, new_folder,
def update_tables(folder, new_folder, names_to_update, target, max_jobs):
segmentations = get_segmentations()
# first copy all tables that just need to be copied
for name, seg in segmentations.items():
has_table = seg.get('has_tables', False) or 'table_update_function' in seg
if name in names_to_update:
if not has_table:
raise RuntimeError("Segmentation %s does not have a table:" % name)
update_table(name, seg, folder, new_folder,
target, max_jobs)
else:
if has_table:
copy_tables(folder, new_folder, name)
needs_update = name in names_to_update
if not has_table or needs_update:
continue
copy_tables(folder, new_folder, name)
# now update all tables that need to be updated
for name, seg in segmentations.items():
has_table = seg.get('has_tables', False) or 'table_update_function' in seg
needs_update = name in names_to_update
if not needs_update:
continue
if needs_update and not has_table:
raise RuntimeError("Segmentation %s does not have a table:" % name)
update_table(name, seg, folder, new_folder,
target, max_jobs)
# TODO check for errors
......
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