/** * get the value what will be used as ID of the experiment. * * @param experiment the experiment for which we need an ID. * * @return the ID of the experiment. */ public String getExperimentId( Experiment experiment ) { // TODO test that. // TODO what if no AC available ? shortlabel (could be redondant) ? Object pointer/HashCode (will be unique in the scope of the document) ? return experiment.getAc(); } }
/** * get the value what will be used as ID of the experiment. * * @param experiment the experiment for which we need an ID. * * @return the ID of the experiment. */ public String getExperimentId( Experiment experiment ) { // TODO test that. // TODO what if no AC available ? shortlabel (could be redondant) ? Object pointer/HashCode (will be unique in the scope of the document) ? return experiment.getAc(); } }
/** * get the value what will be used as ID of the experiment. * * @param experiment the experiment for which we need an ID. * * @return the ID of the experiment. */ public String getExperimentId( Experiment experiment ) { // TODO test that. // TODO what if no AC available ? shortlabel (could be redondant) ? Object pointer/HashCode (will be unique in the scope of the document) ? return experiment.getAc(); } }
/** * Tells if the given IntAct experiment has already been generated in PSI. * * @param experiment the experiment we want to know if it has already been converted to PSI. * * @return true is the experiment has already been converted to XML, otherwise false. */ public boolean isAlreadyDefined( Experiment experiment ) { return experiments.containsKey( experiment.getAc() ); }
/** * Declare in the session that the given experiment has been already converted in XML. * * @param experiment the experiment to declare as already converted. */ public void declareAlreadyDefined( Experiment experiment ) { experiments.put( experiment.getAc(), null ); }
/** * Tells if the given IntAct experiment has already been generated in PSI. * * @param experiment the experiment we want to know if it has already been converted to PSI. * * @return true is the experiment has already been converted to XML, otherwise false. */ public boolean isAlreadyDefined( Experiment experiment ) { return experiments.containsKey( experiment.getAc() ); }
/** * Declare in the session that the given experiment has been already converted in XML. * * @param experiment the experiment to declare as already converted. */ public void declareAlreadyDefined( Experiment experiment ) { experiments.put( experiment.getAc(), null ); }
/** * Tells if the given IntAct experiment has already been generated in PSI. * * @param experiment the experiment we want to know if it has already been converted to PSI. * * @return true is the experiment has already been converted to XML, otherwise false. */ public boolean isAlreadyDefined( Experiment experiment ) { return experiments.containsKey( experiment.getAc() ); }
/** * Declare in the session that the given experiment has been already converted in XML. * * @param experiment the experiment to declare as already converted. */ public void declareAlreadyDefined( Experiment experiment ) { experiments.put( experiment.getAc(), null ); }
public void addExperiment( Experiment experiment ) { if ( experiment == null ) { throw new NullPointerException( "experiment must not be null." ); } if ( !experiments.contains( experiment ) ) { if ( experiment.getPublication() != this ) { throw new IllegalStateException( "You cannot overwrite an Experiment's publication (experiment:"+ experiment.getAc() +"). " + "You must first unlink the underlying experiments from their publication" ); } else { experiment.setPublication( this ); } experiments.add( experiment ); } }
public void addExperiment( Experiment experiment ) { if ( experiment == null ) { throw new NullPointerException( "experiment must not be null." ); } if ( !experiments.contains( experiment ) ) { final Publication pub = experiment.getPublication(); if ( pub != null && pub != this ) { throw new IllegalStateException( "You cannot overwrite an Experiment's publication (experiment:"+ experiment.getAc() +"). " + "You must first unlink the underlying experiments from their publication" ); } else { experiment.setPublication( this ); } experiments.add( experiment ); } }
public void addExperiment( Experiment experiment ) { if ( experiment == null ) { throw new NullPointerException( "experiment must not be null." ); } if ( !experiments.contains( experiment ) ) { final Publication pub = experiment.getPublication(); if ( pub != null && pub != this ) { throw new IllegalStateException( "You cannot overwrite an Experiment's publication (experiment:"+ experiment.getAc() +"). " + "You must first unlink the underlying experiments from their publication" ); } else { experiment.setPublication( this ); } experiments.add( experiment ); } }
@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(); } }
@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(); } }
public void removeExperiment( Experiment experiment ) { if ( experiment == null ) { throw new NullPointerException( "experiment must not be null." ); } if ( !experiments.contains( experiment ) ) { experiments.remove( experiment ); if ( experiment.getPublication() != null && experiment.getPublication() != this ) { throw new IllegalStateException( "The experiment ("+ experiment.getAc() + ") you are trying to remove is linked to an other publication ("+ experiment.getPublication().getAc() +")." ); } else { experiment.setPublication( null ); } } }
public Collection<GeneralMessage> check(Experiment experiment) throws SanityRuleException { Collection<GeneralMessage> messages = new ArrayList<GeneralMessage>(); int interactionCount = 0; if (experiment.getAc() != null) { interactionCount = IntactContext.getCurrentInstance().getDataContext().getDaoFactory() .getExperimentDao().countInteractionsForExperimentWithAc(experiment.getAc()); } if (interactionCount == 0) { interactionCount = experiment.getInteractions().size(); } if(interactionCount == 0){ messages.add(new GeneralMessage( MessageDefinition.EXPERIMENT_WITHOUT_INTERACTION, experiment )); } return messages; } }
public void removeExperiment( Experiment experiment ) { if ( experiment == null ) { throw new NullPointerException( "experiment must not be null." ); } if ( !experiments.contains( experiment ) ) { if ( experiment.getPublication() != null && experiment.getPublication() != this ) { throw new IllegalStateException( "The experiment ("+ experiment.getAc() + ") you are trying to remove is linked to another publication ("+ experiment.getPublication().getAc() +")." ); } else { experiment.setPublication( null ); } } else { experiments.remove( experiment ); experiment.setPublication( null ); } }
public void removeExperiment( Experiment experiment ) { if ( experiment == null ) { throw new NullPointerException( "experiment must not be null." ); } if ( !experiments.contains( experiment ) ) { if ( experiment.getPublication() != null && experiment.getPublication() != this ) { throw new IllegalStateException( "The experiment ("+ experiment.getAc() + ") you are trying to remove is linked to another publication ("+ experiment.getPublication().getAc() +")." ); } else { experiment.setPublication( null ); } } else { experiments.remove( experiment ); experiment.setPublication( null ); } }
/** * Retrieves the interactions from an experiment, initializing them if necessary. * * @param experiment the experiment * @return The returned interactions are ensured to be initialized * @since 2.4.0 */ public static Collection<Interaction> ensureInitializedInteractions(Experiment experiment) { Collection<Interaction> interactions; if (IntactCore.isInitialized(experiment.getInteractions())) { interactions = experiment.getInteractions(); } else { interactions = IntactContext.getCurrentInstance().getDaoFactory().getInteractionDao().getByExperimentAc(experiment.getAc(), 0, Integer.MAX_VALUE); } return interactions; }
/** * Retrieves the interactions from an experiment, initializing them if necessary. * * @param experiment the experiment * @return The returned interactions are ensured to be initialized * @since 2.4.0 */ public static Collection<Interaction> ensureInitializedInteractions(Experiment experiment) { Collection<Interaction> interactions; if (IntactCore.isInitialized(experiment.getInteractions())) { interactions = experiment.getInteractions(); } else { interactions = IntactContext.getCurrentInstance().getDaoFactory().getInteractionDao().getByExperimentAc(experiment.getAc(), 0, Integer.MAX_VALUE); } return interactions; }