spacr 0.9.0__py3-none-any.whl → 0.9.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- spacr/gui_core.py +0 -75
- spacr/plot.py +0 -122
- spacr/settings.py +0 -27
- spacr/timelapse.py +0 -90
- spacr/utils.py +0 -48
- {spacr-0.9.0.dist-info → spacr-0.9.1.dist-info}/METADATA +1 -1
- {spacr-0.9.0.dist-info → spacr-0.9.1.dist-info}/RECORD +11 -11
- {spacr-0.9.0.dist-info → spacr-0.9.1.dist-info}/LICENSE +0 -0
- {spacr-0.9.0.dist-info → spacr-0.9.1.dist-info}/WHEEL +0 -0
- {spacr-0.9.0.dist-info → spacr-0.9.1.dist-info}/entry_points.txt +0 -0
- {spacr-0.9.0.dist-info → spacr-0.9.1.dist-info}/top_level.txt +0 -0
spacr/gui_core.py
CHANGED
@@ -1083,81 +1083,6 @@ def process_console_queue():
|
|
1083
1083
|
# **Continue processing if no error was detected**
|
1084
1084
|
after_id = console_output.after(uppdate_frequency, process_console_queue)
|
1085
1085
|
parent_frame.after_tasks.append(after_id)
|
1086
|
-
|
1087
|
-
def process_console_queue_v2():
|
1088
|
-
global q, console_output, parent_frame, progress_bar, process_console_queue
|
1089
|
-
|
1090
|
-
# Initialize function attribute if it doesn't exist
|
1091
|
-
if not hasattr(process_console_queue, "completed_tasks"):
|
1092
|
-
process_console_queue.completed_tasks = []
|
1093
|
-
if not hasattr(process_console_queue, "current_maximum"):
|
1094
|
-
process_console_queue.current_maximum = None
|
1095
|
-
|
1096
|
-
ansi_escape_pattern = re.compile(r'\x1B\[[0-?]*[ -/]*[@-~]')
|
1097
|
-
|
1098
|
-
while not q.empty():
|
1099
|
-
message = q.get_nowait()
|
1100
|
-
clean_message = ansi_escape_pattern.sub('', message)
|
1101
|
-
|
1102
|
-
# **Abort Execution if an Error Message is Detected**
|
1103
|
-
if clean_message.startswith("Error:"):
|
1104
|
-
console_output.insert(tk.END, clean_message + "\n", "error")
|
1105
|
-
console_output.see(tk.END)
|
1106
|
-
print("Run aborted due to error:", clean_message) # Debug message
|
1107
|
-
return # **Exit immediately to stop further execution**
|
1108
|
-
|
1109
|
-
# Check if the message contains progress information
|
1110
|
-
if clean_message.startswith("Progress:"):
|
1111
|
-
try:
|
1112
|
-
# Extract the progress information
|
1113
|
-
match = re.search(r'Progress: (\d+)/(\d+), operation_type: ([\w\s]*),(.*)', clean_message)
|
1114
|
-
|
1115
|
-
if match:
|
1116
|
-
current_progress = int(match.group(1))
|
1117
|
-
total_progress = int(match.group(2))
|
1118
|
-
operation_type = match.group(3).strip()
|
1119
|
-
additional_info = match.group(4).strip() # Capture everything after operation_type
|
1120
|
-
|
1121
|
-
# Check if the maximum value has changed
|
1122
|
-
if process_console_queue.current_maximum != total_progress:
|
1123
|
-
process_console_queue.current_maximum = total_progress
|
1124
|
-
process_console_queue.completed_tasks = []
|
1125
|
-
|
1126
|
-
# Add the task to the completed set
|
1127
|
-
process_console_queue.completed_tasks.append(current_progress)
|
1128
|
-
|
1129
|
-
# Calculate the unique progress count
|
1130
|
-
unique_progress_count = len(np.unique(process_console_queue.completed_tasks))
|
1131
|
-
|
1132
|
-
# Update the progress bar
|
1133
|
-
if progress_bar:
|
1134
|
-
progress_bar['maximum'] = total_progress
|
1135
|
-
progress_bar['value'] = unique_progress_count
|
1136
|
-
|
1137
|
-
# Store operation type and additional info
|
1138
|
-
if operation_type:
|
1139
|
-
progress_bar.operation_type = operation_type
|
1140
|
-
progress_bar.additional_info = additional_info
|
1141
|
-
|
1142
|
-
# Update the progress label
|
1143
|
-
if progress_bar.progress_label:
|
1144
|
-
progress_bar.update_label()
|
1145
|
-
|
1146
|
-
# Clear completed tasks when progress is complete
|
1147
|
-
if unique_progress_count >= total_progress:
|
1148
|
-
process_console_queue.completed_tasks.clear()
|
1149
|
-
|
1150
|
-
except Exception as e:
|
1151
|
-
print(f"Error parsing progress message: {e}")
|
1152
|
-
|
1153
|
-
else:
|
1154
|
-
# Insert non-progress messages into the console
|
1155
|
-
console_output.insert(tk.END, clean_message + "\n")
|
1156
|
-
console_output.see(tk.END)
|
1157
|
-
|
1158
|
-
# **Continue processing if no error was detected**
|
1159
|
-
after_id = console_output.after(uppdate_frequency, process_console_queue)
|
1160
|
-
parent_frame.after_tasks.append(after_id)
|
1161
1086
|
|
1162
1087
|
def main_thread_update_function(root, q, fig_queue, canvas_widget):
|
1163
1088
|
global uppdate_frequency
|
spacr/plot.py
CHANGED
@@ -1241,103 +1241,6 @@ def _display_gif(path):
|
|
1241
1241
|
"""
|
1242
1242
|
with open(path, 'rb') as file:
|
1243
1243
|
display(ipyimage(file.read()))
|
1244
|
-
|
1245
|
-
def _plot_recruitment_v2(df, df_type, channel_of_interest, columns=[], figuresize=10):
|
1246
|
-
"""
|
1247
|
-
Plot recruitment data for different conditions and pathogens.
|
1248
|
-
|
1249
|
-
Args:
|
1250
|
-
df (DataFrame): The input DataFrame containing the recruitment data.
|
1251
|
-
df_type (str): The type of DataFrame (e.g., 'train', 'test').
|
1252
|
-
channel_of_interest (str): The channel of interest for plotting.
|
1253
|
-
target (str): The target variable for plotting.
|
1254
|
-
columns (list, optional): Additional columns to plot. Defaults to an empty list.
|
1255
|
-
figuresize (int, optional): The size of the figure. Defaults to 50.
|
1256
|
-
|
1257
|
-
Returns:
|
1258
|
-
None
|
1259
|
-
"""
|
1260
|
-
|
1261
|
-
color_list = [(55/255, 155/255, 155/255),
|
1262
|
-
(155/255, 55/255, 155/255),
|
1263
|
-
(55/255, 155/255, 255/255),
|
1264
|
-
(255/255, 55/255, 155/255)]
|
1265
|
-
|
1266
|
-
sns.set_palette(sns.color_palette(color_list))
|
1267
|
-
font = figuresize/2
|
1268
|
-
width=figuresize
|
1269
|
-
height=figuresize/4
|
1270
|
-
|
1271
|
-
# Create the subplots
|
1272
|
-
fig, axes = plt.subplots(nrows=1, ncols=4, figsize=(width, height))
|
1273
|
-
|
1274
|
-
# Plot for 'cell_channel' on axes[0]
|
1275
|
-
plotter_cell = spacrGraph(df,grouping_column='condition', data_column=f'cell_channel_{channel_of_interest}_mean_intensity')
|
1276
|
-
plotter_cell.create_plot(ax=axes[0])
|
1277
|
-
axes[0].set_xlabel(f'pathogen {df_type}', fontsize=font)
|
1278
|
-
axes[0].set_ylabel(f'cell_channel_{channel_of_interest}_mean_intensity', fontsize=font)
|
1279
|
-
|
1280
|
-
# Plot for 'nucleus_channel' on axes[1]
|
1281
|
-
plotter_nucleus = spacrGraph(df,grouping_column='condition', data_column=f'nucleus_channel_{channel_of_interest}_mean_intensity')
|
1282
|
-
plotter_nucleus.create_plot(ax=axes[1])
|
1283
|
-
axes[1].set_xlabel(f'pathogen {df_type}', fontsize=font)
|
1284
|
-
axes[1].set_ylabel(f'nucleus_channel_{channel_of_interest}_mean_intensity', fontsize=font)
|
1285
|
-
|
1286
|
-
# Plot for 'cytoplasm_channel' on axes[2]
|
1287
|
-
plotter_cytoplasm = spacrGraph(df, grouping_column='condition', data_column=f'cytoplasm_channel_{channel_of_interest}_mean_intensity')
|
1288
|
-
plotter_cytoplasm.create_plot(ax=axes[2])
|
1289
|
-
axes[2].set_xlabel(f'pathogen {df_type}', fontsize=font)
|
1290
|
-
axes[2].set_ylabel(f'cytoplasm_channel_{channel_of_interest}_mean_intensity', fontsize=font)
|
1291
|
-
|
1292
|
-
# Plot for 'pathogen_channel' on axes[3]
|
1293
|
-
plotter_pathogen = spacrGraph(df, grouping_column='condition', data_column=f'pathogen_channel_{channel_of_interest}_mean_intensity')
|
1294
|
-
plotter_pathogen.create_plot(ax=axes[3])
|
1295
|
-
axes[3].set_xlabel(f'pathogen {df_type}', fontsize=font)
|
1296
|
-
axes[3].set_ylabel(f'pathogen_channel_{channel_of_interest}_mean_intensity', fontsize=font)
|
1297
|
-
|
1298
|
-
#axes[0].legend_.remove()
|
1299
|
-
#axes[1].legend_.remove()
|
1300
|
-
#axes[2].legend_.remove()
|
1301
|
-
#axes[3].legend_.remove()
|
1302
|
-
|
1303
|
-
handles, labels = axes[3].get_legend_handles_labels()
|
1304
|
-
axes[3].legend(handles, labels, bbox_to_anchor=(1.05, 0.5), loc='center left')
|
1305
|
-
for i in [0,1,2,3]:
|
1306
|
-
axes[i].tick_params(axis='both', which='major', labelsize=font)
|
1307
|
-
axes[i].set_xticklabels(axes[i].get_xticklabels(), rotation=45)
|
1308
|
-
|
1309
|
-
plt.tight_layout()
|
1310
|
-
plt.show()
|
1311
|
-
|
1312
|
-
columns = columns + ['pathogen_cytoplasm_mean_mean', 'pathogen_cytoplasm_q75_mean', 'pathogen_periphery_cytoplasm_mean_mean', 'pathogen_outside_cytoplasm_mean_mean', 'pathogen_outside_cytoplasm_q75_mean']
|
1313
|
-
#columns = columns + [f'pathogen_slope_channel_{channel_of_interest}', f'pathogen_cell_distance_channel_{channel_of_interest}', f'nucleus_cell_distance_channel_{channel_of_interest}']
|
1314
|
-
|
1315
|
-
width = figuresize*2
|
1316
|
-
columns_per_row = math.ceil(len(columns) / 2)
|
1317
|
-
height = (figuresize*2)/columns_per_row
|
1318
|
-
|
1319
|
-
fig, axes = plt.subplots(nrows=2, ncols=columns_per_row, figsize=(width, height * 2))
|
1320
|
-
axes = axes.flatten()
|
1321
|
-
|
1322
|
-
print(f'{columns}')
|
1323
|
-
for i, col in enumerate(columns):
|
1324
|
-
ax = axes[i]
|
1325
|
-
plotter_col = spacrGraph(df, grouping_column='condition', data_column=col)
|
1326
|
-
plotter_col.create_plot(ax=ax)
|
1327
|
-
ax.set_xlabel(f'pathogen {df_type}', fontsize=font)
|
1328
|
-
ax.set_ylabel(f'{col}', fontsize=int(font * 2))
|
1329
|
-
#ax.legend_.remove()
|
1330
|
-
ax.tick_params(axis='both', which='major', labelsize=font)
|
1331
|
-
ax.set_xticklabels(ax.get_xticklabels(), rotation=45)
|
1332
|
-
if i <= 5:
|
1333
|
-
ax.set_ylim(1, None)
|
1334
|
-
|
1335
|
-
# Turn off any unused axes
|
1336
|
-
for i in range(len(columns), len(axes)):
|
1337
|
-
axes[i].axis('off')
|
1338
|
-
|
1339
|
-
plt.tight_layout()
|
1340
|
-
plt.show()
|
1341
1244
|
|
1342
1245
|
def _plot_recruitment(df, df_type, channel_of_interest, columns=[], figuresize=10):
|
1343
1246
|
"""
|
@@ -1843,31 +1746,6 @@ def print_mask_and_flows(stack, mask, flows, overlay=True, max_size=1000, thickn
|
|
1843
1746
|
fig.tight_layout()
|
1844
1747
|
plt.show()
|
1845
1748
|
|
1846
|
-
def plot_resize_v1(images, resized_images, labels, resized_labels):
|
1847
|
-
# Display an example image and label before and after resizing
|
1848
|
-
fig, ax = plt.subplots(2, 2, figsize=(20, 20))
|
1849
|
-
|
1850
|
-
# Check if the image is grayscale; if so, add a colormap and keep dimensions correct
|
1851
|
-
if images[0].ndim == 2: # Grayscale image
|
1852
|
-
ax[0, 0].imshow(images[0], cmap='gray')
|
1853
|
-
else: # RGB or RGBA image
|
1854
|
-
ax[0, 0].imshow(images[0])
|
1855
|
-
ax[0, 0].set_title('Original Image')
|
1856
|
-
|
1857
|
-
if resized_images[0].ndim == 2: # Grayscale image
|
1858
|
-
ax[0, 1].imshow(resized_images[0], cmap='gray')
|
1859
|
-
else: # RGB or RGBA image
|
1860
|
-
ax[0, 1].imshow(resized_images[0])
|
1861
|
-
ax[0, 1].set_title('Resized Image')
|
1862
|
-
|
1863
|
-
# Assuming labels are always grayscale (most common scenario)
|
1864
|
-
ax[1, 0].imshow(labels[0], cmap='gray')
|
1865
|
-
ax[1, 0].set_title('Original Label')
|
1866
|
-
ax[1, 1].imshow(resized_labels[0], cmap='gray')
|
1867
|
-
ax[1, 1].set_title('Resized Label')
|
1868
|
-
plt.show()
|
1869
|
-
|
1870
|
-
|
1871
1749
|
def plot_resize(images, resized_images, labels, resized_labels):
|
1872
1750
|
def prepare_image(img):
|
1873
1751
|
if img.ndim == 2:
|
spacr/settings.py
CHANGED
@@ -124,33 +124,6 @@ def set_default_plot_data_from_db(settings):
|
|
124
124
|
settings.setdefault('uninfected', False)
|
125
125
|
return settings
|
126
126
|
|
127
|
-
|
128
|
-
|
129
|
-
def set_default_settings_preprocess_img_data_v1(settings):
|
130
|
-
|
131
|
-
metadata_type = settings.setdefault('metadata_type', 'cellvoyager')
|
132
|
-
custom_regex = settings.setdefault('custom_regex', None)
|
133
|
-
nr = settings.setdefault('nr', 1)
|
134
|
-
plot = settings.setdefault('plot', True)
|
135
|
-
batch_size = settings.setdefault('batch_size', 50)
|
136
|
-
timelapse = settings.setdefault('timelapse', False)
|
137
|
-
lower_percentile = settings.setdefault('lower_percentile', 2)
|
138
|
-
randomize = settings.setdefault('randomize', True)
|
139
|
-
all_to_mip = settings.setdefault('all_to_mip', False)
|
140
|
-
pick_slice = settings.setdefault('pick_slice', False)
|
141
|
-
skip_mode = settings.setdefault('skip_mode', False)
|
142
|
-
|
143
|
-
cmap = settings.setdefault('cmap', 'inferno')
|
144
|
-
figuresize = settings.setdefault('figuresize', 10)
|
145
|
-
normalize = settings.setdefault('normalize', True)
|
146
|
-
save_dtype = settings.setdefault('save_dtype', 'uint16')
|
147
|
-
|
148
|
-
test_mode = settings.setdefault('test_mode', False)
|
149
|
-
test_images = settings.setdefault('test_images', 10)
|
150
|
-
random_test = settings.setdefault('random_test', True)
|
151
|
-
|
152
|
-
return settings, metadata_type, custom_regex, nr, plot, batch_size, timelapse, lower_percentile, randomize, all_to_mip, pick_slice, skip_mode, cmap, figuresize, normalize, save_dtype, test_mode, test_images, random_test
|
153
|
-
|
154
127
|
def set_default_settings_preprocess_img_data(settings):
|
155
128
|
|
156
129
|
settings.setdefault('metadata_type', 'cellvoyager')
|
spacr/timelapse.py
CHANGED
@@ -255,56 +255,6 @@ def _relabel_masks_based_on_tracks(masks, tracks, mode='btrack'):
|
|
255
255
|
|
256
256
|
return relabeled_masks
|
257
257
|
|
258
|
-
def _prepare_for_tracking_v1(mask_array):
|
259
|
-
"""
|
260
|
-
Prepare the mask array for object tracking.
|
261
|
-
|
262
|
-
Args:
|
263
|
-
mask_array (ndarray): Array of binary masks representing objects.
|
264
|
-
|
265
|
-
Returns:
|
266
|
-
DataFrame: DataFrame containing information about each object in the mask array.
|
267
|
-
The DataFrame has the following columns:
|
268
|
-
- frame: The frame number.
|
269
|
-
- y: The y-coordinate of the object's centroid.
|
270
|
-
- x: The x-coordinate of the object's centroid.
|
271
|
-
- mass: The area of the object.
|
272
|
-
- original_label: The original label of the object.
|
273
|
-
|
274
|
-
"""
|
275
|
-
frames = []
|
276
|
-
for t, frame in enumerate(mask_array):
|
277
|
-
props = regionprops(frame)
|
278
|
-
for obj in props:
|
279
|
-
# Include 'label' in the dictionary to capture the original label of the object
|
280
|
-
frames.append({
|
281
|
-
'frame': t,
|
282
|
-
'y': obj.centroid[0],
|
283
|
-
'x': obj.centroid[1],
|
284
|
-
'mass': obj.area,
|
285
|
-
'original_label': obj.label # Capture the original label
|
286
|
-
})
|
287
|
-
return pd.DataFrame(frames)
|
288
|
-
|
289
|
-
def _prepare_for_tracking_v1(mask_array):
|
290
|
-
frames = []
|
291
|
-
for t, frame in enumerate(mask_array):
|
292
|
-
props = regionprops_table(
|
293
|
-
frame,
|
294
|
-
properties=('label', 'centroid-0', 'centroid-1', 'area',
|
295
|
-
'bbox-0', 'bbox-1', 'bbox-2', 'bbox-3',
|
296
|
-
'eccentricity')
|
297
|
-
)
|
298
|
-
df = pd.DataFrame(props)
|
299
|
-
df = df.rename(columns={
|
300
|
-
'centroid-0': 'y', 'centroid-1': 'x', 'area': 'mass',
|
301
|
-
'label': 'original_label'
|
302
|
-
})
|
303
|
-
df['frame'] = t
|
304
|
-
frames.append(df[['frame','y','x','mass','original_label',
|
305
|
-
'bbox-0','bbox-1','bbox-2','bbox-3','eccentricity']])
|
306
|
-
return pd.concat(frames, ignore_index=True)
|
307
|
-
|
308
258
|
def _prepare_for_tracking(mask_array):
|
309
259
|
frames = []
|
310
260
|
for t, frame in enumerate(mask_array):
|
@@ -522,46 +472,6 @@ def _facilitate_trackin_with_adaptive_removal(masks, search_range=None, max_atte
|
|
522
472
|
f"Failed to track after {max_attempts} attempts; last search_range={search_range}"
|
523
473
|
)
|
524
474
|
|
525
|
-
def _facilitate_trackin_with_adaptive_removal_v1(masks, search_range=500, max_attempts=100, memory=3):
|
526
|
-
"""
|
527
|
-
Facilitates object tracking with adaptive removal.
|
528
|
-
|
529
|
-
Args:
|
530
|
-
masks (numpy.ndarray): Array of binary masks representing objects in each frame.
|
531
|
-
search_range (int, optional): Maximum distance objects can move between frames. Defaults to 500.
|
532
|
-
max_attempts (int, optional): Maximum number of attempts to track objects. Defaults to 100.
|
533
|
-
memory (int, optional): Number of frames to remember when linking tracks. Defaults to 3.
|
534
|
-
|
535
|
-
Returns:
|
536
|
-
tuple: A tuple containing the updated masks, features, and tracks_df.
|
537
|
-
masks (numpy.ndarray): Updated array of binary masks.
|
538
|
-
features (pandas.DataFrame): DataFrame containing features for object tracking.
|
539
|
-
tracks_df (pandas.DataFrame): DataFrame containing the tracked object trajectories.
|
540
|
-
|
541
|
-
Raises:
|
542
|
-
Exception: If tracking fails after the maximum number of attempts.
|
543
|
-
|
544
|
-
"""
|
545
|
-
attempts = 0
|
546
|
-
first_frame = masks[0]
|
547
|
-
starting_objects = np.unique(first_frame[first_frame != 0])
|
548
|
-
while attempts < max_attempts:
|
549
|
-
try:
|
550
|
-
masks = _remove_objects_from_first_frame(masks, 10)
|
551
|
-
first_frame = masks[0]
|
552
|
-
objects = np.unique(first_frame[first_frame != 0])
|
553
|
-
print(len(objects))
|
554
|
-
features = _prepare_for_tracking(masks)
|
555
|
-
tracks_df = tp.link(features, search_range=search_range, memory=memory)
|
556
|
-
print(f"Success with {len(objects)} objects, started with {len(starting_objects)} objects")
|
557
|
-
return masks, features, tracks_df
|
558
|
-
except Exception as e: # Consider catching a more specific exception if possible
|
559
|
-
print(f"Retrying with fewer objects. Exception: {e}", flush=True)
|
560
|
-
finally:
|
561
|
-
attempts += 1
|
562
|
-
print(f"Failed to track objects after {max_attempts} attempts. Consider adjusting parameters.")
|
563
|
-
return None, None, None
|
564
|
-
|
565
475
|
def _trackpy_track_cells(src, name, batch_filenames, object_type, masks, timelapse_displacement, timelapse_memory, timelapse_remove_transient, plot, save, mode, track_by_iou):
|
566
476
|
"""
|
567
477
|
Track cells using the Trackpy library.
|
spacr/utils.py
CHANGED
@@ -5210,54 +5210,6 @@ def rename_columns_in_db(db_path):
|
|
5210
5210
|
|
5211
5211
|
con.commit()
|
5212
5212
|
con.close()
|
5213
|
-
|
5214
|
-
def rename_columns_in_db_v1(db_path):
|
5215
|
-
with sqlite3.connect(db_path) as conn:
|
5216
|
-
cursor = conn.cursor()
|
5217
|
-
|
5218
|
-
# Retrieve all table names in the database
|
5219
|
-
cursor.execute("SELECT name FROM sqlite_master WHERE type='table';")
|
5220
|
-
tables = [table[0] for table in cursor.fetchall()]
|
5221
|
-
|
5222
|
-
for table in tables:
|
5223
|
-
# Retrieve column names for each table
|
5224
|
-
cursor.execute(f"PRAGMA table_info({table});")
|
5225
|
-
columns_info = cursor.fetchall()
|
5226
|
-
column_names = [col[1] for col in columns_info]
|
5227
|
-
|
5228
|
-
# Check if columns 'rowID' or 'columnID' exist
|
5229
|
-
columns_to_rename = {}
|
5230
|
-
if 'row' in column_names:
|
5231
|
-
columns_to_rename['row'] = 'rowID'
|
5232
|
-
if 'col' in column_names:
|
5233
|
-
columns_to_rename['col'] = 'columnID'
|
5234
|
-
|
5235
|
-
# Rename columns if necessary
|
5236
|
-
if columns_to_rename:
|
5237
|
-
# Rename existing table to a temporary name
|
5238
|
-
temp_table = f"{table}_old"
|
5239
|
-
cursor.execute(f"ALTER TABLE `{table}` RENAME TO `{temp_table}`")
|
5240
|
-
|
5241
|
-
# Define new columns with updated names
|
5242
|
-
column_definitions = ", ".join(
|
5243
|
-
[f"`{columns_to_rename.get(col[1], col[1])}` {col[2]}" for col in columns_info]
|
5244
|
-
)
|
5245
|
-
cursor.execute(f"CREATE TABLE `{table}` ({column_definitions})")
|
5246
|
-
|
5247
|
-
# Copy data to the new table
|
5248
|
-
old_columns = ", ".join([f"`{col}`" for col in column_names])
|
5249
|
-
new_columns = ", ".join(
|
5250
|
-
[f"`{columns_to_rename.get(col, col)}`" for col in column_names]
|
5251
|
-
)
|
5252
|
-
cursor.execute(f"INSERT INTO `{table}` ({new_columns}) SELECT {old_columns} FROM `{temp_table}`")
|
5253
|
-
try:
|
5254
|
-
cursor.execute(f"DROP TABLE `{temp_table}`")
|
5255
|
-
except sqlite3.Error as e:
|
5256
|
-
print(f"Error while dropping temporary table '{temp_table}': {e}")
|
5257
|
-
|
5258
|
-
# After closing the 'with' block, run VACUUM outside of any transaction
|
5259
|
-
with sqlite3.connect(db_path) as conn:
|
5260
|
-
conn.execute("VACUUM;")
|
5261
5213
|
|
5262
5214
|
def group_feature_class(df, feature_groups=['cell', 'cytoplasm', 'nucleus', 'pathogen'], name='compartment'):
|
5263
5215
|
|
@@ -11,7 +11,7 @@ spacr/chat_bot.py,sha256=n3Fhqg3qofVXHmh3H9sUcmfYy9MmgRnr48663MVdY9E,1244
|
|
11
11
|
spacr/core.py,sha256=w4E3Pg-ZnA8BOK0iUMTjiNO0GeR5YCEs8fUTbESzqjY,47392
|
12
12
|
spacr/deep_spacr.py,sha256=055tIo3WP3elGFiIuSZaLURgu2XyUDxAdbw5ezASEqM,54526
|
13
13
|
spacr/gui.py,sha256=NhMh96KoArrSAaJBV6PhDQpIC1cQpxgb6SclhRbYG8s,8122
|
14
|
-
spacr/gui_core.py,sha256=
|
14
|
+
spacr/gui_core.py,sha256=m-AYUmaSXqsGFj9EzPf4fp1irZGN-X-21S4FBO8PoXc,52727
|
15
15
|
spacr/gui_elements.py,sha256=5a3BOpctBPklsT1NungqS72h1Bg1FArUndE0OfvWD8Y,152646
|
16
16
|
spacr/gui_utils.py,sha256=vv_uBOA0n-04KCCicYHhNt3sRbm0IPLM5r8QX5EkJ1Q,40867
|
17
17
|
spacr/io.py,sha256=SYLhupKnOJJscNSGE4N67E32-ywhwrjRccIfZrL38Uk,157966
|
@@ -20,16 +20,16 @@ spacr/measure.py,sha256=Z3u4BU5RzcY82IZuboQ0OsxuXaPVwOlH65Rw6FrL5z4,55045
|
|
20
20
|
spacr/mediar.py,sha256=p0F515eFbm6_rePSnChsgqrgH-H5Sr_3zWrghtOnAUg,14863
|
21
21
|
spacr/ml.py,sha256=XCRZeX7UkbMctQICIoskeWVx8CCmmCoHNauUOAkfFq0,91692
|
22
22
|
spacr/openai.py,sha256=5vBZ3Jl2llYcW3oaTEXgdyCB2aJujMUIO5K038z7w_A,1246
|
23
|
-
spacr/plot.py,sha256=
|
23
|
+
spacr/plot.py,sha256=M2w9ytR8iMFtsVPhmQ5tzIWTQDmbtCzs1-7hALUIQtg,167339
|
24
24
|
spacr/sequencing.py,sha256=EY12RdW5QRKpHDRQCw1QoAlxCq8FK2v6WoVa5uuDBXQ,26745
|
25
|
-
spacr/settings.py,sha256=
|
25
|
+
spacr/settings.py,sha256=Fd5RbNxjBmWG6bCCDprVvy8dTjBzSK7L71k_-mJXBsk,87380
|
26
26
|
spacr/sim.py,sha256=1xKhXimNU3ukzIw-3l9cF3Znc_brW8h20yv8fSTzvss,71173
|
27
27
|
spacr/sp_stats.py,sha256=mbhwsyIqt5upsSD346qGjdCw7CFBa0tIS7zHU9e0jNI,9536
|
28
28
|
spacr/spacr_cellpose.py,sha256=RBHMs2vwXcfkj0xqAULpALyzJYXddSRycgZSzmwI7v0,14755
|
29
29
|
spacr/submodules.py,sha256=Z2i4kv_rWdxqoXsOKCF7BaSXtvaCZB69Ow8_FQBnZsY,83093
|
30
|
-
spacr/timelapse.py,sha256
|
30
|
+
spacr/timelapse.py,sha256=-5ZupTsCCpbenIQ2zsUmnwXh45B82fO-gPrSXOxu2s8,42980
|
31
31
|
spacr/toxo.py,sha256=GoNfgyH-NJx3WOzNQPgzODir7Jp65fs7UM46XpzcrUo,26056
|
32
|
-
spacr/utils.py,sha256=
|
32
|
+
spacr/utils.py,sha256=RA4V1EDXsU_Gs6QgplvOA4lVIRFQJVJ1JAzQsaunHiU,234010
|
33
33
|
spacr/version.py,sha256=axH5tnGwtgSnJHb5IDhiu4Zjk5GhLyAEDRe-rnaoFOA,409
|
34
34
|
spacr/resources/data/lopit.csv,sha256=ERI5f9W8RdJGiSx_khoaylD374f8kmvLia1xjhD_mII,4421709
|
35
35
|
spacr/resources/data/toxoplasma_metadata.csv,sha256=9TXx0VlClDHAxQmaLhoklE8NuETduXaGHZjhR_6lZfs,2969409
|
@@ -101,9 +101,9 @@ spacr/resources/icons/umap.png,sha256=dOLF3DeLYy9k0nkUybiZMe1wzHQwLJFRmgccppw-8b
|
|
101
101
|
spacr/resources/images/plate1_E01_T0001F001L01A01Z01C02.tif,sha256=Tl0ZUfZ_AYAbu0up_nO0tPRtF1BxXhWQ3T3pURBCCRo,7958528
|
102
102
|
spacr/resources/images/plate1_E01_T0001F001L01A02Z01C01.tif,sha256=m8N-V71rA1TT4dFlENNg8s0Q0YEXXs8slIn7yObmZJQ,7958528
|
103
103
|
spacr/resources/images/plate1_E01_T0001F001L01A03Z01C03.tif,sha256=Pbhk7xn-KUP6RSIhJsxQcrHFImBm3GEpLkzx7WOc-5M,7958528
|
104
|
-
spacr-0.9.
|
105
|
-
spacr-0.9.
|
106
|
-
spacr-0.9.
|
107
|
-
spacr-0.9.
|
108
|
-
spacr-0.9.
|
109
|
-
spacr-0.9.
|
104
|
+
spacr-0.9.1.dist-info/LICENSE,sha256=SR-2MeGc6SCM1UORJYyarSWY_A-JaOMFDj7ReSs9tRM,1083
|
105
|
+
spacr-0.9.1.dist-info/METADATA,sha256=Lh02YCW7LiHlegDZDIIascNP_XrFD421ewydkNNjjSY,6208
|
106
|
+
spacr-0.9.1.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
|
107
|
+
spacr-0.9.1.dist-info/entry_points.txt,sha256=BMC0ql9aNNpv8lUZ8sgDLQMsqaVnX5L535gEhKUP5ho,296
|
108
|
+
spacr-0.9.1.dist-info/top_level.txt,sha256=GJPU8FgwRXGzKeut6JopsSRY2R8T3i9lDgya42tLInY,6
|
109
|
+
spacr-0.9.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|