protected void copyInteractorCommons( Interactor source, Interactor target ) { if ( target.getBioSource() != null && source.getBioSource() == null ) { throw new PersisterException( "Operation not permitted: nullifying biosource of a " + target.getClass().getSimpleName() + " (" + target.getShortLabel() + ") - " + " current biosource is " + target.getBioSource().getShortLabel() ); } copyProperty(source, "bioSource", target); copyProperty(source, "cvInteractorType", target); }
protected void copyInteractorCommons( Interactor source, Interactor target ) { if ( target.getBioSource() != null && source.getBioSource() == null ) { throw new PersisterException( "Operation not permitted: nullifying biosource of a " + target.getClass().getSimpleName() + " (" + target.getShortLabel() + ") - " + " current biosource is " + target.getBioSource().getShortLabel() ); } copyProperty(source, "bioSource", target); copyProperty(source, "cvInteractorType", target); }
protected void traverseInteractor(Interactor interactor, IntactVisitor ... visitors) { if (interactor == null) return; for (IntactVisitor visitor : visitors) { visitor.visitInteractor(interactor); } // check if this element has been traversed already, to avoid cyclic recursion if (recursionChecker.isAlreadyTraversed(interactor)) { return; } traverse(interactor.getCvInteractorType(), visitors); traverse(interactor.getBioSource(), visitors); }
protected void traverseInteractor(Interactor interactor, IntactVisitor ... visitors) { if (interactor == null) return; for (IntactVisitor visitor : visitors) { visitor.visitInteractor(interactor); } // check if this element has been traversed already, to avoid cyclic recursion if (recursionChecker.isAlreadyTraversed(interactor)) { return; } traverse(interactor.getCvInteractorType(), visitors); traverse(interactor.getBioSource(), visitors); }
protected Set<SimpleBioSource> getBioSourcesForExperimentInteractions(Experiment experiment) { Set<SimpleBioSource> allBioSources = new HashSet<SimpleBioSource>(); String experimentAc = experiment.getAc(); int firstResult = 0; int maxResults = 50; Collection<Interaction> interactions; do { beginTransaction(); interactions = getDataContext().getDaoFactory() .getExperimentDao().getInteractionsForExperimentWithAc(experimentAc, firstResult, maxResults); for (Interaction interaction : interactions) { for (Component component : interaction.getComponents()) { BioSource bioSource = component.getInteractor().getBioSource(); if (bioSource != null) { allBioSources.add(new SimpleBioSource(bioSource)); } else { if (log.isDebugEnabled()) log.debug("Interactor without biosource: "+component.getInteractor()); } } } commitTransaction(); firstResult += maxResults; } while (!interactions.isEmpty()); return allBioSources; }
BioSource organism = interactor.getBioSource(); BioSource2xmlFactory.getInstance( session ).createOrganism( session, element, interactor.getBioSource() );
@Override protected void saveOrUpdateAttributes(T intactObject) throws PersisterException { super.saveOrUpdateAttributes(intactObject); if (intactObject.getBioSource() != null) { BioSourcePersister.getInstance().saveOrUpdate(intactObject.getBioSource()); } if (intactObject.getCvInteractorType() != null) { CvObjectPersister.getInstance().saveOrUpdate(intactObject.getCvInteractorType()); } if ( intactObject.getActiveInstances() != null ) { for ( Component c : intactObject.getActiveInstances() ) { ComponentPersister.getInstance().saveOrUpdate( c ); } } }
private void synchronizeInteractor( Interactor interactor, boolean synchronizeAnnotatedAtributes ) { if (IntactCore.isInitializedAndDirty(interactor.getActiveInstances())){ Collection<Component> activeInstances = synchronizeCollection(interactor.getActiveInstances()); interactor.getActiveInstances().clear(); interactor.getActiveInstances().addAll(activeInstances); } interactor.setBioSource( synchronize( interactor.getBioSource() ) ); interactor.setCvInteractorType( synchronize( interactor.getCvInteractorType() ) ); if (synchronizeAnnotatedAtributes){ synchronizeAnnotatedObjectCommons( interactor ); } }
BioSource organism = interactor.getBioSource(); BioSource2xmlFactory.getInstance( session ).createOrganism( session, element, interactor.getBioSource() );
BioSource organism = interactor.getBioSource(); BioSource2xmlFactory.getInstance( session ).createOrganism( session, element, interactor.getBioSource() );
private void synchronizeInteractor( Interactor interactor, boolean synchronizeAnnotatedAtributes ) { if (IntactCore.isInitializedAndDirty(interactor.getActiveInstances())){ Collection<Component> activeInstances = synchronizeCollection(interactor.getActiveInstances()); interactor.getActiveInstances().clear(); interactor.getActiveInstances().addAll(activeInstances); } interactor.setBioSource( synchronize( interactor.getBioSource() ) ); interactor.setCvInteractorType( synchronize( interactor.getCvInteractorType() ) ); if (synchronizeAnnotatedAtributes){ synchronizeAnnotatedObjectCommons( interactor ); } }
clone.setBioSource(clone(interactor.getBioSource())); clone.setCvInteractorType(clone(interactor.getCvInteractorType())); clone.setObjClass(interactor.getObjClass());
@Override protected T syncAttributes(T intactObject) { if (intactObject.getBioSource() != null) { BioSource syncedBioSource = BioSourcePersister.getInstance().syncIfTransient(intactObject.getBioSource()); intactObject.setBioSource(syncedBioSource); } if (intactObject.getCvInteractorType() != null) { CvInteractorType cvIntType = (CvInteractorType) CvObjectPersister.getInstance().syncIfTransient(intactObject.getCvInteractorType()); intactObject.setCvInteractorType(cvIntType); } if ( intactObject.getActiveInstances() != null ) { Collection<Component> components = new ArrayList<Component>( intactObject.getActiveInstances().size() ); for ( Component component : intactObject.getActiveInstances() ) { final Component c = ComponentPersister.getInstance().syncIfTransient( component ); c.setInteractor( intactObject ); c.setInteraction( component.getInteraction() ); components.add( c ); } intactObject.setActiveInstances( components ); } return super.syncAttributes(intactObject); }
clone.setBioSource(clone(interactor.getBioSource())); clone.setCvInteractorType(clone(interactor.getCvInteractorType())); clone.setObjClass(interactor.getObjClass());
String species = interactor.getBioSource().getTaxId();
if( interactor.getBioSource() != null && interactorCandidate.getBioSource() != null ) { final String t = interactor.getBioSource().getTaxId(); final String tc = interactorCandidate.getBioSource().getTaxId(); if( t != null && !t.equals(tc) ) { log.warn( "Interactors with the same identity xref(s) but with different BioSource: " +
if ( component.getExpressedIn() != null && component.getInteractor().getBioSource() != null) { Element hostOrganismList = session.createElement( "hostOrganismList" ); element.appendChild( hostOrganismList ); BioSource2xmlFactory.getInstance( session ).createHostOrganism( session, hostOrganismList, interactor.getBioSource() );
Element hostOrganismList = session.createElement( "hostOrganismList" ); element.appendChild( hostOrganismList ); BioSource2xmlFactory.getInstance( session ).createHostOrganism( session, hostOrganismList, interactor.getBioSource() );
Element hostOrganismList = session.createElement( "hostOrganismList" ); element.appendChild( hostOrganismList ); BioSource2xmlFactory.getInstance( session ).createHostOrganism( session, hostOrganismList, interactor.getBioSource() );
if (intactObject.getBioSource() != null) { Organism organism = this.organismConverter.intactToPsi(intactObject.getBioSource()); interactor.setOrganism(organism);