API Reference
biokb_coconut.db.models
This module contains the SQLAlchemy ORM models for the biokb_coconut database.
Each class in this module represents a table in the database, with attributes corresponding to the columns of the table. Relationships between tables are defined using SQLAlchemy's relationship function.
CAS
Bases: Base
Class definition for table cas.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
int
|
Primary key. |
number |
str
|
Unique CAS number. |
compounds |
list[Compound]
|
List of compounds associated with this CAS number. |
Source code in src/biokb_coconut/db/models.py
598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 | |
ChemicalClass
Bases: Base, OnlyName
Chemical Class model.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
int
|
Primary key. |
name |
str
|
Unique name of the chemical class. |
compounds |
list[Compound]
|
List of compounds associated with this class. |
Source code in src/biokb_coconut/db/models.py
375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 | |
ChemicalSubClass
Bases: Base, OnlyName
Chemical Sub-Class model.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
int
|
Primary key. |
name |
str
|
Unique name of the chemical sub-class. |
compounds |
list[Compound]
|
List of compounds associated with this sub-class. |
Source code in src/biokb_coconut/db/models.py
399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 | |
ChemicalSuperClass
Bases: Base, OnlyName
Chemical Super-Class model.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
int
|
Primary key. |
name |
str
|
Unique name of the chemical super-class. |
compounds |
list[Compound]
|
List of compounds associated with this super-class. |
Source code in src/biokb_coconut/db/models.py
451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 | |
Collection
Bases: Base
Class definition for table collection.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
int
|
Primary key. |
name |
str
|
Unique name of the collection. |
compounds |
list[Compound]
|
List of compounds associated with this collection. |
Source code in src/biokb_coconut/db/models.py
570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 | |
Compound
Bases: Base
Class definition for table compound.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
int
|
Primary key. |
identifier |
str
|
Unique identifier for the compound. |
canonical_smiles |
str
|
Canonical SMILES representation of the compound. |
standard_inchi |
str
|
Standard InChI representation of the compound. |
standard_inchi_key |
str
|
Standard InChI Key of the compound. |
name |
Optional[str]
|
Name of the compound. |
iupac_name |
Optional[str]
|
IUPAC name of the compound. |
annotation_level |
int
|
Annotation level of the compound. |
total_atom_count |
int
|
Total atom count of the compound. |
heavy_atom_count |
int
|
Heavy atom count of the compound. |
molecular_weight |
float
|
Molecular weight of the compound. |
exact_molecular_weight |
float
|
Exact molecular weight of the compound. |
molecular_formula |
str
|
Molecular formula of the compound. |
alogp |
float
|
ALogP value of the compound. |
topological_polar_surface_area |
float
|
Topological polar surface area of the compound. |
rotatable_bond_count |
int
|
Rotatable bond count of the compound. |
hydrogen_bond_acceptors |
int
|
Number of hydrogen bond acceptors. |
hydrogen_bond_donors |
int
|
Number of hydrogen bond donors. |
hydrogen_bond_acceptors_lipinski |
int
|
Number of hydrogen bond acceptors according to Lipinski's rule. |
hydrogen_bond_donors_lipinski |
int
|
Number of hydrogen bond donors according to Lipinski's rule. |
lipinski_rule_of_five_violations |
int
|
Number of Lipinski's rule of five violations. |
aromatic_rings_count |
int
|
Aromatic rings count of the compound. |
qed_drug_likeliness |
float
|
QED drug-likeliness score of the compound. |
formal_charge |
int
|
Formal charge of the compound. |
fractioncsp3 |
float
|
Fraction of sp3 hybridized carbons in the compound. |
number_of_minimal_rings |
int
|
Number of minimal rings in the compound. |
van_der_walls_volume |
Optional[float]
|
Van der Waals volume of the compound. |
contains_sugar |
Optional[bool]
|
Indicates if the compound contains sugar. |
contains_ring_sugars |
bool
|
Indicates if the compound contains ring sugars. |
contains_linear_sugars |
bool
|
Indicates if the compound contains linear sugars. |
murcko_framework |
Optional[str]
|
Murcko framework of the compound. |
np_likeness |
float
|
Natural product-likeness score of the compound. |
np_classifier_is_glycoside |
Optional[bool]
|
Indicates if the compound is classified as a glycoside by the NP classifier. |
chemical_class_id |
Optional[int]
|
Foreign key to the chemical class table. |
chemical_sub_class_id |
Optional[int]
|
Foreign key to the chemical sub-class table. |
direct_parent_classification_id |
Optional[int]
|
Foreign key to the direct parent classification table. |
chemical_super_class_id |
Optional[int]
|
Foreign key to the chemical super-class table. |
np_classifier_pathway_id |
Optional[int]
|
Foreign key to the NP classifier pathway table. |
np_classifier_superclass_id |
Optional[int]
|
Foreign key to the NP classifier superclass table. |
np_classifier_class_id |
Optional[int]
|
Foreign key to the NP classifier class table. |
chemical_class |
Optional[ChemicalClass]
|
Relationship to the chemical class. |
chemical_sub_class |
Optional[ChemicalSubClass]
|
Relationship to the chemical sub-class. |
direct_parent_classification |
Optional[DirectParentClassification]
|
Relationship to the direct parent classification. |
chemical_super_class |
Optional[ChemicalSuperClass]
|
Relationship to the chemical super-class. |
np_classifier_pathway |
Optional[NpClassifierPathway]
|
Relationship to the NP classifier pathway. |
np_classifier_superclass |
Optional[NpClassifierSuperclass]
|
Relationship to the NP classifier superclass. |
np_classifier_class |
Optional[NpClassifierClass]
|
Relationship to the NP classifier class. |
organisms |
list[Organism]
|
List of organisms associated with the compound. |
collections |
list[Collection]
|
List of collections associated with the compound. |
dois |
list[DOI]
|
List of DOIs associated with the compound. |
synonyms |
list[Synonym]
|
List of synonyms associated with the compound. |
cas_numbers |
list[CAS]
|
List of CAS numbers associated with the compound. |
Source code in src/biokb_coconut/db/models.py
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 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 | |
CompoundCAS
Bases: Base
Joining table for Compound and CAS many-to-many relationship.
Attributes:
| Name | Type | Description |
|---|---|---|
compound_id |
int
|
Foreign key to the compound table. |
cas_number_id |
int
|
Foreign key to the cas table. |
Source code in src/biokb_coconut/db/models.py
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | |
CompoundCollection
Bases: Base
Joining table for Compound and Collection many-to-many relationship.
Attributes:
| Name | Type | Description |
|---|---|---|
compound_id |
int
|
Foreign key to the compound table. |
collection_id |
int
|
Foreign key to the collection table. |
Source code in src/biokb_coconut/db/models.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | |
CompoundDOI
Bases: Base
Joining table for Compound and DOI many-to-many relationship.
Attributes:
| Name | Type | Description |
|---|---|---|
compound_id |
int
|
Foreign key to the compound table. |
doi_id |
int
|
Foreign key to the doi table. |
Source code in src/biokb_coconut/db/models.py
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | |
CompoundOrganism
Bases: Base
Joining table for Compound and Organism many-to-many relationship.
Attributes:
| Name | Type | Description |
|---|---|---|
compound_id |
int
|
Foreign key to the compound table. |
organism_id |
int
|
Foreign key to the organism table. |
Source code in src/biokb_coconut/db/models.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | |
CompoundSynonym
Bases: Base
Joining table for Compound and Synonym many-to-many relationship.
Attributes:
| Name | Type | Description |
|---|---|---|
compound_id |
int
|
Foreign key to the compound table. |
synonym_id |
int
|
Foreign key to the synonym table. |
Source code in src/biokb_coconut/db/models.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | |
DOI
Bases: Base
Class definition for table doi.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
int
|
Primary key. |
identifier |
str
|
Unique identifier for the DOI. |
compounds |
list[Compound]
|
List of compounds associated with this DOI. |
Source code in src/biokb_coconut/db/models.py
477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 | |
DirectParentClassification
Bases: Base, OnlyName
Direct Parent Classification model.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
int
|
Primary key. |
name |
str
|
Unique name of the direct parent classification. |
compounds |
list[Compound]
|
List of compounds associated with this classification. |
Source code in src/biokb_coconut/db/models.py
425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 | |
NpClassifierClass
Bases: Base, OnlyName
Natural Product Classifier Class model.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
int
|
Primary key. |
name |
str
|
Unique name of the NP classifier class. |
compounds |
list[Compound]
|
List of compounds associated with this class. |
Source code in src/biokb_coconut/db/models.py
349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 | |
NpClassifierPathway
Bases: Base, OnlyName
Natural Product Classifier Pathway model.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
int
|
Primary key. |
name |
str
|
Unique name of the NP classifier pathway. |
compounds |
list[Compound]
|
List of compounds associated with this pathway. |
Source code in src/biokb_coconut/db/models.py
297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 | |
NpClassifierSuperclass
Bases: Base, OnlyName
Natural Product Classifier Superclass model.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
int
|
Primary key. |
name |
str
|
Unique name of the NP classifier superclass. |
compounds |
list[Compound]
|
List of compounds associated with this superclass. |
Source code in src/biokb_coconut/db/models.py
323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 | |
Organism
Bases: Base
Class definition for table organism.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
int
|
Primary key. |
name |
str
|
Name of the organism. |
tax_id |
Optional[int]
|
NCBI taxonomy identifier. |
wcvp_id |
Optional[int]
|
WCVP identifier. |
powo_id |
Optional[str]
|
POWO identifier. |
compounds |
list[Compound]
|
List of compounds associated with this organism. |
Source code in src/biokb_coconut/db/models.py
531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 | |
Synonym
Bases: Base
Class definition for table synonym.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
int
|
Primary key. |
name |
str
|
Unique name of the synonym. |
compounds |
list[Compound]
|
List of compounds associated with this synonym. |
Source code in src/biokb_coconut/db/models.py
501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 | |
TaxonomyName
Bases: Base
Class definition for table taxonomy_name. Name from NCBI taxonomy https://www.ncbi.nlm.nih.gov/taxonomys.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
int
|
Primary key. |
tax_id |
int
|
NCBI taxonomy Identifier. |
name |
str
|
Name associated with the tax_id. |
name_type |
str
|
Type of the name (e.g., scientific name, common name, synonym). |
Source code in src/biokb_coconut/db/models.py
622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 | |
WCVPPlant
Bases: Base
Class definition for table wcvp_plant. Plant names from World Checklist of Vascular Plants (WCVP).
Attributes:
| Name | Type | Description |
|---|---|---|
plant_name_id |
int
|
Primary key. |
taxon_name |
Optional[str]
|
Taxon name of the plant. |
accepted_plant_name_id |
Optional[int]
|
Accepted plant name identifier. |
powo_id |
Optional[str]
|
POWO identifier. |
Source code in src/biokb_coconut/db/models.py
651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 | |