-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathSimpleExample.java
More file actions
44 lines (36 loc) · 1.19 KB
/
SimpleExample.java
File metadata and controls
44 lines (36 loc) · 1.19 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
41
42
43
44
package demo;
import org.rcsb.mmtf.spark.utils.SparkUtils;
import org.rcsb.mmtf.spark.data.StructureDataRDD;
/**
* A very simple example reading the PDB and finding the number
* of entries in the PDB with resolution better than 3.0 Angstrom
* and R-free better than 0.3.
* @author Anthony Bradley
*
*/
public class SimpleExample {
/**
* A very simple example reading the PDB and finding the number
* of entries in the PDB with resolution better than 3.0 Angstrom
* and R-free better than 0.3.
* @param args the input list of arguments.
*/
public static void main(String[] args) {
// Specify your limits for R-factor and Resolution
double maxResolution = 3.0;
double maxRfree = 0.3;
// Starter counter
Long startTime = System.currentTimeMillis();
// The actual code
Long numEntries = new StructureDataRDD()
.filterResolution(maxResolution)
.filterRfree(maxRfree)
.size();
// Print out the results
System.out.println("\n"+numEntries+" found with resolution better than "+maxResolution+
" and R-free less than "+maxRfree);
System.out.println("Found in "+(System.currentTimeMillis()-startTime)+" ms");
// Gently settle down
SparkUtils.shutdown();
}
}