Search in sources :

Example 1 with NotFilter

use of edu.sdsc.mmtf.spark.filters.NotFilter 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)

Example 2 with NotFilter

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

the class FilterProteinDnaComplexes method main.

public static void main(String[] args) throws FileNotFoundException {
    String path = MmtfReader.getMmtfReducedPath();
    SparkConf conf = new SparkConf().setMaster("local[*]").setAppName(FilterProteinDnaComplexes.class.getSimpleName());
    JavaSparkContext sc = new JavaSparkContext(conf);
    long count = MmtfReader.readSequenceFile(path, // read MMTF hadoop sequence file
    sc).filter(// retain pdb entries that contain L-peptide chains
    new ContainsLProteinChain()).filter(// retain pdb entries that contain L-Dna chains
    new ContainsDnaChain()).filter(// filter out an RNA containing entries
    new NotFilter(new ContainsRnaChain())).count();
    System.out.println("# L-peptide/DNA complexes: " + count);
    sc.close();
}
Also used : ContainsDnaChain(edu.sdsc.mmtf.spark.filters.ContainsDnaChain) ContainsRnaChain(edu.sdsc.mmtf.spark.filters.ContainsRnaChain) NotFilter(edu.sdsc.mmtf.spark.filters.NotFilter) JavaSparkContext(org.apache.spark.api.java.JavaSparkContext) SparkConf(org.apache.spark.SparkConf) ContainsLProteinChain(edu.sdsc.mmtf.spark.filters.ContainsLProteinChain)

Example 3 with NotFilter

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

the class NotFilterExample method main.

public static void main(String[] args) throws FileNotFoundException {
    String path = MmtfReader.getMmtfReducedPath();
    SparkConf conf = new SparkConf().setMaster("local[*]").setAppName(NotFilterExample.class.getSimpleName());
    JavaSparkContext sc = new JavaSparkContext(conf);
    long count = MmtfReader.readSequenceFile(path, // read MMTF hadoop sequence file
    sc).filter(// retain pdb entries that exclusively contain L-peptide chains
    new ContainsLProteinChain()).filter(// should not contain any DNA chains
    new NotFilter(new ContainsDnaChain())).count();
    System.out.println("# PDB entries with L-protein and without DNA chains: " + count);
    sc.close();
}
Also used : ContainsDnaChain(edu.sdsc.mmtf.spark.filters.ContainsDnaChain) NotFilter(edu.sdsc.mmtf.spark.filters.NotFilter) JavaSparkContext(org.apache.spark.api.java.JavaSparkContext) SparkConf(org.apache.spark.SparkConf) ContainsLProteinChain(edu.sdsc.mmtf.spark.filters.ContainsLProteinChain)

Aggregations

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