Search in sources :

Example 1 with SequenceSimilarity

use of edu.sdsc.mmtf.spark.webfilters.SequenceSimilarity in project mmtf-spark by sbl-sdsc.

the class SequenceSimilarityDemo method main.

/**
 * @throws IOException
 */
public static void main(String[] args) throws IOException {
    SparkConf conf = new SparkConf().setMaster("local[*]").setAppName(SequenceSimilarityDemo.class.getSimpleName());
    JavaSparkContext sc = new JavaSparkContext(conf);
    String sequence = "NLVQFGVMIEKMTGKSALQYNDYGCYCGIGGSHWPVDQ";
    double eValueCutoff = 0.001;
    int sequenceIdentityCutoff = 40;
    boolean maskLowComplexity = true;
    // read PDB in MMTF format, split into polymer chains,
    // search by sequence similarity, and print sequences found
    MmtfReader.readReducedSequenceFile(sc).flatMapToPair(new StructureToPolymerChains(false, true)).filter(new SequenceSimilarity(sequence, SequenceSimilarity.BLAST, eValueCutoff, sequenceIdentityCutoff, maskLowComplexity)).foreach(t -> System.out.println(t._1 + ": " + t._2.getEntitySequence(0)));
    sc.close();
}
Also used : SequenceSimilarity(edu.sdsc.mmtf.spark.webfilters.SequenceSimilarity) StructureToPolymerChains(edu.sdsc.mmtf.spark.mappers.StructureToPolymerChains) JavaSparkContext(org.apache.spark.api.java.JavaSparkContext) SparkConf(org.apache.spark.SparkConf)

Aggregations

StructureToPolymerChains (edu.sdsc.mmtf.spark.mappers.StructureToPolymerChains)1 SequenceSimilarity (edu.sdsc.mmtf.spark.webfilters.SequenceSimilarity)1 SparkConf (org.apache.spark.SparkConf)1 JavaSparkContext (org.apache.spark.api.java.JavaSparkContext)1