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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168 | def all_fm_tomograms(*, include_private: bool = False) -> List[TomogramFile]:
"""
Collect all pairs of `.rec` tomogram filepaths and flagellar motor `.mod`
filepaths.
Does not initially load the tomogram image data. Given a `Tomogram` called
`tomo`, one can load and access the image data in one step with
`tomo.get_data()`.
Args:
include_private (bool): Whether to include our newest annotations, which
should not be available to the public. Defaults to False.
Returns:
TomogramFile objects with their annotations.
"""
tomograms = []
# ~~~ DRIVE 1 ~~~ #
# Hylemonella
root = f"/grphome/grp_tomo_db1_d1/nobackup/archive/TomoDB1_d1/FlagellarMotor_P1/Hylemonella gracilis"
dir_regex = re.compile(r"yc\d{4}.*")
directories = seek_dirs(root, dir_regex)
flagellum_regex = re.compile(r"^fm.mod$", re.IGNORECASE)
tomogram_regex = re.compile(r".*\.rec$")
these_tomograms = seek_annotated_tomos(
directories,
tomogram_regex,
[flagellum_regex],
["Flagellar Motor"]
)
tomograms += these_tomograms
# ~~~ DRIVE 2 ~~~ #
# Legionella
root = f"/grphome/grp_tomo_db1_d2/nobackup/archive/TomoDB1_d2/FlagellarMotor_P2/legionella"
dir_regex = re.compile(r"dg\d{4}.*")
directories = seek_dirs(root, dir_regex)
flagellum_regex = re.compile(r"^FM\.mod$")
tomogram_regex = re.compile(r".*SIRT_1k\.rec$")
these_tomograms = seek_annotated_tomos(
directories,
tomogram_regex,
[flagellum_regex],
["Flagellar Motor"]
)
tomograms += these_tomograms
# Pseudomonas
root = f"/grphome/grp_tomo_db1_d2/nobackup/archive/TomoDB1_d2/FlagellarMotor_P2/Pseudomonasaeruginosa/done"
dir_regex = re.compile(r"ab\d{4}.*")
directories = seek_dirs(root, dir_regex)
flagellum_regex = re.compile(r"^FM\.mod$")
tomogram_regex = re.compile(r".*SIRT_1k\.rec$")
these_tomograms = seek_annotated_tomos(
directories,
tomogram_regex,
[flagellum_regex],
["Flagellar Motor"]
)
tomograms += these_tomograms
# Proteus_mirabilis
root = f"/grphome/grp_tomo_db1_d2/nobackup/archive/TomoDB1_d2/FlagellarMotor_P2/Proteus_mirabilis"
dir_regex = re.compile(r"qya\d{4}.*")
directories = seek_dirs(root, dir_regex)
flagellum_regex = re.compile(r"^FM\.mod$")
tomogram_regex = re.compile(r".*\.rec$")
these_tomograms = seek_annotated_tomos(
directories,
tomogram_regex,
[flagellum_regex],
["Flagellar Motor"]
)
tomograms += these_tomograms
# ~~~ DRIVE 3 ~~~ #
# Bdellovibrio
root = f"/grphome/grp_tomo_db1_d3/nobackup/archive/TomoDB1_d3/jhome_extra/Bdellovibrio_YW"
dir_regex = re.compile(r"yc\d{4}.*")
directories = seek_dirs(root, dir_regex)
flagellum_regex = re.compile(r"^flagellum_SIRT_1k\.mod$")
tomogram_regex = re.compile(r".*SIRT_1k\.rec$")
these_tomograms = seek_annotated_tomos(
directories,
tomogram_regex,
[flagellum_regex],
["Flagellar Motor"]
)
tomograms += these_tomograms
# Azospirillum
root = f"/grphome/grp_tomo_db1_d3/nobackup/archive/TomoDB1_d3/jhome_extra/AzospirillumBrasilense/done"
dir_regex = re.compile(r"ab\d{4}.*")
directories = seek_dirs(root, dir_regex)
flagellum_regex = re.compile(r"^FM3\.mod$")
tomogram_regex = re.compile(r".*SIRT_1k\.rec$")
these_tomograms = seek_annotated_tomos(
directories,
tomogram_regex,
[flagellum_regex],
["Flagellar Motor"]
)
tomograms += these_tomograms
### ANNOTATIONS BEYOND HERE ARE PRIVATE ###
if not include_private:
return tomograms
# ~~~ ZHIPING ~~~ #
root = f"/grphome/fslg_imagseg/nobackup/archive/zhiping_data/caulo_WT/"
dir_regex = re.compile(r"rrb\d{4}.*")
directories = seek_dirs(root, dir_regex)
flagellum_regex = re.compile(r"^flagellum\.mod$")
tomogram_regex = re.compile(r".*\.rec$")
these_tomograms = seek_annotated_tomos(
directories,
tomogram_regex,
[flagellum_regex],
["Flagellar Motor"]
)
tomograms += these_tomograms
# ~~~ ANNOTATION PARTY ~~~ #
root = f"/grphome/grp_tomo_db1_d4/nobackup/archive/ExperimentRuns/"
dir_regex = re.compile(r"(sma\d{4}.*)|(Vibrio.*)")
directories = seek_dirs(root, dir_regex)
flagellum_regex = re.compile(r"flagellar_motor\.mod")
tomogram_regex = re.compile(r".*\.mrc$")
these_tomograms = seek_annotated_tomos(
directories,
tomogram_regex,
[flagellum_regex],
["Flagellar Motor"]
)
tomograms += these_tomograms
return tomograms
|