Search in sources :

Example 1 with StructureToBioassembly

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

the class MapToBioAssembly method main.

public static void main(String[] args) {
    SparkConf conf = new SparkConf().setMaster("local[*]").setAppName(CustomReportDemo.class.getSimpleName());
    JavaSparkContext sc = new JavaSparkContext(conf);
    List<String> pdbIds = Arrays.asList("1HV4");
    JavaPairRDD<String, StructureDataInterface> bioassemblies = MmtfReader.downloadFullMmtfFiles(pdbIds, sc).flatMapToPair(new StructureToBioassembly());
    System.out.println("Number of bioassemblies for 1HV4: " + bioassemblies.count());
    sc.close();
}
Also used : StructureToBioassembly(edu.sdsc.mmtf.spark.mappers.StructureToBioassembly) JavaSparkContext(org.apache.spark.api.java.JavaSparkContext) StructureDataInterface(org.rcsb.mmtf.api.StructureDataInterface) CustomReportDemo(edu.sdsc.mmtf.spark.datasets.demos.CustomReportDemo) SparkConf(org.apache.spark.SparkConf)

Example 2 with StructureToBioassembly

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

the class MapToProteinDimers method main.

public static void main(String[] args) {
    SparkConf conf = new SparkConf().setMaster("local[*]").setAppName(MapToProteinDimers.class.getSimpleName());
    JavaSparkContext sc = new JavaSparkContext(conf);
    // single protein chain 5IBZ
    List<String> pdbIds = Arrays.asList("5IBZ");
    JavaPairRDD<String, StructureDataInterface> pdb = MmtfReader.downloadFullMmtfFiles(pdbIds, sc);
    // if distance between C-beta atoms is less than the cutoff distance, two chains are considered in contact
    double cutoffDistance = 8;
    // minimum number of contacts to qualify as an interaction
    int minContacts = 20;
    pdb = // convert to bioassembly (homotetramer with D2 symmetry)
    pdb.flatMapToPair(new StructureToBioassembly()).flatMapToPair(// find all dimers with in bioassembly
    new StructureToProteinDimers(cutoffDistance, minContacts));
    System.out.println("Number of dimers in 5IBZ bioassembly: " + pdb.count());
    sc.close();
}
Also used : StructureToBioassembly(edu.sdsc.mmtf.spark.mappers.StructureToBioassembly) JavaSparkContext(org.apache.spark.api.java.JavaSparkContext) StructureDataInterface(org.rcsb.mmtf.api.StructureDataInterface) SparkConf(org.apache.spark.SparkConf) StructureToProteinDimers(edu.sdsc.mmtf.spark.mappers.StructureToProteinDimers)

Aggregations

StructureToBioassembly (edu.sdsc.mmtf.spark.mappers.StructureToBioassembly)2 SparkConf (org.apache.spark.SparkConf)2 JavaSparkContext (org.apache.spark.api.java.JavaSparkContext)2 StructureDataInterface (org.rcsb.mmtf.api.StructureDataInterface)2 CustomReportDemo (edu.sdsc.mmtf.spark.datasets.demos.CustomReportDemo)1 StructureToProteinDimers (edu.sdsc.mmtf.spark.mappers.StructureToProteinDimers)1