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();
}
Aggregations