-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_pages.py
More file actions
109 lines (97 loc) · 3.14 KB
/
build_pages.py
File metadata and controls
109 lines (97 loc) · 3.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
"""
This script generates the following pages for the website:
1. The overview page for all sexually dimorphic cell types
2. The summaries for individual sexually dimorphic cell types
"""
import argparse
from build_tools import loading, building
# Set up the argument parser
parser = argparse.ArgumentParser(
description="Generate HTML pages for sexually dimorphic cell types."
)
# Add option to force meta data update
parser.add_argument(
"--update-metadata",
action="store_true",
help="Force update of the meta data cache.",
)
# Add options to skip certain steps
parser.add_argument(
"--skip-thumbnails",
action="store_true",
help="Skip the generation of thumbnail images.",
)
parser.add_argument(
"--skip-overview",
action="store_true",
help="Skip the generation of the overview page.",
)
parser.add_argument(
"--skip-profiles",
action="store_true",
help="Skip the generation of individual cell type pages.",
)
parser.add_argument(
"--skip-graphs",
action="store_true",
help="Skip the generation of networks graphs.",
)
parser.add_argument(
"--skip-supertypes",
action="store_true",
help="Skip the generation of summary pages for supertypes.",
)
parser.add_argument(
"--skip-hemilineages",
action="store_true",
help="Skip the generation of summary pages for hemilineages.",
)
parser.add_argument(
"--skip-synonyms",
action="store_true",
help="Skip the generation of summary pages for synonyms.",
)
parser.add_argument(
"--clear-build",
action="store_true",
help="Clear the build directory before generating pages.",
)
if __name__ == "__main__":
# Load the template
args = parser.parse_args()
# Load meta data
mcns_meta, fw_meta, mcns_roi_info, fw_roi_info = loading.load_cache_meta_data(
force_update=args.update_metadata
)
# mcns_meta["type"] = mcns_meta.type.fillna(mcns_meta.flywireType).fillna("unknown")
mappings = loading.load_cache_mapping(force_update=args.update_metadata)
fw_edges = loading.load_cache_fw_edges(force_update=args.update_metadata)
# Add MCNS <-> FlyWire mapping to the meta data
mcns_meta["mapping"] = mcns_meta["bodyId"].map(mappings)
fw_meta["mapping"] = fw_meta["root_id"].map(mappings)
if args.clear_build:
# Clear the build directory
building.clear_build_directory()
# Generate the supertype pages
if not args.skip_supertypes:
building.make_supertype_pages(
mcns_meta, fw_meta, skip_thumbnails=args.skip_thumbnails
)
# Generate the individual synonyms pages + thumbnails
if not args.skip_synonyms:
building.make_synonyms_pages(
mcns_meta, fw_meta, skip_thumbnails=args.skip_thumbnails
)
# Generate the hemilineage pages
if not args.skip_hemilineages:
building.make_hemilineage_pages(mcns_meta, fw_meta)
# Generate the dimorphism pages (overview and individual pages)
building.make_dimorphism_pages(
mcns_meta,
fw_meta,
fw_edges,
mcns_roi_info,
fw_roi_info,
skip_graphs=args.skip_graphs,
skip_thumbnails=args.skip_thumbnails,
)