private void updateExperimentParticipantDetectionMethod(Interaction interaction) { for (Experiment experiment : interaction.getExperiments()) { if (experiment.getCvIdentification() == null) { String partDetMethod = calculateParticipantDetMethod(interaction.getComponents()); if (partDetMethod != null) { final String message = "Experiment ("+ experiment.getShortLabel() +") without participant detection method. One was calculated from the components: " + partDetMethod; addMessageToContext(MessageLevel.INFO, message, true); if (log.isWarnEnabled()) { log.warn(message); } CvIdentification detMethod = CvObjectUtils.createCvObject(experiment.getOwner(), CvIdentification.class, partDetMethod, "undefined"); experiment.setCvIdentification(detMethod); } else { final String message = "Neither the Experiment nor its participants have CvIdentification (participant detection method). Using the term \"experimental particp\" (MI:0661)."; if (log.isWarnEnabled()) log.warn(": Experiment '"+experiment.getShortLabel()+ "', Interaction '"+interaction.getShortLabel()+"' - Location: "+ConverterContext.getInstance().getLocation().getCurrentLocation().pathFromRootAsString()); addMessageToContext(MessageLevel.WARN, message, true); CvIdentification detMethod = CvObjectUtils.createCvObject(experiment.getOwner(), CvIdentification.class, "MI:0661", "experimental particp"); experiment.setCvIdentification(detMethod); } } } }
ExperimentXref xref = new ExperimentXref(experiment.getOwner(), newt, bioSourceToAdd.getTaxId(), bioSourceToAdd.getLabel(), null, targetSpeciesQualifier); experiment.addXref(xref);
/** * 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; }