fragment
GhostFragment
GhostFragment(guide_coords: ndarray, i_type: int, j_type: int, k_type: int, ijk_rmsd: float, aligned_fragment: Fragment)
Stores the mapping from a Fragment to a "paired" Fragment. Handles spatial manipulation for the mapped pair
Parameters:
-
guide_coords
(ndarray
) –The array of shape (3, 3) with the set of x, y, z coordinates to map this instance to the standard fragment reference frame at the origin
-
i_type
(int
) –The particular index which identifies the aligned fragment type, i.e. the aligned_fragment
-
j_type
(int
) –The particular index which identifies the paired fragment type, i.e. this instance
-
k_type
(int
) –The particular index which identifies the spatial orientation of the i and j fragment types
-
ijk_rmsd
(float
) –The root-mean-square deviation which applies to all members particular i,j,k index type
-
aligned_fragment
(Fragment
) –The Fragment instance which this instance is paired with
Source code in symdesign/structure/fragment/__init__.py
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
|
rmsd
instance-attribute
rmsd: float = ijk_rmsd
The deviation from the representative ghost fragment
aligned_fragment
instance-attribute
aligned_fragment: Fragment = aligned_fragment
The Fragment instance that this GhostFragment is aligned too. Must support .chain_id, .number, .index, .rotation, .translation, and .transformation attributes
type
property
type: int
The secondary structure of the Fragment
ijk
property
ijk: tuple[int, int, int]
The Fragment cluster index information
Returns:
-
tuple[int, int, int]
–I cluster index, J cluster index, K cluster index
aligned_chain_and_residue
property
aligned_chain_and_residue: tuple[str, int]
Return the Fragment identifiers that the GhostFragment was mapped to
Returns:
-
tuple[str, int]
–aligned chain_id, aligned residue_number
number
property
number: int
The Residue number of the aligned Fragment
index
property
index: int
The Residue index of the aligned Fragment
guide_coords
property
guide_coords: ndarray
Return the guide coordinates of the GhostFragment
rotation
property
rotation: ndarray
The rotation of the aligned Fragment from the Fragment Database
translation
property
translation: ndarray
The translation of the aligned Fragment from the Fragment Database
transformation
property
transformation: tuple[ndarray, ndarray]
The transformation of the aligned Fragment from the Fragment Database
Returns:
-
tuple[ndarray, ndarray]
–The rotation (3, 3) and the translation (3,)
representative
property
representative: 'structure.model.Model'
Access the Representative GhostFragment StructureBase
write
write(out_path: bytes | str = os.getcwd(), file_handle: IO = None, header: str = None, **kwargs) -> AnyStr | None
Write the GhostFragment to a file specified by out_path or with a passed file_handle
If a file_handle is passed, no header information will be written. Arguments are mutually exclusive
Parameters:
-
out_path
(bytes | str
, default:getcwd()
) –The location where the StructureBase object should be written to disk
-
file_handle
(IO
, default:None
) –Used to write to an open FileObject
-
header
(str
, default:None
) –A string that is desired at the top of the file
Other Parameters:
-
chain_id
–str = None - The chain ID to use
-
atom_offset
–int = 0 - How much to offset the atom number by. Default returns one-indexed
Returns:
-
AnyStr | None
–The name of the written file if out_path is used
Source code in symdesign/structure/fragment/__init__.py
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 |
|
Fragment
Fragment(fragment_type: int = None, fragment_db: FragmentDatabase = None, **kwargs)
Bases: ABC
Parameters:
-
fragment_type
(int
, default:None
) –The particular index for the class of fragment this instance belongs to
-
fragment_db
(FragmentDatabase
, default:None
) –The FragmentDatabase from where this instance was derived
-
**kwargs
–
Source code in symdesign/structure/fragment/__init__.py
202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 |
|
fragment_db
property
writable
fragment_db: FragmentDatabase
The FragmentDatabase that the Fragment was created from
frag_type
property
writable
frag_type: int | None
The secondary structure of the Fragment
aligned_chain_and_residue
property
aligned_chain_and_residue: tuple[str, int]
Return the Fragment identifiers that the Fragment was mapped to
Returns:
-
tuple[str, int]
–aligned chain_id, aligned residue_number
chain_id
abstractmethod
property
chain_id: str
Return the Fragment identifiers that the Fragment was mapped to
Returns:
-
str
–The aligned Residue.chain_id attribute
number
abstractmethod
property
number: int
Return the Fragment identifiers that the Fragment was mapped to
Returns:
-
int
–The aligned Residue.number attribute
index
abstractmethod
property
index: int
Return the Fragment identifiers that the Fragment was mapped to
Returns:
-
int
–The aligned Residue.index attribute
guide_coords
property
guide_coords: ndarray
Return the guide coordinates of the mapped Fragment
transformation
property
transformation: tuple[ndarray, ndarray]
The transformation of the Fragment from the FragmentDatabase to its current position
find_ghost_fragments
find_ghost_fragments(clash_tree: BinaryTreeType = None, clash_dist: float = 2.1) -> list[GhostFragment]
Find all the GhostFragments associated with the Fragment
Parameters:
-
clash_tree
(BinaryTreeType
, default:None
) –Allows clash prevention during search. Typical use is the backbone and CB atoms of the ContainsAtomsMixin that the Fragment is assigned
-
clash_dist
(float
, default:2.1
) –The distance to check for backbone clashes
Source code in symdesign/structure/fragment/__init__.py
301 302 303 304 305 306 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 333 334 335 336 337 338 339 340 341 342 343 344 345 |
|
get_ghost_fragments
get_ghost_fragments(**kwargs) -> list | list[GhostFragment]
Retrieve the GhostFragments associated with the Fragment. Will generate if none are available, otherwise, will return the already generated instances.
Optionally, check clashing with the original structure backbone by passing clash_tree
Other Parameters:
-
clash_tree
–BinaryTreeType = None - Allows clash prevention during search. Typical use is the backbone and CB coordinates of the ContainsAtomsMixin that the Fragment is assigned
-
clash_dist
–float = 2.1 - The distance to check for backbone clashes
Returns:
-
list | list[GhostFragment]
–The ghost fragments associated with the fragment
Source code in symdesign/structure/fragment/__init__.py
347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 |
|
MonoFragment
MonoFragment(residues: Sequence['structure.base.Residue'], **kwargs)
Bases: Fragment
Used to represent Fragment information when treated as a continuous Fragment of length fragment_length
**kwargs:
Source code in symdesign/structure/fragment/__init__.py
386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 |
|
chain_id
property
chain_id: str
The Residue chainID
number
property
number: int
The Residue number
index
property
index: int
Return the Fragment identifiers that the Fragment was mapped to
Returns:
-
int
–The aligned Residue.index attribute
ResidueFragment
ResidueFragment(**kwargs)
Bases: Fragment
, ABC
Represent Fragment information for a single Residue
Source code in symdesign/structure/fragment/__init__.py
465 466 |
|
backbone_coords
abstractmethod
property
backbone_coords: ndarray
transformation
property
transformation: tuple[ndarray, ndarray]
The transformation of the ResidueFragment from the FragmentDatabase to its current position
find_fragment_overlap
find_fragment_overlap(fragments1: Iterable[Fragment], fragments2: Sequence[Fragment], clash_coords: ndarray = None, min_match_value: float = 2.0, **kwargs) -> list[tuple[GhostFragment, Fragment, float]]
From two sets of Residues, score the fragment overlap according to Nanohedra's fragment matching
Parameters:
-
fragments1
(Iterable[Fragment]
) –The Fragment instances that will be used to search for GhostFragment instances
-
fragments2
(Sequence[Fragment]
) –The Fragment instances to pair against fragments1 GhostFragment instances
-
clash_coords
(ndarray
, default:None
) –The coordinates to use for checking for GhostFragment clashes
-
min_match_value
(float
, default:2.0
) –The minimum value which constitutes an acceptable fragment z_score
Returns:
-
list[tuple[GhostFragment, Fragment, float]]
–The GhostFragment, Fragment pairs, along with their match score
Source code in symdesign/structure/fragment/__init__.py
490 491 492 493 494 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 529 530 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 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 |
|
create_fragment_info_from_pairs
create_fragment_info_from_pairs(ghostfrag_frag_pairs: list[tuple[GhostFragment, Fragment, float]]) -> list[FragmentInfo]
From a ghost fragment/surface fragment pair and corresponding match score, return the pertinent interface information
Parameters:
-
ghostfrag_frag_pairs
(list[tuple[GhostFragment, Fragment, float]]
) –Observed ghost and surface fragment overlaps and their match score
Returns:
-
list[FragmentInfo]
–The formatted fragment information for each pair {'mapped': int, 'paired': int, 'match': float, 'cluster': tuple(int, int, int)}
Source code in symdesign/structure/fragment/__init__.py
599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 |
|