public void onTaxidUpdate(Organism organism, String oldTaxid) { organismChangeListener.log(Level.INFO, "The taxid "+oldTaxid+" has been updated with " + organism.getTaxId() + " in the organism " + organism.toString()); }
/** * * @param organism * @return the hashcode consistent with the equals method for this comparator */ public static int hashCode(Organism organism){ if (organismTaxIdComparator == null){ organismTaxIdComparator = new OrganismTaxIdComparator(); } if (organism == null){ return 0; } int hashcode = 31; hashcode = 31*hashcode + organism.getTaxId(); return hashcode; } }
/** * To know if the host organism respects the host requirements * @param host * @return */ private boolean isApplicableHostOrganism(psidev.psi.mi.jami.model.Organism host){ if (this.requirements.hasHostRequirements()){ Set<String> validHosts = this.requirements.getApplicableHostOrganisms(); String taxId = Integer.toString(host.getTaxId()); if (validHosts.contains(taxId)){ return true; } for (String h : validHosts){ String math = getMathematicalOperator(h); if (math != null){ String hostNotAllowed = h.substring(math.length()); if (math.toLowerCase().equals(different) && taxId != hostNotAllowed){ return true; } } } return false; } return true; }
String organismType ) { int taxId = organism.getTaxId(); switch ( taxId ) {
private void generateChecksums(Protein p) throws BridgeFailedException { // CHECKSUMS if(p.getSequence() != null){ //TODO add an MI term if one is created p.getChecksums().add(ChecksumUtils.createChecksum("crc64", Crc64Generator.computeCrc64For(p.getSequence()))); if(p.getOrganism() != null){ try { String rogidValue = rogidGenerator.computeRogidFrom( p.getSequence(), Integer.toString(p.getOrganism().getTaxId())); p.setRogid(rogidValue); } catch (SeguidException e) { throw new BridgeFailedException( "Error was encountered whilst generating RogID in protein fetcher.",e); } } } }
String organismType ) { int taxId = organism.getTaxId(); switch ( taxId ) {
/** * 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); }
/*** * 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()); } } }
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); }
/** * * @param organism * @return the hashcode consistent with the equals method for this comparator */ public static int hashCode(Organism organism){ if (unambiguousOrganismComparator == null){ unambiguousOrganismComparator = new UnambiguousOrganismComparator(); } if (organism == null){ return 0; } int hashcode = 31; hashcode = 31*hashcode + organism.getTaxId(); CvTerm cellType = organism.getCellType(); hashcode = 31*hashcode + UnambiguousCvTermComparator.hashCode(cellType); CvTerm tissue = organism.getTissue(); hashcode = 31*hashcode + UnambiguousCvTermComparator.hashCode(tissue); CvTerm compartment = organism.getCompartment(); hashcode = 31*hashcode + UnambiguousCvTermComparator.hashCode(compartment); return hashcode; } }
final StringBuffer msg = new StringBuffer( 1024 ); msg.append("The interaction detection method "+ Term.printTerm(methodTerm)+" " + "is not normally associated with the interaction type "+ Term.printTerm(brTerm)+" when the host organism is " + host.getTaxId() + "." + " In this case, the possible interaction types are "); final StringBuffer msg = new StringBuffer( 1024 ); msg.append("The organism " + host.getTaxId() + " is unusual. When the interaction detection method is "+ Term.printTerm(methodTerm) +" and " + "the interaction type is " + Term.printTerm(brTerm) + " the host organism should be : ") ; for (String validHost : cond.getRequirements().getApplicableHostOrganisms()){