public Collection<GeneralMessage> check(Experiment experiment) throws SanityRuleException { Collection<GeneralMessage> messages = new ArrayList<GeneralMessage>(); if(experiment.getCvInteraction() == null){ messages.add(new GeneralMessage( MessageDefinition.EXPERIMENT_WITHOUT_INTERACTION_DETECT, experiment )); } return messages; } }
CvInteraction detectionMethod = exp.getCvInteraction(); CvInteractionType interactionType = interaction.getCvInteractionType();
public void intactToMitab(Experiment exp, BinaryInteraction binary, boolean processParticipantDetMethod, boolean processPublication){ if (exp != null && binary != null){ // process publication Publication pub = exp.getPublication(); if (pub != null && processPublication){ publicationConverter.intactToMitab(pub, binary); } // convert interaction detection method if (exp.getCvInteraction() != null){ CrossReference detMethod = cvObjectConverter.toCrossReference(exp.getCvInteraction()); if (detMethod != null){ binary.getDetectionMethods().add(detMethod); } } // process organism if (exp.getBioSource() != null){ Organism organism = organismConverter.intactToMitab(exp.getBioSource()); if (organism != null){ binary.setHostOrganism(organism); } } // process participant detection method if (processParticipantDetMethod){ processParticipantDetectionMethod(exp, binary); } } }
if ( experiment.getCvInteraction() != null ) { CvObject2xmlFactory.getInstance( session ).create( session, element, experiment.getCvInteraction() );
if ( experiment.getCvInteraction() != null ) { CvObject2xmlFactory.getInstance( session ).create( session, element, experiment.getCvInteraction() );
if ( experiment.getCvInteraction() != null ) { CvObject2xmlFactory.getInstance( session ).create( session, element, experiment.getCvInteraction() );
if ( experiment.getCvInteraction() != null ) { CvObject2xmlFactory.getInstance( session ).create( session, element, experiment.getCvInteraction() );
sb.append(createUniquenessString(experiment.getCvInteraction()));
sb.append(createUniquenessString(experiment.getCvInteraction()));
private void synchronizeExperiment( Experiment experiment, boolean synchronizeAnnotatedAttributes ) { experiment.setPublication( synchronize( experiment.getPublication() ) ); if (IntactCore.isInitializedAndDirty(experiment.getInteractions())){ Collection<Interaction> interactions = synchronizeCollection(experiment.getInteractions()); experiment.getInteractions().clear(); experiment.getInteractions().addAll(interactions); } experiment.setCvIdentification(synchronize(experiment.getCvIdentification())); experiment.setCvInteraction( synchronize( experiment.getCvInteraction() ) ); experiment.setBioSource( synchronize( experiment.getBioSource() ) ); if (synchronizeAnnotatedAttributes){ synchronizeAnnotatedObjectCommons( experiment ); } }
@Override protected void saveOrUpdateAttributes(Experiment intactObject) throws PersisterException { super.saveOrUpdateAttributes(intactObject); if (intactObject.getBioSource() != null) { BioSourcePersister.getInstance().saveOrUpdate(intactObject.getBioSource()); } if (intactObject.getCvInteraction() != null) { CvObjectPersister.getInstance().saveOrUpdate(intactObject.getCvInteraction()); } else { throw new NullPointerException("Experiment without CvInteraction: " + intactObject.getShortLabel()); } if (intactObject.getCvIdentification() != null) { CvObjectPersister.getInstance().saveOrUpdate(intactObject.getCvIdentification()); } if (intactObject.getPublication() != null) { PublicationPersister.getInstance().saveOrUpdate(intactObject.getPublication()); } for (Interaction interaction : intactObject.getInteractions()) { InteractionPersister.getInstance().saveOrUpdate(interaction); } }
private void synchronizeExperiment( Experiment experiment, boolean synchronizeAnnotatedAttributes ) { experiment.setPublication( synchronize( experiment.getPublication() ) ); if (IntactCore.isInitializedAndDirty(experiment.getInteractions())){ Collection<Interaction> interactions = synchronizeCollection(experiment.getInteractions()); experiment.getInteractions().clear(); experiment.getInteractions().addAll(interactions); } experiment.setCvIdentification(synchronize(experiment.getCvIdentification())); experiment.setCvInteraction( synchronize( experiment.getCvInteraction() ) ); experiment.setBioSource( synchronize( experiment.getBioSource() ) ); if (synchronizeAnnotatedAttributes){ synchronizeAnnotatedObjectCommons( experiment ); } }
protected void traverseExperiment(Experiment experiment, IntactVisitor ... visitors) { if (experiment == null) return; for (IntactVisitor visitor : visitors) { visitor.visitExperiment(experiment); } // check if this element has been traversed already, to avoid cyclic recursion if (recursionChecker.isAlreadyTraversed(experiment)) { return; } traverse(experiment.getCvIdentification(), visitors); traverse(experiment.getCvInteraction(), visitors); traverse(experiment.getBioSource(), visitors); traverse(experiment.getPublication(), visitors); traverse(experiment.getInteractions(), visitors); }
protected void traverseExperiment(Experiment experiment, IntactVisitor ... visitors) { if (experiment == null) return; for (IntactVisitor visitor : visitors) { visitor.visitExperiment(experiment); } // check if this element has been traversed already, to avoid cyclic recursion if (recursionChecker.isAlreadyTraversed(experiment)) { return; } traverse(experiment.getCvIdentification(), visitors); traverse(experiment.getCvInteraction(), visitors); traverse(experiment.getBioSource(), visitors); traverse(experiment.getPublication(), visitors); traverse(experiment.getInteractions(), visitors); }
public Experiment cloneExperiment(Experiment experiment) throws IntactClonerException { if (experiment == null) return null; Experiment clone = new Experiment(); clonerManager.addClone(experiment, clone); clone.setCvIdentification(clone(experiment.getCvIdentification())); clone.setCvInteraction(clone(experiment.getCvInteraction())); clone.setBioSource(clone(experiment.getBioSource())); clone.setPublication(clone(experiment.getPublication())); if (isCollectionClonable(experiment.getInteractions())) { Collection<Interaction> interactions = IntactCore.ensureInitializedInteractions(experiment); for (Interaction i : interactions) { clone.addInteraction(clone(i)); } } return clone; }
public Experiment cloneExperiment(Experiment experiment) throws IntactClonerException { if (experiment == null) return null; Experiment clone = new Experiment(); clonerManager.addClone(experiment, clone); clone.setCvIdentification(clone(experiment.getCvIdentification())); clone.setCvInteraction(clone(experiment.getCvInteraction())); clone.setBioSource(clone(experiment.getBioSource())); clone.setPublication(clone(experiment.getPublication())); if (isCollectionClonable(experiment.getInteractions())) { Collection<Interaction> interactions = IntactCore.ensureInitializedInteractions(experiment); for (Interaction i : interactions) { clone.addInteraction(clone(i)); } } return clone; }
@Override protected Experiment syncAttributes(Experiment intactObject) { if (intactObject.getBioSource() != null) { BioSource bioSource = BioSourcePersister.getInstance().syncIfTransient(intactObject.getBioSource()); intactObject.setBioSource(bioSource); } intactObject.setCvInteraction((CvInteraction) CvObjectPersister.getInstance().syncIfTransient(intactObject.getCvInteraction())); if (intactObject.getCvIdentification() != null) { CvIdentification cvIdentification = ( CvIdentification ) CvObjectPersister.getInstance().syncIfTransient( intactObject.getCvIdentification() ); intactObject.setCvIdentification( cvIdentification ); } if (intactObject.getPublication() != null) { Publication publication = PublicationPersister.getInstance().syncIfTransient( intactObject.getPublication() ); intactObject.setPublication( publication ); } return super.syncAttributes(intactObject); }
/** * Builds a SHALLOW copy of the Experiment parameter. This means that a new Experiment instance is returned, but you * should be aware that the object references it contains <b>point to the objects referenced in the original object * </b>. * * @param experiment The Experiment you want a shallow copy of * * @return Experiment a new Experiment instance containing new references to the parameter object's attributes. * * @throws NullPointerException thrown if required items are not present in the parameter Experiment instance. */ public static Experiment getShallowCopy( Experiment experiment ) { Experiment ex = new Experiment( experiment.getOwner(), experiment.getShortLabel(), experiment.getBioSource() ); ex.ac = ( experiment.getAc() ); ex.setAnnotations( experiment.getAnnotations() ); ex.setCvInteraction( experiment.getCvInteraction() ); ex.setCvIdentification( experiment.getCvIdentification() ); ex.setFullName( experiment.getFullName() ); ex.setRelatedExperiment( experiment.getRelatedExperiment() ); ex.setXrefs( experiment.getXrefs() ); ex.setPublication( experiment.getPublication() ); return ex; }
/** * Builds a SHALLOW copy of the Experiment parameter. This means that a new Experiment instance is returned, but you * should be aware that the object references it contains <b>point to the objects referenced in the original object * </b>. * * @param experiment The Experiment you want a shallow copy of * * @return Experiment a new Experiment instance containing new references to the parameter object's attributes. * * @throws NullPointerException thrown if required items are not present in the parameter Experiment instance. */ public static Experiment getShallowCopy( Experiment experiment ) { Experiment ex = new Experiment( experiment.getOwner(), experiment.getShortLabel(), experiment.getBioSource() ); ex.ac = ( experiment.getAc() ); ex.setAnnotations( experiment.getAnnotations() ); ex.setCvInteraction( experiment.getCvInteraction() ); ex.setCvIdentification( experiment.getCvIdentification() ); ex.setFullName( experiment.getFullName() ); ex.setRelatedExperiment( experiment.getRelatedExperiment() ); ex.setXrefs( experiment.getXrefs() ); ex.setPublication( experiment.getPublication() ); return ex; }
/** * Builds a SHALLOW copy of the Experiment parameter. This means that a new Experiment instance is returned, but you * should be aware that the object references it contains <b>point to the objects referenced in the original object * </b>. * * @param experiment The Experiment you want a shallow copy of * * @return Experiment a new Experiment instance containing new references to the parameter object's attributes. * * @throws NullPointerException thrown if required items are not present in the parameter Experiment instance. */ public static Experiment getShallowCopy( Experiment experiment ) { Experiment ex = new Experiment( experiment.getOwner(), experiment.getShortLabel(), experiment.getBioSource() ); ex.ac = ( experiment.getAc() ); ex.setAnnotations( experiment.getAnnotations() ); ex.setCvInteraction( experiment.getCvInteraction() ); ex.setCvIdentification( experiment.getCvIdentification() ); ex.setFullName( experiment.getFullName() ); ex.setRelatedExperiment( experiment.getRelatedExperiment() ); ex.setXrefs( experiment.getXrefs() ); ex.setPublication( experiment.getPublication() ); return ex; }