public Interaction createInteraction(String shortLabel, Interactor bait, Interactor prey, Experiment experiment) { CvInteractionType cvInteractionType = createCvObject(CvInteractionType.class, CvInteractionType.DIRECT_INTERACTION_MI_REF, CvInteractionType.DIRECT_INTERACTION ); CvInteractorType intType = createCvObject(CvInteractorType.class, CvInteractorType.INTERACTION_MI_REF, CvInteractorType.INTERACTION ); Interaction interaction = new InteractionImpl(new ArrayList<Experiment>(Arrays.asList(experiment)), cvInteractionType, intType, shortLabel, getInstitution()); createComponentBait(interaction, bait); createComponentPrey(interaction, prey); return interaction; }
@Override public String toString() { String result = "Interaction: " + getAc() + " Label: " + getShortLabel() + " [" + NEW_LINE; if ( null != this.getComponents() ) { for ( Iterator iter = this.getComponents().iterator(); iter.hasNext(); ) { result += ( ( Component ) iter.next() ).getInteractor(); } } return result + "] Interaction" + NEW_LINE; } } // end Interaction
public boolean equals( Object o ) { if ( this == o ) { return true; } if ( o == null || getClass() != o.getClass() ) { return false; } MineInteractionPk that = ( MineInteractionPk ) o; if ( protein1 != null ? !protein1.equals( that.protein1 ) : that.protein1 != null ) { return false; } if ( protein2 != null ? !protein2.equals( that.protein2 ) : that.protein2 != null ) { return false; } if ( interaction != null && that.getInteraction() != null ) { if ( interaction.getAc() == null && that.getInteraction().getAc() != null ) { if ( !interaction.getAc().equals( that.getInteraction().getAc() ) ) { return false; } } } if ( interaction != null ? !interaction.equals( that.interaction ) : that.interaction != null ) { return false; } return true; }
/******************************************/ protected void indexComplexAC(InteractionImpl complex, SolrInputDocument solrDocument) throws Exception { // stored field solrDocument.addField(ComplexFieldNames.COMPLEX_AC, complex.getAc()); // search fields solrDocument.addField ( ComplexFieldNames.COMPLEX_ID, complex.getAc ( ) ) ; // index source of complex id if ( complex.getOwner ( ) != null ) { solrDocument.addField ( ComplexFieldNames.COMPLEX_ID, complex.getOwner ( ).getShortLabel() ) ; solrDocument.addField ( ComplexFieldNames.COMPLEX_ID, complex.getOwner ( ).getShortLabel() + ":" + complex.getAc ( ) ) ; } }
Experiment exp = interaction.getExperiments().iterator().next(); CvInteraction detectionMethod = exp.getCvInteraction(); CvInteractionType interactionType = interaction.getCvInteractionType(); if (ref.getIdentifier().equals(interaction.getAc())){ interactionsToRemove.remove(ref); break;
/*************************/ public TreeComplexComponents(InteractionImpl c, ComplexSolrEnricher enricher) { complex = c ; complexSons = new ArrayList(); for ( Component component : complex.getComponents() ) { complexSons.add ( new TreeComponents ( component, enricher ) ); } }
solrDocument.addField ( ComplexFieldNames.COMPLEX_ALIAS, complex.getShortLabel ( ) ) ; if (complex.getFullName() != null){ solrDocument.addField ( ComplexFieldNames.COMPLEX_ALIAS, complex.getFullName ( ) ) ; String firstAlias=null; for ( Alias alias : complex.getAliases ( ) ) { if (alias.getName() != null){ if (alias.getCvAliasType() != null){ solrDocument.addField(ComplexFieldNames.COMPLEX_NAME, complex.getShortLabel());
if (complex.getCvInteractionType() != null){ this.complexSolrEnricher.enrichInteractionType(complex.getCvInteractionType(), solrDocument); if (complex.getCvInteractorType() != null){ this.complexSolrEnricher.enrichComplexType(complex.getCvInteractorType(), solrDocument); this.complexSolrEnricher.enrichInteractionXref(complex.getXrefs(), solrDocument) ; for ( Annotation annotation : complex.getAnnotations ( ) ) { cvTopic = annotation != null ? annotation.getCvTopic ( ) : null ; if ( cvTopic != null && cvTopic.getShortLabel ( ) .equalsIgnoreCase( CURATED_COMPLEX ) && annotation.getAnnotationText() != null) { solrDocument.addField ( ComplexFieldNames.PARAM, !complex.getParameters ( ).isEmpty ( ) ) ;
@Override public boolean equals( Object o ) { if ( this == o ) return true; if ( !( o instanceof AbstractConfidence ) ) return false; if (!super.equals(o)) { return false; } Confidence that = ( Confidence ) o; if ( interaction != null ? !interaction.equals( that.interaction, false ) : that.interaction != null ) return false; return true; }
/** * Update the shortlabel based on the data available in the database. */ public void synchronizeShortLabel() { if( IntactContext.currentInstanceExists() ) { if( IntactContext.getCurrentInstance().getConfig().isAutoUpdateInteractionLabel() ) { String shortLabel = getShortLabel(); String newShortLabel = InteractionUtils.syncShortLabelWithDb(shortLabel); if (!shortLabel.equals(newShortLabel)) { if (log.isDebugEnabled()) log.debug("Interaction with label '"+shortLabel+"' renamed '"+newShortLabel+"'" ); setShortLabel(newShortLabel); } } } else { log.warn( "There is no IntAct Context initialized, skipping interaction shortlabel synchronization." ); } }
public void calculateCrc() { CrcCalculator crcCalculator = new CrcCalculator(); Instant before = new Instant(); String newCrc = crcCalculator.crc64(this); if (crc == null){ crc = newCrc; } else if (!crc.equals(newCrc)){ crc = newCrc; } Instant after = new Instant(); if (log.isDebugEnabled()) log.debug("Calculated crc for interaction '" + getShortLabel() + "' in " + new Duration(before, after).getMillis() + "ms: " + crc); }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ((interaction == null) ? 0 : interaction.hashCode()); return result; }
public static String getFirstAlias(InteractionImpl complex) { for (Alias alias : complex.getAliases()) { if (alias.getName() != null) { return alias.getName(); } } return null; }
public static String getSpeciesTaxId(InteractionImpl complex) { if (!complex.getExperiments().isEmpty()) { Experiment exp = complex.getExperiments().iterator().next(); BioSource bioSource = exp.getBioSource(); if (bioSource != null) { return bioSource.getTaxId(); } } return null; }
private static String getAnnotationById(InteractionImpl complex, String id) { for (Annotation annotation : complex.getAnnotations()) { if (annotation.getCvTopic() != null && annotation.getCvTopic().getIdentifier() != null && annotation.getCvTopic().getIdentifier().equalsIgnoreCase(id)) { return annotation.getAnnotationText(); } } return null; }
copy.setActiveInstances( new ArrayList<Component>() );
String intactAc = intact.getAc(); Collection<Experiment> experiments = intact.getExperiments(); if (experiments.size() == 1){ CvInteractionType interactionType = intact.getCvInteractionType();
/*******************************/ public TreeNode( Component component_param, ComplexSolrEnricher enricher) { component = component_param ; this.enricher = enricher; if ( component.getInteractor() instanceof InteractionImpl ) { sons = new ArrayList(); for ( Component comp : ((InteractionImpl) component.getInteractor()).getComponents() ) { TreeComponents tree = null ; if ( ! map.containsKey ( comp.getAc() ) ) { tree = new TreeComponents ( comp, enricher ) ; map.put ( comp.getAc(), tree ) ; } else { tree = map.get ( comp.getAc() ) ; } sons.add ( tree ) ; } } else { sons = null ; } }
@Override public boolean equals( Object o ) { if ( this == o ) return true; if ( !( o instanceof AbstractConfidence ) ) return false; if (!super.equals(o)) { return false; } Confidence that = ( Confidence ) o; if ( interaction != null ? !interaction.equals( that.interaction, false ) : that.interaction != null ) return false; return true; }
/** * Update the shortlabel based on the data available in the database. */ public void synchronizeShortLabel() { if( IntactContext.currentInstanceExists() ) { if( IntactContext.getCurrentInstance().getConfig().isAutoUpdateInteractionLabel() ) { String shortLabel = getShortLabel(); String newShortLabel = InteractionUtils.syncShortLabelWithDb(shortLabel); if (!shortLabel.equals(newShortLabel)) { if (log.isDebugEnabled()) log.debug("Interaction with label '"+shortLabel+"' renamed '"+newShortLabel+"'" ); setShortLabel(newShortLabel); } } } else { log.warn( "There is no IntAct Context initialized, skipping interaction shortlabel synchronization." ); } }