@Override public String toString() { StringBuffer result = new StringBuffer( 512 ); result.append( "Experiment [AC: " + this.getAc() + " Shortlabel: " + getShortLabel() ); result.append( " BioSource: " + ( getBioSource() == null ? "-" : getBioSource().getShortLabel() ) ); result.append( NEW_LINE ); result.append( "CvIdentification: " + ( cvIdentification == null ? "-" : cvIdentification.getShortLabel() ) ); result.append( NEW_LINE ); result.append( "CvInteraction: " + ( cvInteraction == null ? "NOT SPECIFIED" : cvInteraction.getShortLabel() ) ); result.append( NEW_LINE ); result.append( ']' ); return result.toString(); } }
private String calculateParticipantDetMethod(Collection<Component> components) { Set<String> detMethodMis = new HashSet<String>(); for (Component component : components) { for (CvIdentification partDetMethod : component.getParticipantDetectionMethods()) { if (partDetMethod.getIdentifier() != null) { detMethodMis.add(partDetMethod.getIdentifier()); } } } if (detMethodMis.size() == 1) { return detMethodMis.iterator().next(); } else if (detMethodMis.size() > 1) { return CvUtils.findLowestCommonAncestor(getCurrentOntology(), detMethodMis.toArray(new String[detMethodMis.size()])); } log.error("No participant detection methods found for components in experiment"); return null; }
@Override public int hashCode() { int result = super.hashCode(); // result = 29 * result + bioSource.hashCode(); result = 29 * result + ( bioSource != null ? bioSource.hashCode() : 0 ); result = 29 * result + ( publication != null ? publication.hashCode() : 0 ); result = 29 * result + ( cvIdentification != null ? cvIdentification.hashCode() : 0 ); result = 29 * result + ( cvInteraction != null ? cvInteraction.hashCode() : 0 ); return result; }
return false; if ( cvIdentification != null ? !cvIdentification.equals( that.cvIdentification ) : that.cvIdentification != null ) { return false;
return false; if ( cvIdentification != null ? !cvIdentification.equals( that.cvIdentification ) : that.cvIdentification != null ) { return false;
@Override public String toString() { StringBuffer result = new StringBuffer( 512 ); result.append( "Experiment [AC: " + this.getAc() + " Shortlabel: " + getShortLabel() ); result.append( " BioSource: " + ( getBioSource() == null ? "-" : getBioSource().getShortLabel() ) ); result.append( NEW_LINE ); result.append( "CvIdentification: " + ( cvIdentification == null ? "-" : cvIdentification.getShortLabel() ) ); result.append( NEW_LINE ); result.append( "CvInteraction: " + ( cvInteraction == null ? "NOT SPECIFIED" : cvInteraction.getShortLabel() ) ); result.append( NEW_LINE ); result.append( ']' ); return result.toString(); } }
query.setParameter("participantDetMethodMi", experiment.getCvIdentification().getIdentifier()); query.setParameter("interactionDetectionMethodMi", experiment.getCvInteraction().getIdentifier());
@Override public int hashCode() { int result = super.hashCode(); // result = 29 * result + bioSource.hashCode(); result = 29 * result + ( bioSource != null ? bioSource.hashCode() : 0 ); result = 29 * result + ( publication != null ? publication.hashCode() : 0 ); result = 29 * result + ( cvIdentification != null ? cvIdentification.hashCode() : 0 ); result = 29 * result + ( cvInteraction != null ? cvInteraction.hashCode() : 0 ); return result; }
@Override public String toString() { StringBuffer result = new StringBuffer( 128 ); result.append( "Experiment [AC: " + this.getAc() + " Shortlabel: " + getShortLabel() ); result.append( " BioSource: " + ( getBioSource() == null ? "-" : getBioSource().getShortLabel() ) ); result.append( NEW_LINE ); result.append( "CvIdentification: " + ( cvIdentification == null ? "-" : cvIdentification.getShortLabel() ) ); result.append( NEW_LINE ); result.append( "CvInteraction: " + ( cvInteraction == null ? "NOT SPECIFIED" : cvInteraction.getShortLabel() ) ); result.append( NEW_LINE ); // TODO in experiments with many interactions this can throw OutOfMemoryErrors // result.append( "Interactions (" ); // if( null != getInteractions() ) { // for( Iterator iterator = interactions.iterator(); iterator.hasNext(); ) { // Interaction interaction = (Interaction) iterator.next(); // result.append( interaction.getShortLabel() ).append( ", " ); // } // } // result.append( ')' ); // result.append( NEW_LINE ); result.append( ']' ); return result.toString(); }
query.setParameter("participantDetMethodMi", experiment.getCvIdentification().getIdentifier()); query.setParameter("interactionDetectionMethodMi", experiment.getCvInteraction().getIdentifier());
public static void check( final ParticipantDetectionTag participantDetection ) { final XrefTag psiDef = participantDetection.getPsiDefinition(); XrefChecker.check( psiDef ); final String id = psiDef.getId(); if ( !cache.keySet().contains( id ) ) { CvIdentification cvIdentification = null; try { cvIdentification = IntactContext.getCurrentInstance().getCvContext().getByMiRef(CvIdentification.class,id); if ( cvIdentification == null ) { MessageHolder.getInstance().addCheckerMessage( new Message( "Could not find CvIdentification for the PSI definition: " + id ) ); } else { System.out.println( "Found ParticipantDetection " + id + " as " + cvIdentification.getShortLabel() ); } } catch ( IntactException e ) { MessageHolder.getInstance().addCheckerMessage( new Message( "An error occured while searching for CvInteraction " + "having the PSI definition: " + id ) ); e.printStackTrace(); } cache.put( id, cvIdentification ); } } }
public static void check( final ParticipantDetectionTag participantDetection ) { final XrefTag psiDef = participantDetection.getPsiDefinition(); XrefChecker.check( psiDef ); final String id = psiDef.getId(); if ( !cache.keySet().contains( id ) ) { CvIdentification cvIdentification = null; try { cvIdentification = IntactContext.getCurrentInstance().getCvContext().getByMiRef(CvIdentification.class,id); if ( cvIdentification == null ) { MessageHolder.getInstance().addCheckerMessage( new Message( "Could not find CvIdentification for the PSI definition: " + id ) ); } else { System.out.println( "Found ParticipantDetection " + id + " as " + cvIdentification.getShortLabel() ); } } catch ( IntactException e ) { MessageHolder.getInstance().addCheckerMessage( new Message( "An error occured while searching for CvInteraction " + "having the PSI definition: " + id ) ); e.printStackTrace(); } cache.put( id, cvIdentification ); } } }
public static void check( final ParticipantDetectionTag participantDetection ) { final XrefTag psiDef = participantDetection.getPsiDefinition(); XrefChecker.check( psiDef ); final String id = psiDef.getId(); if ( !cache.keySet().contains( id ) ) { CvIdentification cvIdentification = null; try { cvIdentification = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getCvObjectDao(CvIdentification.class).getByXref(id); if ( cvIdentification == null ) { MessageHolder.getInstance().addCheckerMessage( new Message( "Could not find CvIdentification for the PSI definition: " + id ) ); } else { System.out.println( "Found ParticipantDetection " + id + " as " + cvIdentification.getShortLabel() ); } } catch ( IntactException e ) { MessageHolder.getInstance().addCheckerMessage( new Message( "An error occured while searching for CvInteraction " + "having the PSI definition: " + id ) ); e.printStackTrace(); } cache.put( id, cvIdentification ); } } }