db
fragment_factory
module-attribute
fragment_factory: Annotated[FragmentDatabaseFactory, 'Calling this factory method returns the single instance of the FragmentDatabase class containing fragment information specified by the "source" keyword argument'] = FragmentDatabaseFactory()
Calling this factory method returns the single instance of the FragmentDatabase class containing fragment information specified by the "source" keyword argument
euler_factory
module-attribute
euler_factory: Annotated[EulerLookupFactory, 'Calling this factory method returns the single instance of the EulerLookup class'] = EulerLookupFactory()
Calling this factory method returns the single instance of the EulerLookup class
FragmentObservation
match
instance-attribute
match: float
The match of the entire fragment observation to the fragment cluster representative
weight
instance-attribute
weight: float
The contribution of the FragObservation to atomic interactions from the entire fragment observation
FragmentDatabase
FragmentDatabase(**kwargs)
Bases: FragmentInfo
Source code in symdesign/structure/fragment/db.py
78 79 80 81 82 83 84 85 86 87 |
|
calculate_match_metrics
calculate_match_metrics(fragment_matches: list[FragmentInfo]) -> dict[str, Any]
Return the various metrics calculated by overlapping fragments at the interface of two proteins
Parameters:
-
fragment_matches
(list[FragmentInfo]
) –[{'mapped': entity1_index, 'paired': entity2_index, 'cluster': tuple(int, int, int), 'match': score_term}, ...]
Returns: {'mapped': {'center': {'indices': (set[int]), 'score': (float),}, 'total': {'indices': (set[int]), 'score': (float),}, 'match_scores': {residue number(int): (list[score (float)]), ...}, 'index_count': {index (int): count (int), ...}, 'multiple_ratio': (float)} 'paired': {'center': , 'total': , 'match_scores': , 'index_count': , 'multiple_ratio': }, 'total': {'center': {'score': , 'number': }, 'total': {'score': , 'number': }, 'index_count': , 'multiple_ratio': , 'observations': (int)} }
Source code in symdesign/structure/fragment/db.py
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 295 296 297 298 299 300 301 302 303 304 305 |
|
format_fragment_metrics
staticmethod
format_fragment_metrics(metrics: dict) -> dict
For a set of fragment metrics, return the formatted total fragment metrics
Parameters:
-
metrics
(dict
) –
Returns: {center_indices, total_indices, nanohedra_score, nanohedra_score_center, multiple_fragment_ratio, number_residues_fragment_total, number_residues_fragment_center, number_fragments, percent_fragment_helix, percent_fragment_strand, percent_fragment_coil}
Source code in symdesign/structure/fragment/db.py
307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 |
|
FragmentDatabaseFactory
FragmentDatabaseFactory(**kwargs)
Return a FragmentDatabase instance by calling the Factory instance with the FragmentDatabase source name
Handles creation and allotment to other processes by saving expensive memory load of multiple instances and allocating a shared pointer to the named FragmentDatabase
Source code in symdesign/structure/fragment/db.py
347 348 |
|
__call__
__call__(source: str = putils.biological_interfaces, token: int = None, **kwargs) -> FragmentDatabase | None
Return the specified FragmentDatabase object singleton
Parameters:
-
source
(str
, default:biological_interfaces
) –The FragmentDatabase source name
-
token
(int
, default:None
) –Provide the initialization token to skip construction
Returns: The instance of the specified FragmentDatabase
Source code in symdesign/structure/fragment/db.py
354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 |
|
get
get(**kwargs) -> FragmentDatabase
Return the specified FragmentDatabase object singleton
Other Parameters:
-
source
–str = putils.biological_interfaces - The FragmentDatabase source name
-
token
–int = None - Provide the initialization token to skip construction
Returns:
-
FragmentDatabase
–The instance of the specified FragmentDatabase
Source code in symdesign/structure/fragment/db.py
386 387 388 389 390 391 392 393 394 395 396 |
|
TransformHasher
TransformHasher(max_width: float, translation_bin_width: float = 0.2, rotation_bin_width: float = 0.5, dimensions: int = 6)
Constructs a 6D mapping of transformation bins
Parameters:
-
max_width
(float
) –The radius of a box to define the boundaries of the transformation bin space
-
translation_bin_width
(float
, default:0.2
) –The size of the translation bins
-
rotation_bin_width
(float
, default:0.5
) –The size of the rotation bins
-
dimensions
(int
, default:6
) –The number of dimensions to construct
Source code in symdesign/structure/fragment/db.py
428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 |
|
transforms_to_bin_integers
transforms_to_bin_integers(rotations: ndarray, translations: ndarray) -> ndarray
From transformations consisting of stacked rotations and translations, identify the bin that each transformation falls into along each transformation dimension
Parameters:
-
rotations
(ndarray
) –Array with shape (N, 3, 3) where each N is the rotation paired with the translation N
-
translations
(ndarray
) –Array with shape (N, 3) where each N is the translation paired with the rotation N
Returns: Array with shape (number_of_transforms, dimensions) representing the unique bins along each dimension, that each transform occupies
Source code in symdesign/structure/fragment/db.py
495 496 497 498 499 500 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 |
|
hash_bin_integers
hash_bin_integers(bin_integers: ndarray) -> ndarray
Parameters:
-
bin_integers
(ndarray
) –Array with shape (number_of_transforms, dimensions) representing the unique bins along each dimension, that each transform occupies
Returns: An integer hashing the binned integers which describe a position in the described 3D space
Source code in symdesign/structure/fragment/db.py
530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 |
|
transforms_to_hash
transforms_to_hash(rotations: ndarray, translations: ndarray) -> ndarray
From pairs of rotations and translations, create a hash to describe the complete transformation
Parameters:
-
rotations
(ndarray
) –Array with shape (N, 3, 3) where each N is the rotation paired with the translation N
-
translations
(ndarray
) –Array with shape (N, 3) where each N is the translation paired with the rotation N
Returns: An integer hashing the transforms which relates to distinct orientational offset in the described space
Source code in symdesign/structure/fragment/db.py
548 549 550 551 552 553 554 555 556 557 |
|
hash_to_bins
hash_to_bins(index: int | ndarray) -> ndarray
From a hash or multiple hashes describing a transformation, return the bins that that hash belongs too
Parameters:
-
index
(int | ndarray
) –The hash(es) to calculate bins for
Returns: Array with shape (number_of_transforms, dimensions) representing the unique bins along each dimension, that each hash maps to the transformation space
Source code in symdesign/structure/fragment/db.py
559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 |
|
bins_to_transform
bins_to_transform(bins: ndarray) -> tuple[ndarray, ndarray]
Parameters:
-
bins
(ndarray
) –The integers which express particular bins in the transformation space
Returns: The tuple of stacked rotations and stacked translations
Source code in symdesign/structure/fragment/db.py
581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 |
|
hash_to_transforms
hash_to_transforms(index: int | ndarray) -> ndarray
From a hash or multiple hashes describing a transformation, return the bins that that hash belongs too
Parameters:
-
index
(int | ndarray
) –The hash(es) to calculate bins for
Returns: Array with shape (number_of_transforms, dimensions) representing the unique bins along each dimension, that each hash maps to the transformation space
Source code in symdesign/structure/fragment/db.py
600 601 602 603 604 605 606 607 608 609 610 611 |
|
EulerLookup
EulerLookup(scale: float = 3.0)
Handle the lookup of Euler angles which are roughly segregated into similar rotational bins
Parameters:
-
scale
(float
, default:3.0
) –The size of the vectors used to describe the basis vectors
Source code in symdesign/structure/fragment/db.py
618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 |
|
eul_lookup_40
instance-attribute
eul_lookup_40 = load(binary_lookup_table_path)['a']
Indicates whether two sets of triplet integer values for each Euler angle are within an acceptable angular offset. Acceptable offset is approximately +/- 40 degrees, or +/- 3 integers in one of the rotation angles and a couple of integers in another i.e. eul_lookup_40[1,5,1,1,8,1] -> True eul_lookup_40[1,5,1,1,9,1] -> False eul_lookup_40[1,5,1,1,7,4] -> True KM doesn't completely know how Todd made these
get_eulint_from_guides_as_array
get_eulint_from_guides_as_array(guide_coords: ndarray) -> ndarray
Take a set of guide atoms (3 xyz positions) and return integer indices for the euler angles describing the orientations of the axes they form. Note that the positions are in a 3D array. Each guide_coords[i,:,:] is a 3x3 array with the vectors stored in columns, i.e. one vector is in [i,:,j]. Use known scale value to normalize, to save repeated sqrt calculations
Source code in symdesign/structure/fragment/db.py
640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 |
|
get_eulint_from_guides
get_eulint_from_guides(guide_coords: ndarray) -> tuple[ndarray, ndarray, ndarray]
Take a set of guide atoms (3 xyz positions) and return integer indices for the euler angles describing the orientations of the axes they form. Note that the positions are in a 3D array. Each guide_ats[i,:,:] is a 3x3 array with the vectors stored in columns, i.e. one vector is in [i,:,j]. Use known scale value to normalize, to save repeated sqrt calculations
Source code in symdesign/structure/fragment/db.py
677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 |
|
lookup_by_euler_integers
lookup_by_euler_integers(*args: ndarray) -> tuple[ndarray, ndarray]
Returns a tuple with the index of the first fragment and second fragment where they overlap
Source code in symdesign/structure/fragment/db.py
724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 |
|
lookup_by_euler_integers_as_array
lookup_by_euler_integers_as_array(eulintarray1: ndarray, eulintarray2: ndarray) -> tuple[ndarray, ndarray]
Returns a tuple with the index of the first fragment and second fragment where they overlap
Source code in symdesign/structure/fragment/db.py
753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 |
|
check_lookup_table
check_lookup_table(guide_coords1: ndarray, guide_coords2: ndarray) -> tuple[ndarray, ndarray]
Returns a tuple with the index of the first fragment and second fragment where they overlap
Source code in symdesign/structure/fragment/db.py
793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 |
|
EulerLookupFactory
EulerLookupFactory(**kwargs)
Return an EulerLookup instance by calling the Factory instance
Handles creation and allotment to other processes by saving expensive memory load of multiple instances and allocating a shared pointer
Source code in symdesign/structure/fragment/db.py
928 929 |
|
__call__
__call__(**kwargs) -> EulerLookup
Return the specified EulerLookup object singleton
Returns:
-
EulerLookup
–The instance of the specified EulerLookup
Source code in symdesign/structure/fragment/db.py
935 936 937 938 939 940 941 942 943 944 945 946 947 948 |
|
get
get(**kwargs) -> EulerLookup
Return the specified EulerLookup object singleton
Returns:
-
EulerLookup
–The instance of the specified EulerLookup
Source code in symdesign/structure/fragment/db.py
950 951 952 953 954 955 956 |
|
nanohedra_fragment_match_score
nanohedra_fragment_match_score(per_residue_match_scores: Iterable[Iterable[float]]) -> float
Calculate the Nanohedra score from a dictionary with the 'center' residues and 'match_scores'
Parameters:
-
per_residue_match_scores
(Iterable[Iterable[float]]
) –The residue mapped to its match score measurements
Returns: The Nanohedra score
Source code in symdesign/structure/fragment/db.py
407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 |
|