public Map<String, List<String>> getTypeToPubmed() { Map<String, List<String>> typeToPubmed = new HashMap<String, List<String>>(); for (Map.Entry<MethodTypePair, List<String>> entry : methodTypePairListMap.entrySet()){ MethodTypePair pair = entry.getKey(); if (typeToPubmed.containsKey(pair.getType()) && pair.getType() != null){ typeToPubmed.get(pair.getType()).addAll(entry.getValue()); } else { if (pair.getType() != null){ typeToPubmed.put(pair.getType(), entry.getValue()); } } } return typeToPubmed; } }
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } MethodTypePair pair2 = (MethodTypePair) o; if ((method == null && pair2.getMethod() != null) || (method != null && pair2.getMethod() == null)){ return false; } else if (method != null && !method.equalsIgnoreCase(pair2.getMethod())){ return false; } if ((type == null && pair2.getType() != null) || (type != null && pair2.getType() == null)){ return false; } else if (type != null && !type.equalsIgnoreCase(pair2.getType())){ return false; } return true; }
@Override public boolean canExportBinaryInteraction(BinaryInteraction interaction, ExportContext context) throws UniprotExportException { double score = FilterUtils.getMiClusterScoreFor(interaction); if (score >= positive_export_threshold){ Set<String> intactInteractions = new HashSet<String>(); intactInteractions.addAll(FilterUtils.extractIntactAcFrom(interaction.getInteractionAcs())); if (intactInteractions.isEmpty()){ throw new UniprotExportException("The interaction :" + interaction.getInteractorA().toString() + "-" + interaction.getInteractorB().toString() +" 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 " + ac + " passed the export rules with score = " + score); return true; } } } } return false; }
String typeMi = pair.getType();
String typeMi = pair.getType();
String type = methodType.getType();
@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; }