cluster
pose_pair_rmsd
pose_pair_rmsd(pose1: PoseJob, pose2: PoseJob) -> float
Calculate the rmsd between pairs of Poses using CB coordinates. Must be the same length pose
Parameters:
-
pose1
(PoseJob
) –First PoseJob object
-
pose2
(PoseJob
) –Second PoseJob object
Returns: RMSD value
Source code in symdesign/protocols/cluster.py
166 167 168 169 170 171 172 173 174 175 176 177 |
|
pose_pair_by_rmsd
pose_pair_by_rmsd(compositions: Iterable[Sequence[PoseJob]]) -> dict[str | PoseJob, list[str | PoseJob]]
Perform rmsd comparison for all compositions of PoseJob instances
Parameters:
-
compositions
(Iterable[Sequence[PoseJob]]
) –Groups of PoseJob instances that should be measured against one another pairwise
Returns: {PoseJob representative: [PoseJob members], ... }
Source code in symdesign/protocols/cluster.py
180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
ialign
ialign(*pdb_files: AnyStr, chain1: str = None, chain2: str = None, out_path: AnyStr = os.path.join(os.getcwd(), 'ialign')) -> float
Run non-sequential iAlign on two .pdb files
Parameters:
-
pdb_files
(AnyStr
, default:()
) – -
#
(pdb_file1
) – -
#
(pdb_file2
) – -
chain1
(str
, default:None
) – -
chain2
(str
, default:None
) – -
out_path
(AnyStr
, default:join(getcwd(), 'ialign')
) –The path to write iAlign results to
Returns: The IS score from Mu & Skolnic 2010
Source code in symdesign/protocols/cluster.py
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 |
|
cluster_poses_by_value
cluster_poses_by_value(identifier_pairs: Iterable[tuple[Any, Any]], values: Iterable[float], epsilon: float = 1.0) -> dict[str | PoseJob, list[str | PoseJob]]
Take pairs of identifiers and a precomputed distance metric (such as RMSD) and cluster using DBSCAN algorithm
Parameters:
-
identifier_pairs
(Iterable[tuple[Any, Any]]
) –The identifiers for each pair measurement
-
values
(Iterable[float]
) –The corresponding measurement values for each pair of identifiers
-
epsilon
(float
, default:1.0
) –The parameter for DBSCAN to influence the spread of clusters, needs to be tuned for measurement values
Returns: {PoseJob representative: [PoseJob members], ... }
Source code in symdesign/protocols/cluster.py
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 306 307 308 309 |
|
apply_transform_groups_to_guide_coordinates
apply_transform_groups_to_guide_coordinates(*transforms: tuple[dict[str:ndarray]]) -> list[ndarray]
For each incoming transformation, transform guide coordinates according to the specified transformations
Parameters:
-
transforms
(tuple[dict[str:ndarray]]
, default:()
) –The individual transformation groups that should be applied to a guide coordinate
Returns: Guide coordinates transformed for each passed transform in each passed transform group
Source code in symdesign/protocols/cluster.py
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 346 347 348 |
|
cluster_transformation_pairs
cluster_transformation_pairs(*transforms: tuple[dict[str, ndarray]], distance: float = 1.0, minimum_members: int = 2) -> tuple[NearestNeighbors, DBSCAN]
Cluster a group of transformation parameters sets to find those which occupy essentially the same space
Parameters:
-
transforms
(tuple[dict[str, ndarray]]
, default:()
) –Group containing multiple sets of transformation operations where each transformation operation set takes the form {'rotation': rot_array, 'translation': tx_array, 'rotation2': rot2_array, 'translation2': tx2_array}
-
distance
(float
, default:1.0
) –The distance to query neighbors in transformational space
-
minimum_members
(int
, default:2
) –The minimum number of members in each cluster
Returns: The sklearn tree with the calculated nearest neighbors, the DBSCAN clustering object Representative indices, DBSCAN cluster membership indices
Source code in symdesign/protocols/cluster.py
352 353 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 385 386 387 388 |
|
find_cluster_representatives
find_cluster_representatives(transform_tree: NearestNeighbors, cluster: DBSCAN) -> tuple[list[int], ndarray]
Return the cluster representative indices and the cluster membership identity for all member data
Parameters:
-
transform_tree
(NearestNeighbors
) –The sklearn tree with the calculated nearest neighbors
-
cluster
(DBSCAN
) –The DBSCAN clustering object
Returns: The list of representative indices, array of all indices membership
Source code in symdesign/protocols/cluster.py
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 |
|
cluster_pose_by_transformations
cluster_pose_by_transformations(compositions: list[PoseJob], **kwargs) -> dict[str | PoseJob, list[str | PoseJob]]
From a group of poses with matching protein composition, cluster the designs according to transformational parameters to identify the unique poses in each composition
Parameters:
-
compositions
(list[PoseJob]
) –The group of PoseJob objects to pull transformation data from
Other Parameters:
-
distance
–float = 1. - The distance to query neighbors in transformational space
-
minimum_members
–int = 2 - The minimum number of members in each cluster
Returns:
-
dict[str | PoseJob, list[str | PoseJob]]
–Cluster with representative pose as the key and matching poses as the values
Source code in symdesign/protocols/cluster.py
424 425 426 427 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 |
|
cluster_by_transformations
cluster_by_transformations(*transforms: tuple[dict[str, ndarray]], values: list[Any] = None, **kwargs) -> dict[Any, list[Any]]
From a set of objects with associated transformational parameters, identify and cluster the unique objects by representatives and members
Parameters:
-
transforms
(tuple[dict[str, ndarray]]
, default:()
) –Group containing multiple sets of transformation operations where each transformation operation set takes the form {'rotation': rot_array, 'translation': tx_array, 'rotation2': rot2_array, 'translation2': tx2_array}
-
values
(list[Any]
, default:None
) –The group of objects to cluster
Other Parameters:
-
distance
–float = 1. - The distance to query neighbors in transformational space
-
minimum_members
–int = 2 - The minimum number of members in each cluster
Returns:
-
dict[Any, list[Any]]
–Clustered objects with representative as the key and members as the values
Source code in symdesign/protocols/cluster.py
470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 |
|
group_compositions
group_compositions(pose_jobs: list[PoseJob]) -> dict[tuple[str, ...], list[PoseJob]]
From a set of DesignDirectories, find all the compositions and group together
Parameters:
-
pose_jobs
(list[PoseJob]
) –The PoseJob to group according to composition
Returns: List of similarly named PoseJob mapped to their name
Source code in symdesign/protocols/cluster.py
507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 |
|
invert_cluster_map
invert_cluster_map(cluster_map: dict[Any, list[Any]])
Return an inverted cluster map where the cluster members map to the representative
Parameters:
-
cluster_map
(dict[Any, list[Any]]
) –The standard pose_cluster_map format
Returns: An inverted cluster_map where the members are keys and the representative is the value
Source code in symdesign/protocols/cluster.py
532 533 534 535 536 537 538 539 540 541 542 543 544 |
|