public CrossReference createCrossReference( String db, String id, String text ) { return new CrossReferenceImpl( db, id, text ); }
public CrossReferenceImpl(String database, String identifier) { setIdentifier(identifier); setDatabase(database); }
public CrossReferenceImpl(String database, String identifier, String text) { this(database, identifier); setText(text); }
public CrossReference createCrossReference( String db, String id ) { return new CrossReferenceImpl( db, id ); }
public CrossReference createUniprotCrossReference( String id ) { return new CrossReferenceImpl( "uniprotkb", id ); }
private void updateIdentifiers(Collection<CrossReference> psiIdentifier, Collection<CrossReference> psiAlternativeIdentifier, Map<String, String> encoreInteractors, String encoreInteractor) { for(String db:encoreInteractors.keySet()){ String acc = encoreInteractors.get(db); if(acc == encoreInteractor){ CrossReference pI = new CrossReferenceImpl(db,acc); psiIdentifier.add(pI); } else { CrossReference pI = new CrossReferenceImpl(db,acc); psiAlternativeIdentifier.add(pI); } } }
public OrganismImpl( int taxid ) { addIdentifier( new CrossReferenceImpl( DEFAULT_DATABASE, String.valueOf( taxid ) ) ); }
public OrganismImpl( int taxid, String name ) { addIdentifier( new CrossReferenceImpl( DEFAULT_DATABASE, String.valueOf( taxid ), name ) ); }
public BinaryInteraction createInteraction( Interactor a, Interactor b ) { BinaryInteraction bi = buildInteraction( a, b ); bi.getDetectionMethods().add( new CrossReferenceImpl("psi-mi", "MI:0071", "molecular sieving" ) ); return bi; }
object = new CrossReferenceImpl("psi-mi", "MI:1060", "spoke expansion"); } else if (field.equalsIgnoreCase("matrix")) { object = new CrossReferenceImpl("psi-mi", "MI:1061", "matrix expansion"); } else if (field.equalsIgnoreCase("bipartite")) { object = new CrossReferenceImpl("psi-mi", "MI:1062", "bipartite expansion"); } else if (!result[0].equalsIgnoreCase("-")) { throw new IllegalFormatException("String cannot be parsed to create a cross reference (check the syntax): " + ArrayUtils.toString(result)); object = new CrossReferenceImpl(result[0], result[1]); } else if (length == 3) { object = new CrossReferenceImpl(result[0], result[1], result[2]);
private CrossReference buildCrossReference(DbReference ref) { return new CrossReferenceImpl(ref.getDb(), ref.getId()); }
protected CrossReference createCrossReferenceFromAc(uk.ac.ebi.intact.model.Interactor mol) { CrossReference acField = new CrossReferenceImpl(); String db = defaultInstitution; acField.setDatabase(db); acField.setIdentifier(mol.getAc()); return acField; }
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; }
myCv = new CrossReferenceImpl(db, id, name);
public CrossReference createCrossReference(Xref xref, boolean withText) { CrossReference ref = null; String db = xref.getCvDatabase() != null ? xref.getCvDatabase().getShortLabel() : DATABASE_UNKNOWN; String id = xref.getPrimaryId(); if (id != null && db != null) { String secondaryId = (withText && xref.getSecondaryId() != null) ? xref.getSecondaryId() : null; String cvXrefQualifier = (withText && xref.getCvXrefQualifier() != null) ? xref.getCvXrefQualifier().getShortLabel() : null; if (secondaryId != null) { ref = new CrossReferenceImpl(db, id, secondaryId); } else if (cvXrefQualifier != null) { ref = new CrossReferenceImpl(db, id, cvXrefQualifier); } else { ref = new CrossReferenceImpl(db, id, null); } } return ref; } }
public CrossReference toMitab( Bibref bibref ) { CrossReference cr = null; if ( bibref != null && bibref.getXref() != null ) { Collection<DbReference> refs = XrefUtils.searchByType( bibref.getXref(), PRIMARY_REFERENCE, PRIMARY_REFERENCE_REF ); for ( DbReference ref : refs ) { if ( cr == null ) { cr = new CrossReferenceImpl( ref.getDb(), ref.getId() ); } else { log.warn( "More than once " + PRIMARY_REFERENCE + " found, first one was chosen." ); } } } return cr; }
public CrossReference toCrossReference( O cvObject ) { if ( cvObject == null ) { throw new IllegalArgumentException( "CvObject must not be null. " ); } // name of the cv is the fullname String text = cvObject.getFullName()!= null ? cvObject.getFullName() : cvObject.getShortLabel(); String identity = cvObject.getIdentifier(); if(identity == null ) { throw new NullPointerException( cvObject.getClass().getSimpleName() + "("+ text +") didn't have an identity" ); } final CvObjectXref idXref = findMatchingIdentityXref(cvObject.getXrefs(), identity); //XrefUtils.getIdentityXref(cvObject, CvDatabase.PSI_MI_MI_REF); if (idXref != null){ try { CrossReference ref = crossRefConverter.createCrossReference(idXref, false); ref.setText(text); return ref; } catch ( Exception e ) { throw new RuntimeException( "An exception occured while building a cv object : " + text, e ); } } else { CrossReference ref = new CrossReferenceImpl(CrossReferenceConverter.DATABASE_UNKNOWN, identity, text); return ref; } }
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; }
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; } }
interactionConverter.addSourceDatabase(new CrossReferenceImpl(sourceDb, sourceId, sourceName)); } else { interactionConverter.addSourceDatabase(new CrossReferenceImpl(UNKNOWN, sourceName, sourceName)); List<CrossReference> complexExpansion = new ArrayList<CrossReference>(); if (expansionName.equalsIgnoreCase("spoke")) { complexExpansion.add(new CrossReferenceImpl(PSI_MI, "MI:1060", "spoke expansion")); } else if (expansionName.equalsIgnoreCase("matrix")) { complexExpansion.add(new CrossReferenceImpl(PSI_MI, "MI:1061", "matrix expansion")); } else if (expansionName.equalsIgnoreCase("bipartite")) { complexExpansion.add(new CrossReferenceImpl(PSI_MI, "MI:1062", "bipartite expansion"));