<jupyter_start><jupyter_text>Define paths to the JSON data<jupyter_code>base_dir = "../data/example_dataset"
json_tiling_dir = os.path.join(base_dir, "json_tiling_data")
fov_list_path = os.path.join(json_tiling_dir, 'fov_list_single_fov.json')
moly_path = os.path.join(json_tiling_dir, 'moly_point.json')
tiled_output_path = os.path.join(json_tiling_dir, 'tiled_output.json')<jupyter_output><empty_output><jupyter_text>Define whether TMA is used or not<jupyter_code>tma = False<jupyter_output><empty_output><jupyter_text>Set tiling parameters<jupyter_code># list of parameters:
# starting x coordinate and y coordinate for each fov (taken from fov_list_file)
# number of fovs along the x- and y-axis for each fov (set by user)
# x- and y-axis step size (set by user)
# randomize the order of the fovs or not (set by user)
tiling_params, moly_point = tiling_utils.set_tiling_params(fov_list_path, moly_path, tma=tma)<jupyter_output>Enter number of x fovs for region TheFirstFOV:  5
Enter number of y fovs for region TheFirstFOV:  5
Enter the x step size for region TheFirstFOV:  2
Enter the y step size for region TheFirstFOV:  2
Randomize fovs for region TheFirstFOV? Y/N:  Y
Enter number of x fovs for region TheSecondFOV:  3
Enter number of y fovs for region TheSecondFOV:  3
Enter the x step size for region TheSecondFOV:  2
Enter the y step size for region TheSecondFOV:  2
Randomize fovs for region TheSecondFOV? Y/N:  Y
Insert moly points between runs? Y/N:  Y
Specify moly point tile interval? Y/N:  Y
Enter the fov interval size to insert moly points:  2<jupyter_text>Create the FOV tiles for each region<jupyter_code>tiled_regions = tiling_utils.create_tiled_regions(tiling_params, moly_point, tma=tma)
# write the tiled output
with open(tiled_output_path, 'w') as top:
    json.dump(tiled_regions, top)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.07600434310532031, 'fraction_numerical': 0.004885993485342019, 'mean_word_length': 5.928571428571429, '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': '23600', 'license': 'Apache-2.0', 'n_tokens_mistral': 681, 'n_tokens_neox': 672, 'n_words': 210, 'path': 'templates/example_fov_grid_generate.ipynb', 'repo_name': 'angelolab/ark-analysis', 'size': '1842'}