lab.py
activate(schema_name, create_schema=True, create_tables=True)
¶
Activate this schema
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
schema_name |
str
|
schema name on the database server to activate the |
required |
create_schema |
bool
|
when True (default), create schema in the database if it does not yet exist. |
True
|
create_tables |
bool
|
when True (default), create schema tables in the database if they do not yet exist. |
True
|
Source code in element_lab/lab.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 | |
Organization
¶
Bases: dj.Manual
Top-level list of all organizations involved in any of the projects.
Attributes:
| Name | Type | Description |
|---|---|---|
organization |
varchar(24)
|
Abbreviated organization name. |
org_name |
varchar(255)
|
Full organization name. |
org_address |
varchar(512), optional
|
Address of the organization. |
org_comment |
varchar(1024), optional
|
Additional notes on the organization. |
Source code in element_lab/lab.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | |
Lab
¶
Bases: dj.Lookup
Table for storing general lab info.
Attributes:
| Name | Type | Description |
|---|---|---|
lab |
varchar(24)
|
Abbreviated lab name. |
lab_name |
varchar(255)
|
Full lab name. |
address |
varchar(255)
|
Physical lab address. |
time_zone |
varchar(64)
|
'UTC±X' format or timezone, e.g., America/New_York. If using NWB export, use 'UTC±X' format. |
Source code in element_lab/lab.py
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 | |
Location
¶
Bases: dj.Lookup
Location of research (e.g., animal housing or experimental rigs).
Attributes:
| Name | Type | Description |
|---|---|---|
Lab |
foreign key
|
Lab key. |
location |
varchar(32)
|
Location of a space related to the lab. |
location_description |
varchar(255), optional
|
Description of the location. |
Source code in element_lab/lab.py
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | |
UserRole
¶
Bases: dj.Lookup
Roles assigned to a user or a job title.
Attributes:
| Name | Type | Description |
|---|---|---|
user_role |
varchar(24)
|
Role within the lab (e.g., PI, Postdoc, etc.). |
Source code in element_lab/lab.py
91 92 93 94 95 96 97 98 99 100 101 | |
User
¶
Bases: dj.Lookup
Table for storing user information.
Attributes:
| Name | Type | Description |
|---|---|---|
user |
varchar(32)
|
User name. |
user_email |
varchar(128), optional
|
User email address. |
user_cellphone |
varchar(32), optional
|
User cellphone number. |
user_fullname |
varchar(64), optional
|
User full name |
Source code in element_lab/lab.py
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | |
LabMembership
¶
Bases: dj.Lookup
Store lab membership information using three lookup tables.
Attributes:
| Name | Type | Description |
|---|---|---|
Lab |
foreign key
|
Lab key. |
User |
foreign key
|
User key. |
UserRole |
foreign key
|
Optional. UserRole primary key. |
Source code in element_lab/lab.py
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 | |
ProtocolType
¶
Bases: dj.Lookup
Type of protocol or issuing agency.
Attributes:
| Name | Type | Description |
|---|---|---|
protocol_type |
varchar(32)
|
Protocol types (e.g., IACUC, IRB, etc.). |
Source code in element_lab/lab.py
142 143 144 145 146 147 148 149 150 151 152 | |
Protocol
¶
Bases: dj.Lookup
Protocol approved by institutions (e.g. IACUC, IRB), or experimental protocol.
Attributes:
| Name | Type | Description |
|---|---|---|
protocol |
varchar(36)
|
Protocol identifier. |
ProtocolType |
foreign key
|
ProtocolType key. |
protocol_description( |
varchar(255), optional
|
Description of the protocol. |
Source code in element_lab/lab.py
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 | |
Project
¶
Bases: dj.Lookup
Projects within a lab.
Attributes:
| Name | Type | Description |
|---|---|---|
project |
varchar(32)
|
Project identifier. |
project_description |
varchar(1024)
|
Description about the project. |
Source code in element_lab/lab.py
173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 | |
ProjectKeywords
¶
Bases: dj.Manual
Project keywords or meta-information.
Attributes:
| Name | Type | Description |
|---|---|---|
Project |
foreign key
|
Project key. |
keyword |
varchar(32)
|
Descriptive keyword about the project. |
Source code in element_lab/lab.py
194 195 196 197 198 199 200 201 202 203 204 205 206 | |
ProjectPublication
¶
Bases: dj.Manual
Project's resulting publications.
Attributes:
| Name | Type | Description |
|---|---|---|
Project |
foreign key
|
Project key. |
publication |
varchar(256)
|
Name of the published paper. |
Source code in element_lab/lab.py
209 210 211 212 213 214 215 216 217 218 219 220 221 | |
ProjectSourceCode
¶
Bases: dj.Manual
URL to source code for replication.
Attributes:
| Name | Type | Description |
|---|---|---|
Project |
foreign key
|
Project key. |
repository_url |
varchar(256)
|
URL to the code repository. |
repository_name |
varchar(32)
|
Name of the repository. |
Source code in element_lab/lab.py
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 | |
ProjectUser
¶
Bases: dj.Manual
Users participating in the project.
Attributes:
| Name | Type | Description |
|---|---|---|
Project |
foreign key
|
Project key. |
User |
foreign key
|
User key. |
Source code in element_lab/lab.py
242 243 244 245 246 247 248 249 250 251 252 253 254 | |
Source
¶
Bases: dj.Lookup
Source or supplier of subject animals.
Attributes:
| Name | Type | Description |
|---|---|---|
source |
varchar(32)
|
Abbreviated source name. |
source_name |
varchar(255)
|
Source name. |
contact_details |
varchar(255)
|
Optional. Phone number and/or email. |
source_description |
varchar(255)
|
Optional. Description of the source. |
Source code in element_lab/lab.py
257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 | |
Device
¶
Bases: dj.Lookup
Devices within the lab.
Attributes:
| Name | Type | Description |
|---|---|---|
device |
varchar(32)
|
Device short name. |
modality |
varchar(64)
|
Modality for which this device is used. |
description |
varchar(256)
|
Optional. Description of the device. |
Source code in element_lab/lab.py
277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 | |