@Override public void runService() { if (this.miscore == null){ this.miscore = new MIScore(); } runService(this.miscore); }
public void saveScores(String fileName){ runService();
public double[] getScores(){ if(this.getInteractionMapping() == null){ runService(); } int scoreListSize = this.getInteractionMapping().size(); double [] scores = new double[scoreListSize]; int i = 0; for(EncoreInteraction eI:this.getInteractionMapping().values()){ List<Confidence> confidenceValues = eI.getConfidenceValues(); Double score = null; for(Confidence confidenceValue:confidenceValues){ if(confidenceValue.getType().equalsIgnoreCase(getScoreName())){ score = Double.parseDouble(confidenceValue.getValue()); } } if(score == null){ logger.error("No score for this interaction: " + eI.getId()); } scores[i] = score; i++; } return scores; }
/** * Execute takslet step * @param arg0 * @param arg1 * @return * @throws Exception */ public RepeatStatus execute(StepContribution arg0, ChunkContext arg1) throws Exception { // do some checking there this.checkOutputMitabFile(); this.checkInputMitabFile(); /* Get mitab file */ PsimiTabReader mitabReader = new PsimiTabReader(); InteractionClusterScore interactionClusterScore = new InteractionClusterScore(); interactionClusterScore.setScoreName(scoreName); /* Get binaryInteractions from mitab file */ interactionClusterScore.setBinaryInteractionIterator(mitabReader.iterate(mitabInputFile)); /* Run cluster using list of binary interactions as input */ interactionClusterScore.setMappingIdDbNames(databaseToCluster); interactionClusterScore.runService(); /* Save mitab clustered data in files */ saveMitabOutputFile(interactionClusterScore); /* task finsihed */ return RepeatStatus.FINISHED; }