/** * This method is called to execute the action that the StepInstance must perform. * * @param stepInstance containing the parameters for executing. * @param temporaryFileDirectory * @throws Exception could be anything thrown by the execute method. */ @Override public void execute(StepInstance stepInstance, String temporaryFileDirectory) { // Retrieve raw results for protein range. Map<String, RawProtein<PfamHmmer3RawMatch>> rawMatches = rawMatchDAO.getRawMatchesForProteinIdsInRange( stepInstance.getBottomProtein(), stepInstance.getTopProtein(), getSignatureLibraryRelease()); if (LOGGER.isDebugEnabled()) { LOGGER.debug("PfamA: Retrieved " + rawMatches.size() + " proteins to post-process."); int matchCount = 0; for (final RawProtein rawProtein : rawMatches.values()) { matchCount += rawProtein.getMatches().size(); } LOGGER.debug("PfamA: A total of " + matchCount + " raw matches."); } // Post process try { Map<String, RawProtein<PfamHmmer3RawMatch>> filteredMatches = getPostProcessor().process(rawMatches); if (LOGGER.isDebugEnabled()) { LOGGER.debug( "PfamA: " + filteredMatches.size() + " proteins passed through post processing."); int matchCount = 0; for (final RawProtein rawProtein : filteredMatches.values()) { matchCount += rawProtein.getMatches().size(); } LOGGER.debug("PfamA: A total of " + matchCount + " matches PASSED."); } filteredMatchDAO.persist(filteredMatches.values()); } catch (IOException e) { throw new IllegalStateException( "IOException thrown when attempting to post process filtered matches.", e); } }