Search in sources :

Example 1 with ContainsDSaccharideChain

use of edu.sdsc.mmtf.spark.filters.ContainsDSaccharideChain in project mmtf-spark by sbl-sdsc.

the class FilterByPolymerChainType method main.

public static void main(String[] args) throws FileNotFoundException {
    String path = MmtfReader.getMmtfReducedPath();
    SparkConf conf = new SparkConf().setMaster("local[*]").setAppName(FilterByPolymerChainType.class.getSimpleName());
    JavaSparkContext sc = new JavaSparkContext(conf);
    long count = MmtfReader.readSequenceFile(path, // read MMTF hadoop sequence file
    sc).filter(new ContainsPolymerChainType(ContainsPolymerChainType.DNA_LINKING, ContainsPolymerChainType.RNA_LINKING)).filter(new NotFilter(new ContainsLProteinChain())).filter(new NotFilter(new ContainsDSaccharideChain())).count();
    System.out.println("# pure DNA and RNA entries: " + count);
    sc.close();
}
Also used : ContainsPolymerChainType(edu.sdsc.mmtf.spark.filters.ContainsPolymerChainType) NotFilter(edu.sdsc.mmtf.spark.filters.NotFilter) JavaSparkContext(org.apache.spark.api.java.JavaSparkContext) ContainsDSaccharideChain(edu.sdsc.mmtf.spark.filters.ContainsDSaccharideChain) SparkConf(org.apache.spark.SparkConf) ContainsLProteinChain(edu.sdsc.mmtf.spark.filters.ContainsLProteinChain)

Aggregations

ContainsDSaccharideChain (edu.sdsc.mmtf.spark.filters.ContainsDSaccharideChain)1 ContainsLProteinChain (edu.sdsc.mmtf.spark.filters.ContainsLProteinChain)1 ContainsPolymerChainType (edu.sdsc.mmtf.spark.filters.ContainsPolymerChainType)1 NotFilter (edu.sdsc.mmtf.spark.filters.NotFilter)1 SparkConf (org.apache.spark.SparkConf)1 JavaSparkContext (org.apache.spark.api.java.JavaSparkContext)1