private void clearExperimentDetails(){ if (this.binaryTemplate != null){ this.binaryTemplate.setDetectionMethods(new ArrayList<CrossReference>()); this.binaryTemplate.setHostOrganism(new OrganismImpl()); } } }
public Organism createOrganismRandom() { return new OrganismImpl( nextInt(), randomString() ); }
public static Organism splitOrganism(String column) throws IllegalFormatException { Organism organism = null; if (column != null && !column.isEmpty()) { organism = new OrganismImpl(); String[] result = MitabParserUtils.quoteAwareSplit(column, new char[]{'|'}, false); for (String r : result) { if (r != null) { String[] fields = MitabParserUtils.quoteAwareSplit(r, new char[]{':', '(', ')'}, true); if (fields != null) { int length = fields.length; // some exception handling if (length == 0 || length > 3) { throw new IllegalFormatException("String cannot be parsed to create a organism (check the syntax): " + Arrays.asList(result).toString()); } if (length == 1) { if (!result[0].equalsIgnoreCase("-")) { throw new IllegalFormatException("String cannot be parsed to create a organism (check the syntax): " + Arrays.asList(result).toString()); } } else if (length == 2) { organism.addIdentifier(new CrossReferenceImpl(fields[0], fields[1])); } else if (length == 3) { organism.addIdentifier(new CrossReferenceImpl(fields[0], fields[1], fields[2])); } } } } } return organism; }
public Interactor createInteractor( int taxid, String db, String id, String txt ) { CrossReference cr = new CrossReferenceImpl( db, id, txt ); final Interactor interactor = buildInteractor(); interactor.setIdentifiers( createList( cr ) ); Organism o = new OrganismImpl( taxid ); interactor.setOrganism( o ); return interactor; }
protected void populateInteractor(Interactor source, Interactor target) { if (target != null && source != null){ target.getAlternativeIdentifiers().addAll(source.getAlternativeIdentifiers()); target.getAliases().addAll(source.getAliases()); if ( !target.hasOrganism() ) { target.setOrganism(new OrganismImpl()); } if( source.hasOrganism() ) { target.getOrganism().getIdentifiers().addAll(source.getOrganism().getIdentifiers()); } target.getAnnotations().addAll(source.getAnnotations()); target.getBiologicalRoles().addAll(source.getBiologicalRoles()); target.getChecksums().addAll(source.getChecksums()); target.getFeatures().addAll(source.getFeatures()); target.getInteractorTypes().addAll(source.getInteractorTypes()); target.getParticipantIdentificationMethods().addAll(source.getParticipantIdentificationMethods()); target.getStoichiometry().addAll(source.getStoichiometry()); target.getXrefs().addAll(source.getXrefs()); } } }
Organism psiOrganismA = new OrganismImpl(); psiOrganismA.setIdentifiers(encoreInteraction.getOrganismsA()); Organism psiOrganismB = new OrganismImpl(); psiOrganismB.setIdentifiers(encoreInteraction.getOrganismsB());
Organism psiOrganismA = new OrganismImpl(); psiOrganismA.setIdentifiers(encoreInteraction.getOrganismsA()); Organism psiOrganismB = new OrganismImpl(); psiOrganismB.setIdentifiers(encoreInteraction.getOrganismsB());
tabInteractor.setOrganism(new OrganismImpl(organismXrefs));
public Organism intactToMitab(BioSource organism){ if (organism != null && organism.getTaxId() != null){ Organism mitabOrganism = new OrganismImpl(); String name = organism.getShortLabel(); String fullName = organism.getFullName(); String taxId = organism.getTaxId(); if (name != null){ mitabOrganism.addIdentifier(new CrossReferenceImpl(TAXID, organism.getTaxId(), name)); } if (fullName != null){ mitabOrganism.addIdentifier(new CrossReferenceImpl(TAXID, organism.getTaxId(), fullName)); } return mitabOrganism; } return null; } }