public void onPrePersist(Interaction objToPersist) { String shortLabel = objToPersist.getShortLabel(); String newShortLabel = InteractionUtils.syncShortLabelWithDb(shortLabel); if (!shortLabel.equals(newShortLabel)) { if (log.isDebugEnabled()) log.debug("Interaction with label '"+shortLabel+"' renamed '"+newShortLabel+"'" ); objToPersist.setShortLabel(newShortLabel); } }
public String crc64(Interaction interaction) { UniquenessStringBuilder sb = createUniquenessString(interaction); final String uniquenessString = sb.toString().toLowerCase(); String crc64 = Crc64.getCrc64(uniquenessString); if (log.isDebugEnabled()) log.debug("Created CRC for interaction '" + interaction.getShortLabel() + "': " + crc64 + " (" + uniquenessString + ")"); return crc64; }
public String crc64(Interaction interaction) { UniquenessStringBuilder sb = createUniquenessString(interaction); final String uniquenessString = sb.toString().toLowerCase(); String crc64 = Crc64.getCrc64(uniquenessString); if (log.isDebugEnabled()) log.debug("Created CRC for interaction '" + interaction.getShortLabel() + "': " + crc64 + " (" + uniquenessString + ")"); return crc64; }
/** * Gets the Interactor Identifiers for that interaction * * @since 1.7.2 */ public static List<String> getInteractorPrimaryIDs(Interaction interaction) { final Collection<Component> components = interaction.getComponents(); List<String> ids = new ArrayList<String>(components.size()); for (Component component : components) { Interactor interactor = component.getInteractor(); final Collection<InteractorXref> idXrefs = XrefUtils.getIdentityXrefs(interactor); if (idXrefs.size() > 0) { final Iterator<InteractorXref> iterator = idXrefs.iterator(); ids.add(iterator.next().getPrimaryId()); if (log.isDebugEnabled()) { if (iterator.hasNext()) { log.debug("Interaction contains interactor with more than one identities. Interaction: " + interaction.getShortLabel() + "(" + interaction.getAc() + ") " + " - Xrefs: " + idXrefs); } } } } return ids; }
/** * Gets the Interactor Identifiers for that interaction * * @since 1.7.2 */ public static List<String> getInteractorPrimaryIDs(Interaction interaction) { final Collection<Component> components = interaction.getComponents(); List<String> ids = new ArrayList<String>(components.size()); for (Component component : components) { Interactor interactor = component.getInteractor(); final Collection<InteractorXref> idXrefs = XrefUtils.getIdentityXrefs(interactor); if (idXrefs.size() > 0) { final Iterator<InteractorXref> iterator = idXrefs.iterator(); ids.add(iterator.next().getPrimaryId()); if (log.isDebugEnabled()) { if (iterator.hasNext()) { log.debug("Interaction contains interactor with more than one identities. Interaction: " + interaction.getShortLabel() + "(" + interaction.getAc() + ") " + " - Xrefs: " + idXrefs); } } } } return ids; }
for ( Iterator iterator1 = createdInteractions.iterator(); iterator1.hasNext(); ) { Interaction interaction1 = (Interaction) iterator1.next(); sb.append( interaction1.getShortLabel() ).append( ' ' );
for ( Iterator iterator1 = createdInteractions.iterator(); iterator1.hasNext(); ) { Interaction interaction1 = (Interaction) iterator1.next(); sb.append( interaction1.getShortLabel() ).append( ' ' );
for ( Iterator iterator1 = createdInteractions.iterator(); iterator1.hasNext(); ) { Interaction interaction1 = (Interaction) iterator1.next(); sb.append( interaction1.getShortLabel() ).append( ' ' );
syncedInteractionLabels.add(syncedInteraction.getShortLabel()); if (!syncedInteractionLabels.contains(candidateInteraction.getShortLabel())) { return BehaviourType.UPDATE;
/** * Filter the binary interactions of a given list of interactions and return a list composed with only binary interactions * @param interactionAcs : the list of interaction accessions * @param eligibleInteractions : the list of eligible interactions for uniprot export */ private void filterTrueBinaryInteractions(List<String> interactionAcs, List<String> eligibleInteractions) { // process each interaction of the list final int interactionCount = interactionAcs.size(); for (int i = 0; i < interactionCount; i++) { TransactionStatus status = IntactContext.getCurrentInstance().getDataContext().beginTransaction(); // get the IntAct interaction object String interactionAc = interactionAcs.get(i); Interaction interaction = IntactContext.getCurrentInstance().getDaoFactory().getInteractionDao().getByAc(interactionAc); // the interaction exists in IntAct if (interaction != null){ logger.info("\t\t Interaction: Shortlabel:" + interaction.getShortLabel() + " AC: " + interaction.getAc()); if (InteractionUtils.isBinaryInteraction(interaction)){ eligibleInteractions.add(interactionAc); } } IntactContext.getCurrentInstance().getDataContext().commitTransaction(status); } // i }
getOut().println(" (" + (i + 1) + ") Interaction: Shortlabel:" + interaction.getShortLabel() + " AC: " + interaction.getAc());
logger.error("The interaction " + interactionAc + ", " + intactInteraction.getShortLabel() + " cannot be converted into binary interactions and is excluded.", e); logger.info("The interaction " + interactionAc + ", " + intactInteraction.getShortLabel() + " cannot be converted into binary interactions and is excluded.");
logger.info("The interaction " + interaction + ", " + intactInteraction.getShortLabel() + " is not a true binary interaction and is excluded."); logger.error("The interaction " + interaction + ", " + intactInteraction.getShortLabel() + " cannot be converted into binary interactions and is excluded.", e); logger.info("The interaction " + interaction + ", " + intactInteraction.getShortLabel() + " cannot be converted into binary interactions.");
if (log.isDebugEnabled()) log.debug("Persisting: "+interaction.getShortLabel()); PersisterStatistics localImportStats = importIntoIntact(interaction);
logger.error("The interaction " + interactionAc + ", " + intactInteraction.getShortLabel() + " cannot be converted into binary interactions and is excluded.", e); logger.info("The interaction " + interactionAc + ", " + intactInteraction.getShortLabel() + " cannot be converted into binary interactions.");
out.write( ii + "<name>" + interaction.getShortLabel() + "</name>" + NEW_LINE ); if ( interaction.getFullName() != null ) { out.write( ii + "<description>" + escapeXml( interaction.getFullName() ) + "</description>" + NEW_LINE );
private void updateExperimentParticipantDetectionMethod(Interaction interaction) { for (Experiment experiment : interaction.getExperiments()) { if (experiment.getCvIdentification() == null) { String partDetMethod = calculateParticipantDetMethod(interaction.getComponents()); if (partDetMethod != null) { final String message = "Experiment ("+ experiment.getShortLabel() +") without participant detection method. One was calculated from the components: " + partDetMethod; addMessageToContext(MessageLevel.INFO, message, true); if (log.isWarnEnabled()) { log.warn(message); } CvIdentification detMethod = CvObjectUtils.createCvObject(experiment.getOwner(), CvIdentification.class, partDetMethod, "undefined"); experiment.setCvIdentification(detMethod); } else { final String message = "Neither the Experiment nor its participants have CvIdentification (participant detection method). Using the term \"experimental particp\" (MI:0661)."; if (log.isWarnEnabled()) log.warn(": Experiment '"+experiment.getShortLabel()+ "', Interaction '"+interaction.getShortLabel()+"' - Location: "+ConverterContext.getInstance().getLocation().getCurrentLocation().pathFromRootAsString()); addMessageToContext(MessageLevel.WARN, message, true); CvIdentification detMethod = CvObjectUtils.createCvObject(experiment.getOwner(), CvIdentification.class, "MI:0661", "experimental particp"); experiment.setCvIdentification(detMethod); } } } }
if (log.isDebugEnabled()) log.debug("Persisting: " + interaction.getShortLabel());
public static String createKey(AnnotatedObject ao) { String key; final String normalizedClassName = normalizeClassName(ao.getClass()); if (ao instanceof Component) { // So far, components have as shorltabel N/A => we need to create one that allows to discriminate them Component comp = (Component)ao; String label = comp.getInteraction().getShortLabel()+"_"+comp.getInteractor().getShortLabel(); key = normalizedClassName +":"+label; } else if (ao instanceof BioSource) { key = normalizedClassName +":"+((BioSource)ao).getTaxId(); } else if (ao instanceof CvObject) { CvObject cv = (CvObject)ao; CvObjectXref identity = CvObjectUtils.getPsiMiIdentityXref(cv); if (identity != null) { key = normalizedClassName +":"+identity.getPrimaryId(); } else { key = normalizedClassName +":"+ao.getShortLabel(); } } else if (ao instanceof Feature) { String label = ao.getShortLabel()+"_"+createKey(((Feature)ao).getComponent()); key = normalizedClassName+":"+label; } else { key = normalizedClassName +":"+ao.getShortLabel(); } return key; }
log.error("Interaction without any participants : " + interaction.getShortLabel());