public void onCommonNameUpdate(Organism organism, String oldCommonName) { if (oldCommonName == null){ organismChangeListener.log(Level.INFO, "The common name has been initialised for the organism " + organism.toString()); } else if (organism.getCommonName() == null){ organismChangeListener.log(Level.INFO, "The common name has been reset for the organism " + organism.toString()); } else { organismChangeListener.log(Level.INFO, "The common name "+oldCommonName+" has been updated with " + organism.getCommonName() + " in the organism " + organism.toString()); } }
if (organism.getCommonName() != null){ writer.write("("); escapeAndWriteString(organism.getCommonName()); writer.write(")");
/** * Maps the provided protein to a uniprot identifier. * @param proteinToMap the protein to be Mapped */ public void map(Protein proteinToMap) throws BridgeFailedException { if(proteinToMap == null){ throw new IllegalArgumentException("Cannot remap a null protein"); } clear(); IdentificationContext context = new IdentificationContext(); if( proteinToMap.getOrganism() != null ) context.setOrganism(new BioSource(proteinToMap.getOrganism().getCommonName() != null ? proteinToMap.getOrganism().getCommonName() : "not specified", Integer.toString(proteinToMap.getOrganism().getTaxId()))); if(priorityIdentifiers == prioritySequence) mapWithBothPriorities(proteinToMap, context); else if(priorityIdentifiers) mapWithPriorityToIdentifiers(proteinToMap, context); else if(prioritySequence) mapWithPriorityToSequence(proteinToMap, context); }
public void write(Organism object) throws IOException { MIJsonUtils.writeStartObject(writer); MIJsonUtils.writeProperty("taxid", Integer.toString(object.getTaxId()), writer); if (object.getCommonName() != null){ MIJsonUtils.writeSeparator(writer); MIJsonUtils.writeProperty("common", JSONValue.escape(object.getCommonName()), writer); } if (object.getScientificName() != null){ MIJsonUtils.writeSeparator(writer); MIJsonUtils.writeProperty("scientific", JSONValue.escape(object.getScientificName()), writer); } writeOtherProperties(object); MIJsonUtils.writeEndObject(writer); }
/*** * This method will copy properties of organism source in organism target and will override all the other properties of Target organism. * @param source * @param target */ public static void copyAndOverrideOrganismProperties(Organism source, Organism target){ if (source != null && target != null){ target.setCommonName(source.getCommonName()); target.setScientificName(source.getScientificName()); target.setCellType(source.getCellType()); target.setTissue(source.getTissue()); target.setCompartment(source.getCompartment()); target.setTaxId(source.getTaxId()); // copy collections target.getAliases().clear(); target.getAliases().addAll(source.getAliases()); } } }