@Deprecated public CvXrefQualifier createIdentityCvXrefQualifier(IntactContext intactContext) { return createIdentityCvXrefQualifier(intactContext.getInstitution()); }
@Deprecated public CvXrefQualifier createIdentityCvXrefQualifier(IntactContext intactContext) { return createIdentityCvXrefQualifier(intactContext.getInstitution()); }
@Deprecated public CvDatabase createPsiMiCvDatabase(IntactContext intactContext) { return createPsiMiCvDatabase(intactContext.getInstitution()); }
@Deprecated public CvDatabase createPsiMiCvDatabase(IntactContext intactContext) { return createPsiMiCvDatabase(intactContext.getInstitution()); }
private static CvFuzzyType createCvFuzzyType(String position) { if (position == null) { throw new IllegalArgumentException("The range position cannot be null."); } for (String key : rangeStatusMap.keySet()) { if (position.toLowerCase().contains(key)) { return rangeStatusMap.get(key); } } return CvObjectUtils.createCvObject(IntactContext.getCurrentInstance().getInstitution(), CvFuzzyType.class, CvFuzzyType.CERTAIN_MI_REF, CvFuzzyType.CERTAIN); }
private static CvFuzzyType createCvFuzzyType(String position) { if (position == null) { throw new IllegalArgumentException("The range position cannot be null."); } for (String key : rangeStatusMap.keySet()) { if (position.toLowerCase().contains(key)) { return rangeStatusMap.get(key); } } return CvObjectUtils.createCvObject(IntactContext.getCurrentInstance().getInstitution(), CvFuzzyType.class, CvFuzzyType.CERTAIN_MI_REF, CvFuzzyType.CERTAIN); }
@PostConstruct private void init() { this.nonMiCvDatabase = CvObjectUtils.createCvObject( IntactContext.getCurrentInstance().getInstitution(), CvDatabase.class, CvDatabase.INTACT_MI_REF, CvDatabase.INTACT ); }
public CvObjectOntologyBuilder( OBOSession oboSession_ ) { oboSession = oboSession_; this.nonMiCvDatabase = CvObjectUtils.createCvObject( IntactContext.getCurrentInstance().getInstitution(), CvDatabase.class, CvDatabase.INTACT_MI_REF, CvDatabase.INTACT ); this.psimod = CvObjectUtils.createCvObject( IntactContext.getCurrentInstance().getInstitution(), CvDatabase.class, CvDatabase.PSI_MOD_MI_REF, CvDatabase.PSI_MOD ); this.processed = Maps.newHashMap(); this.map4misWithMoreParent = Maps.newHashMap(); map4misWithMoreParent = initializeMisWithMoreParents(); if ( log.isDebugEnabled() ) { log.debug( "map4misWithMoreParent size " + map4misWithMoreParent.size() ); } }
protected Alias toAlias( CvObject cvobj, String aliasName ) { Institution owner = IntactContext.getCurrentInstance().getInstitution(); CvAliasType alias = getCvObjectByLabel( CvAliasType.class, CvAliasType.GO_SYNONYM ); if ( alias == null ) { if ( log.isTraceEnabled() ) log.trace( "alias ==null creating new" ); alias = CvObjectUtils.createCvObject( owner, CvAliasType.class, CvAliasType.GO_SYNONYM_MI_REF, CvAliasType.GO_SYNONYM ); } return AliasUtils.createAlias( cvobj, aliasName, alias ); }
protected Annotation toAnnotation( String cvTopic, String annotation ) { Institution owner = IntactContext.getCurrentInstance().getInstitution(); CvTopic topic = getCvObjectByLabel( CvTopic.class, cvTopic ); if ( topic == null ) { if ( CvTopic.URL.equalsIgnoreCase( cvTopic ) ) { topic = CvObjectUtils.createCvObject( owner, CvTopic.class, CvTopic.URL_MI_REF, CvTopic.URL ); } else if ( CvTopic.SEARCH_URL.equalsIgnoreCase( cvTopic ) ) { topic = CvObjectUtils.createCvObject( owner, CvTopic.class, CvTopic.SEARCH_URL_MI_REF, CvTopic.SEARCH_URL ); } else if ( CvTopic.XREF_VALIDATION_REGEXP.equalsIgnoreCase( cvTopic ) ) { topic = CvObjectUtils.createCvObject( owner, CvTopic.class, CvTopic.XREF_VALIDATION_REGEXP_MI_REF, CvTopic.XREF_VALIDATION_REGEXP ); } else if ( CvTopic.COMMENT.equalsIgnoreCase( cvTopic ) ) { topic = CvObjectUtils.createCvObject( owner, CvTopic.class, CvTopic.COMMENT_MI_REF, CvTopic.COMMENT ); } else if ( CvTopic.OBSOLETE.equalsIgnoreCase( cvTopic ) ) { topic = CvObjectUtils.createCvObject( owner, CvTopic.class, CvTopic.OBSOLETE_MI_REF, CvTopic.OBSOLETE ); topic.setFullName( CvTopic.OBSOLETE ); } else { log.error( "Unexpected topic found on annotation: " + cvTopic ); return null; } } if ( log.isTraceEnabled() ) log.debug( "Returning from toAnnotation: owner: " + owner + " topic: " + topic + " annotation " + annotation ); return new Annotation( owner, topic, annotation ); }
public Institution getDefaultInstitutionForAcs() { if (defaultInstitutionForAcs == null && IntactContext.currentInstanceExists()) { defaultInstitutionForAcs = IntactContext.getCurrentInstance().getInstitution(); if (defaultInstitutionForAcs != null) { InstitutionXref xref = XrefUtils.getPsiMiIdentityXref(defaultInstitutionForAcs); if (xref != null) { defaultInstitutionPrimaryIdForAcs = xref.getPrimaryId(); } } } return defaultInstitutionForAcs; }
/** * * @param xref the xref to check * @return */ private boolean xrefPointsToOwnAc(Xref xref) { if (xref.getPrimaryId().startsWith(config.getAcPrefix())) { return true; } else { for (InstitutionXref institutionXref : IntactContext.getCurrentInstance().getInstitution().getXrefs()) { if (institutionXref.getPrimaryId().equals(xref.getCvDatabase().getIdentifier())) { return true; } } return false; } }
/** * * @param xref the xref to check * @return */ private boolean xrefPointsToOwnAc(Xref xref) { if (xref.getPrimaryId().startsWith(config.getAcPrefix())) { return true; } else { for (InstitutionXref institutionXref : IntactContext.getCurrentInstance().getInstitution().getXrefs()) { if (institutionXref.getPrimaryId().equals(xref.getCvDatabase().getIdentifier())) { return true; } } return false; } }
public static <X extends Xref> X createIdentityXref(AnnotatedObject<X, ?> parent, String primaryId, CvXrefQualifier identityQual, CvDatabase cvDatabase) { X xref = (X) newXrefInstanceFor(parent.getClass()); Institution owner = parent.getOwner(); if (owner == null) { owner = IntactContext.getCurrentInstance().getInstitution(); } xref.setOwner(owner); xref.setCvDatabase(cvDatabase); xref.setCvXrefQualifier(identityQual); xref.setPrimaryId(primaryId); xref.setParent(parent); return xref; }
public static <X extends Xref> X createIdentityXref(AnnotatedObject<X, ?> parent, String primaryId, CvXrefQualifier identityQual, CvDatabase cvDatabase) { X xref = (X) newXrefInstanceFor(parent.getClass()); Institution owner = parent.getOwner(); if (owner == null) { owner = IntactContext.getCurrentInstance().getInstitution(); } xref.setOwner(owner); xref.setCvDatabase(cvDatabase); xref.setCvXrefQualifier(identityQual); xref.setPrimaryId(primaryId); xref.setParent(parent); return xref; }
/** * Create a new InteractorXref for the protein * @param uniprotAc : the uniprot accession * @return the InteractorXref with the uniprot ac and qualifier identity */ private InteractorXref createIdentityInteractorXrefForUniprotAc(String uniprotAc){ IntactContext intactContext = IntactContext.getCurrentInstance(); if (uniprotAc == null){ return null; } final CvDatabase uniprot = intactContext.getDaoFactory().getCvObjectDao(CvDatabase.class).getByPsiMiRef( CvDatabase.UNIPROT_MI_REF ); final CvXrefQualifier identity = intactContext.getDaoFactory().getCvObjectDao(CvXrefQualifier.class).getByPsiMiRef(CvXrefQualifier.IDENTITY_MI_REF); InteractorXref xRef = new InteractorXref(intactContext.getInstitution(), uniprot, uniprotAc, identity); return xRef; }
public static CvObjectXref createSecondaryXref(CvDagObject term, String database, String identifier) { DaoFactory factory = IntactContext.getCurrentInstance().getDaoFactory(); CvObjectXref cvXref; CvXrefQualifier secondary = factory.getCvObjectDao(CvXrefQualifier.class).getByPsiMiRef(CvXrefQualifier.SECONDARY_AC_MI_REF); CvDatabase db = factory.getCvObjectDao(CvDatabase.class).getByPsiMiRef(database); if (secondary == null){ secondary = CvObjectUtils.createCvObject(IntactContext.getCurrentInstance().getInstitution(), CvXrefQualifier.class, CvXrefQualifier.SECONDARY_AC_MI_REF, CvXrefQualifier.SECONDARY_AC); IntactContext.getCurrentInstance().getCorePersister().saveOrUpdate(secondary); } if (db == null){ db = CvObjectUtils.createCvObject(IntactContext.getCurrentInstance().getInstitution(), CvDatabase.class, database, database); IntactContext.getCurrentInstance().getCorePersister().saveOrUpdate(db); } // create identity xref cvXref = XrefUtils.createIdentityXref(term, identifier, secondary, db); term.addXref(cvXref); return cvXref; }
public static CvObjectXref createIdentityXref(CvDagObject term, String database, String identifier) { DaoFactory factory = IntactContext.getCurrentInstance().getDaoFactory(); CvObjectXref cvXref; CvXrefQualifier identity = factory.getCvObjectDao(CvXrefQualifier.class).getByPsiMiRef(CvXrefQualifier.IDENTITY_MI_REF); CvDatabase db = factory.getCvObjectDao(CvDatabase.class).getByPsiMiRef(database); if (identity == null){ identity = CvObjectUtils.createCvObject(IntactContext.getCurrentInstance().getInstitution(), CvXrefQualifier.class, CvXrefQualifier.IDENTITY_MI_REF, CvXrefQualifier.IDENTITY); IntactContext.getCurrentInstance().getCorePersister().saveOrUpdate(identity); } if (db == null){ db = CvObjectUtils.createCvObject(IntactContext.getCurrentInstance().getInstitution(), CvDatabase.class, database, database); IntactContext.getCurrentInstance().getCorePersister().saveOrUpdate(db); } // create identity xref cvXref = XrefUtils.createIdentityXref(term, identifier, identity, db); term.addXref(cvXref); return cvXref; }
public static Annotation hideTerm(CvObject c, String message){ DaoFactory factory = IntactContext.getCurrentInstance().getDaoFactory(); CvTopic topicFromDb = factory.getCvObjectDao(CvTopic.class).getByShortLabel(CvTopic.HIDDEN); if (topicFromDb == null){ topicFromDb = CvObjectUtils.createCvObject(IntactContext.getCurrentInstance().getInstitution(), CvTopic.class, null, CvTopic.HIDDEN); IntactContext.getCurrentInstance().getCorePersister().saveOrUpdate(topicFromDb); } Annotation newAnnotation = new Annotation(topicFromDb, message); c.addAnnotation(newAnnotation); return newAnnotation; }
private CvTopic createCvTopicObsolete() { final DaoFactory daoFactory = IntactContext.getCurrentInstance().getDataContext().getDaoFactory(); if ( obsoleteTopic != null ) { if (daoFactory.getBaseDao().isTransient(obsoleteTopic) && obsoleteTopic.getAc() != null) { obsoleteTopic = daoFactory.getCvObjectDao( CvTopic.class ).getByAc( obsoleteTopic.getAc() ); } } else { obsoleteTopic = daoFactory.getCvObjectDao( CvTopic.class ).getByPsiMiRef( CvTopic.OBSOLETE_MI_REF ); } if ( obsoleteTopic == null ) { // create the obsolete term (which is obsolete too!) obsoleteTopic = CvObjectUtils.createCvObject( IntactContext.getCurrentInstance().getInstitution(), CvTopic.class, CvTopic.OBSOLETE_MI_REF, CvTopic.OBSOLETE ); obsoleteTopic.setFullName( "obsolete term" ); addObsoleteAnnotation( obsoleteTopic, "Deprecated CV term that should not be used to annotate entries" ); } return obsoleteTopic; }