public void process(Set<RawProtein<PIRSFHmmer2RawMatch>> blastedRawProteins,Map<String,Integer> blastResultMap,String blastedMatchesFilePath) throws IOException {
  Map<String,Integer> sfTbMap=sfTbFileParser.parse(sfTbFileResource);
  Map<String,PIRSFHmmer2RawMatch> blastedProteinIdBestMatchMap=new HashMap<String,PIRSFHmmer2RawMatch>();
  for (  RawProtein<PIRSFHmmer2RawMatch> protein : blastedRawProteins) {
    String proteinId=protein.getProteinIdentifier();
    Collection<PIRSFHmmer2RawMatch> bestMatches=protein.getMatches();
    if (bestMatches == null || bestMatches.size() != 1) {
      LOGGER.warn("Protein Id: " + proteinId + " does not have 1 'best' match - ignoring");
    }
 else {
      Iterator<PIRSFHmmer2RawMatch> i=bestMatches.iterator();
      if (!i.hasNext()) {
        LOGGER.warn("Protein Id: " + proteinId + " does not have 1 'best' match - ignoring");
      }
      PIRSFHmmer2RawMatch bestMatch=i.next();
      String modelId=bestMatch.getModelId();
      modelId=modelId.substring(3);
      String key=proteinId + '-' + modelId;
      if (blastResultMap.containsKey(key)) {
        if (checkBlastCriterion(sfTbMap,blastResultMap,key)) {
          if (blastedProteinIdBestMatchMap.containsKey(String.valueOf(proteinId))) {
            LOGGER.warn("Protein Id: " + proteinId + ", model Id: "+ modelId+ " already present in passed blasted proteins map - ignored");
          }
          blastedProteinIdBestMatchMap.put(proteinId,bestMatch);
        }
      }
    }
  }
  PirsfFileUtil.writeProteinBestMatchesToFile(blastedMatchesFilePath,blastedProteinIdBestMatchMap);
}

public void process ( Set < RawProtein < PIRSFHmmer2RawMatch > > blastedRawProteins , Map < String , Integer > blastResultMap , String blastedMatchesFilePath ) throws IOException { Map < String , Integer > sfTbMap = sfTbFileParser . parse ( sfTbFileResource ) ; Map < String , PIRSFHmmer2RawMatch > blastedProteinIdBestMatchMap = new HashMap < String , PIRSFHmmer2RawMatch > ( ) ; for ( RawProtein < PIRSFHmmer2RawMatch > protein : blastedRawProteins ) { String proteinId = protein . getProteinIdentifier ( ) ; Collection < PIRSFHmmer2RawMatch > bestMatches = protein . getMatches ( ) ; if ( bestMatches == null || bestMatches . size ( ) != 1 ) { LOGGER . warn ( "Protein Id: " + proteinId + " does not have 1 'best' match - ignoring" ) ; } else { Iterator < PIRSFHmmer2RawMatch > i = bestMatches . iterator ( ) ; if ( ! i . hasNext ( ) ) { LOGGER . warn ( "Protein Id: " + proteinId + " does not have 1 'best' match - ignoring" ) ; } PIRSFHmmer2RawMatch bestMatch = i . next ( ) ; String modelId = bestMatch . getModelId ( ) ; modelId = modelId . substring ( 3 ) ; String key = proteinId + '-' + modelId ; if ( blastResultMap . containsKey ( key ) ) { if ( checkBlastCriterion ( sfTbMap , blastResultMap , key ) ) { if ( blastedProteinIdBestMatchMap . containsKey ( String . valueOf ( proteinId ) ) ) { LOGGER . warn ( "Protein Id: " + proteinId + ", model Id: " + modelId + " already present in passed blasted proteins map - ignored" ) ; } blastedProteinIdBestMatchMap . put ( proteinId , bestMatch ) ; } } } } PirsfFileUtil . writeProteinBestMatchesToFile ( blastedMatchesFilePath , blastedProteinIdBestMatchMap ) ; }
perform post processing , using blast output results to confirm the best match .
