Search in sources :

Example 1 with StructureToBioassembly2

use of edu.sdsc.mmtf.spark.mappers.StructureToBioassembly2 in project mmtf-spark by sbl-sdsc.

the class MapToBioAssembly2 method main.

public static void main(String[] args) throws FileNotFoundException, IOException {
    SparkConf conf = new SparkConf().setMaster("local[*]").setAppName(CustomReportDemo.class.getSimpleName());
    JavaSparkContext sc = new JavaSparkContext(conf);
    long start = System.nanoTime();
    // List<String> pdbIds = Arrays.asList("1HV4");
    // List<String> pdbIds = Arrays.asList("2HHB");
    // JavaPairRDD<String, StructureDataInterface> pdb = MmtfReader
    // .downloadFullMmtfFiles(pdbIds, sc);
    JavaPairRDD<String, StructureDataInterface> pdb = MmtfReader.readFullSequenceFile(sc).filter(new Pisces(20, 3.0));
    // System.out.println("**** AU ****");
    // pdb.foreach(t -> TraverseStructureHierarchy.printStructureData(t._2));
    JavaPairRDD<String, StructureDataInterface> bioassemblies = pdb.flatMapToPair(new StructureToBioassembly2());
    System.out.println("Number of bioassemblies: " + bioassemblies.count());
    long end = System.nanoTime();
    System.out.println("time: " + (end - start) / 1E9 + " sec.");
    // System.out.println("**** BA ****");
    // bioassemblies.foreach(t -> TraverseStructureHierarchy.printStructureData(t._2));
    // bioassemblies.foreach(t -> TraverseStructureHierarchy.printChainEntityGroupAtomInfo(t._2));
    sc.close();
}
Also used : Pisces(edu.sdsc.mmtf.spark.webfilters.Pisces) JavaSparkContext(org.apache.spark.api.java.JavaSparkContext) StructureDataInterface(org.rcsb.mmtf.api.StructureDataInterface) StructureToBioassembly2(edu.sdsc.mmtf.spark.mappers.StructureToBioassembly2) CustomReportDemo(edu.sdsc.mmtf.spark.datasets.demos.CustomReportDemo) SparkConf(org.apache.spark.SparkConf)

Aggregations

CustomReportDemo (edu.sdsc.mmtf.spark.datasets.demos.CustomReportDemo)1 StructureToBioassembly2 (edu.sdsc.mmtf.spark.mappers.StructureToBioassembly2)1 Pisces (edu.sdsc.mmtf.spark.webfilters.Pisces)1 SparkConf (org.apache.spark.SparkConf)1 JavaSparkContext (org.apache.spark.api.java.JavaSparkContext)1 StructureDataInterface (org.rcsb.mmtf.api.StructureDataInterface)1