Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update crystal-contacts.md
  • Loading branch information
josemduarte committed Dec 9, 2014
commit e6df557832ec2b142b40a2105eaaedbb3698b5e8
13 changes: 13 additions & 0 deletions structure/crystal-contacts.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,17 @@ The algorithm to find all unique interfaces in the crystal works roughly like th

See [DemoCrystalInterfaces](https://github.com/biojava/biojava/blob/master/biojava3-structure/src/main/java/demo/DemoCrystalInterfaces.java) for a fully working demo of the example above.

## Clustering the interfaces
One can also cluster the interfaces based on their similarity. The similarity is measured through contact overlap: number of common contacts over average number of contact in both chains. The clustering can be done as following:

```java
List<StructureInterfaceCluster> clusters = interfaces.getClusters();
for (StructureInterfaceCluster cluster:clusters) {
System.out.print("Cluster "+cluster.getId()+" members: ");
for (StructureInterface member:cluster.getMembers()) {
System.out.print(member.getId()+" ");
}
System.out.println();
}
```