logger.info("Binary Interaction " + interaction.getId() + " : the method " + method + " has passed the rules"); passRules = true; logger.info("Binary Interaction " + interaction.getId() + " : the method " + method + " doesn't pass the rules and will be removed"); invalidIntactIds.addAll(validIntactIds);
fstream.write(Integer.toString(eI.getId())); fstream.write("-"); fstream.write(eI.getInteractorA());
@Override public boolean canExportEncoreInteraction(EncoreInteraction encore, ExportContext context) throws UniprotExportException { double score = FilterUtils.getMiClusterScoreFor(encore); if (score >= positive_export_threshold){ if (encore.getExperimentToDatabase() == null){ throw new UniprotExportException("The interaction " + encore.getId() + ":" + encore.getInteractorA() + "-" + encore.getInteractorB() +" doesn't have any references to IntAct."); } Set<String> intactInteractions = new HashSet<String>(); intactInteractions.addAll(encore.getExperimentToPubmed().keySet()); if (intactInteractions.isEmpty()){ throw new UniprotExportException("The interaction " + encore.getId() + ":" + encore.getInteractorA() + "-" + encore.getInteractorB() +" doesn't have any references to IntAct."); } for (String ac : intactInteractions){ if (!context.getSpokeExpandedInteractions().contains(ac)){ String type = context.getInteractionToMethod_type().get(ac).getType(); if (!type.equals(COLOCALIZATION)){ logger.info("The interaction " + encore.getId() + " passed the export rules with score = " + score); return true; } } } } return false; }
@Override public boolean canExportNegativeEncoreInteraction(EncoreInteraction encore, ExportContext context, ExportedClusteredInteractions positiveInteractions) throws UniprotExportException { boolean isElgibleForExport = ExporterUtils.isNegativeInteractionEligibleForUniprotExport(encore, positiveInteractions); if (isElgibleForExport){ double score = FilterUtils.getMiClusterScoreFor(encore); if (score >= negative_export_threshold){ if (encore.getExperimentToDatabase() == null){ throw new UniprotExportException("The interaction " + encore.getId() + ":" + encore.getInteractorA() + "-" + encore.getInteractorB() +" doesn't have any references to IntAct."); } Set<String> intactInteractions = new HashSet<String>(); intactInteractions.addAll(encore.getExperimentToPubmed().keySet()); if (intactInteractions.isEmpty()){ throw new UniprotExportException("The interaction " + encore.getId() + ":" + encore.getInteractorA() + "-" + encore.getInteractorB() +" doesn't have any references to IntAct."); } for (String ac : intactInteractions){ if (!context.getSpokeExpandedInteractions().contains(ac)){ String type = context.getInteractionToMethod_type().get(ac).getType(); if (!type.equals(COLOCALIZATION)){ logger.info("The negative interaction " + encore.getId() + " passed the export rules with score = " + score); return true; } } } } } return false; }
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; }
for(String expAc:experimentToDatabase.keySet()){ if(expAc == null || expAc.length()==0){ log.warn( "Could not process experimentAc ("+(expAc == null ? "null" : "'"+expAc+"'")+") of EncoreInteraction(id="+ encoreInteraction.getId()+") as it is null or empty " ); continue; // skip this experimentAC