-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathGetAverageCalphaDist.java
More file actions
40 lines (32 loc) · 1.03 KB
/
GetAverageCalphaDist.java
File metadata and controls
40 lines (32 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package demo;
import org.rcsb.mmtf.spark.utils.SparkUtils;
import org.rcsb.mmtf.spark.data.StructureDataRDD;
/**
* Example of mapping the PDB to chains of just C-alpha coords.
* Calculate the mean C-alpha length in the PDB.
* @author Anthony Bradley
*
*/
public class GetAverageCalphaDist {
/**
* Example of mapping the PDB to chains of just C-alpha coords.
* Calculate the mean C-alpha length in the PDB.
* @param args
*/
public static void main(String[] args) {
// assumes that files are in installed in $HOME/mmtf/reduced/
String userHome = System.getProperty("user.home");
// Starter counter
Long startTime = System.currentTimeMillis();
Double meanCalphaLength =
new StructureDataRDD( userHome + "/mmtf/reduced")
.filterResolution(3.0)
.filterRfree(0.3)
.getCalpha()
.getLengthDist()
.mean();
System.out.println("\n"+meanCalphaLength+" is the mean C-alpha length in the PDB");
System.out.println("Found in "+(System.currentTimeMillis()-startTime)+" ms");
SparkUtils.shutdown();
}
}