<jupyter_start><jupyter_text>load, align, apply Laplacian-of-Gaussian filter (log)<jupyter_code>data = np.array([read(f) for f in input_files])
aligned = Snake._align_SBS(data, method='DAPI')
save(name(description, tag='aligned'), aligned)
loged = Snake._transform_log(aligned, skip_index=0)
save(name(description, tag='log'), loged)
maxed = Snake._max_filter(loged, 3, remove_index=0)
save(name(description, tag='maxed'), maxed)<jupyter_output><empty_output><jupyter_text>detect candidate reads<jupyter_code>std = Snake._compute_std(loged, remove_index=0)
save(name(description, tag='std'), std)
peaks = Snake._find_peaks(std)
save(name(description, tag='peaks'), peaks)<jupyter_output>Cast float64 to float32<jupyter_text>segment nuclei and cells<jupyter_code>nuclei = Snake._segment_nuclei(data[0], THRESHOLD_DAPI,
 area_min=NUCLEUS_AREA[0], area_max=NUCLEUS_AREA[1])

save(name(description, tag='nuclei'), nuclei)
cells = Snake._segment_cells(data[0], nuclei, THRESHOLD_CELL)
save(name(description, tag='cells'), cells)<jupyter_output><empty_output><jupyter_text>extract base intensity, call reads, assign to cells<jupyter_code>df_bases = Snake._extract_bases(maxed, peaks, cells, 
                        THRESHOLD_STD, wildcards=WILDCARDS)
df_bases.to_csv(name(description, tag='bases', ext='csv'), index=None)
df_reads = Snake._call_reads(df_bases)
filename = name(description, tag='reads', ext='csv')
df_reads.to_csv(filename, index=None)
# read from csv to match numerical precision of snakemake pipeline
df_reads = pd.read_csv(filename) 
df_cells = Snake._call_cells(df_reads)
df_cells.to_csv(name(description, tag='cells', ext='csv'), index=None)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13811499703615887, 'fraction_numerical': 0.007113218731475993, 'mean_word_length': 9.355828220858896, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '149488', 'license': 'MIT', 'n_tokens_mistral': 645, 'n_tokens_neox': 607, 'n_words': 104, 'path': 'example_image_analysis.ipynb', 'repo_name': 'gwaygenomics/OpticalPooledScreens', 'size': '1687'}