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); }
public CvObjectStatsUnit(CvObject cvObject) { super(cvObject); identifier = CvObjectUtils.getIdentity(cvObject); }
public String getBiologicalRoleMi() { if (biologicalRoleMi != null) { return biologicalRoleMi; } biologicalRoleMi = CvObjectUtils.getPsiMiIdentityXref(biologicalRole).getPrimaryId(); return biologicalRoleMi; }
if (CvObjectUtils.isProteinType(interactorType) || CvObjectUtils.isPeptideType(interactorType)) { setObjClass(ProteinImpl.class.getName()); setCategory("protein"); } else if (CvObjectUtils.isInteractionType(interactorType)) { setObjClass(InteractionImpl.class.getName()); } else if (CvObjectUtils.isSmallMoleculeType(interactorType) || CvObjectUtils.isPolysaccharideType(interactorType)) { setObjClass(SmallMoleculeImpl.class.getName()); setCategory("bioactive_entity"); } else if (CvObjectUtils.isNucleicAcidType(interactorType)) { setObjClass(NucleicAcidImpl.class.getName()); setCategory("nucleic_acid"); } else if (CvObjectUtils.isGeneType(interactorType)) { setObjClass(InteractorImpl.class.getName()); setCategory("gene"); } else if (CvObjectUtils.isComplexType(interactorType)) { }else if (CvObjectUtils.isMoleculeSetType(interactorType)) { setObjClass(InteractorImpl.class.getName()); setCategory("interactor_pool");
protected void updateCVsUsingAnnotationDataset(List<CvDagObject> allCvs, AnnotationInfoDataset annotationInfoDataset, CorePersister corePersister) { for ( CvDagObject cvObject : allCvs ) { final String identity = CvObjectUtils.getIdentity( cvObject ); if ( identity != null && annotationInfoDataset.containsCvAnnotation( identity ) ) { AnnotationInfo annotInfo = annotationInfoDataset.getCvAnnotation( identity ); // check if the topic has already been processed CvTopic topic = createdNonMiTopics.get(annotInfo.getTopicShortLabel()); // if not, try to get it from the database if (topic == null) { topic = IntactContext.getCurrentInstance().getDataContext().getDaoFactory() .getCvObjectDao(CvTopic.class).getByShortLabel(CvTopic.class, annotInfo.getTopicShortLabel()); // if it is not in the database, create it and persist it. if (topic == null) { topic = CvObjectUtils.createCvObject( IntactContext.getCurrentInstance().getInstitution(), CvTopic.class, null, annotInfo.getTopicShortLabel() ); corePersister.saveOrUpdate(topic); } // now it has been created createdNonMiTopics.put(annotInfo.getTopicShortLabel(), topic); } // create the corresponding annotation Annotation annotation = new Annotation( IntactContext.getCurrentInstance().getInstitution(), topic, annotInfo.getReason() ); addAnnotation( annotation, cvObject, annotInfo.isApplyToChildren() ); } } }
public static boolean isComplexType(CvInteractorType type) { return isChildOfType(type, CvInteractorType.COMPLEX_MI_REF, true); }
/** * This method is an alternative equals to the CvObject.equals method, that basically checks * on the MI identifiers and then of the short label if the first check returns false * * @param cv1 One of the CvObjects * @param cv2 The other CvObject * @return True if (A) the MI are the same or (B) the short labels are the same in case A has failed * @since 1.8.0 */ public static boolean areEqual(CvObject cv1, CvObject cv2) { return areEqual(cv1, cv2, false); }
/** * Collect a non redundant list of all children psi-mi identity identifier including the given root term's. * * @param root term from which we start traversing children. * @return a non null collection of MIs. */ public static Set<String> getChildrenMIs(CvDagObject root) { Set<String> collectedMIs = new HashSet<String>(); getChildrenMIs(root, collectedMIs); return collectedMIs; }
@Transient private boolean hasMiIdentity( String miRef ) { if (getIdentifier() != null) { return getIdentifier().equals(miRef); } else { return CvObjectUtils.hasIdentity( this, miRef ); } } }
public Confidence createConfidenceRandom() { CvConfidenceType cvConfidenceType = CvObjectUtils.createIntactCvObject(getInstitution(), CvConfidenceType.class, "IA:"+ new Random().nextInt(1000), nextString( "cv")); Confidence conf = createConfidence(cvConfidenceType, Double.toString( new Random().nextDouble())); return conf; }
if (CvObjectUtils.isProteinType(interactorType) || CvObjectUtils.isPeptideType(interactorType)) { setObjClass(ProteinImpl.class.getName()); setCategory("protein"); } else if (CvObjectUtils.isInteractionType(interactorType)) { setObjClass(InteractionImpl.class.getName()); } else if (CvObjectUtils.isSmallMoleculeType(interactorType) || CvObjectUtils.isPolysaccharideType(interactorType)) { setObjClass(SmallMoleculeImpl.class.getName()); setCategory("bioactive_entity"); } else if (CvObjectUtils.isNucleicAcidType(interactorType)) { setObjClass(NucleicAcidImpl.class.getName()); setCategory("nucleic_acid"); } else if (CvObjectUtils.isGeneType(interactorType)) { setObjClass(InteractorImpl.class.getName()); setCategory("gene"); } else if (CvObjectUtils.isComplexType(interactorType)) { }else if (CvObjectUtils.isMoleculeSetType(interactorType)) { setObjClass(InteractorImpl.class.getName()); setCategory("interactor_pool");
public static boolean isPeptideType(CvInteractorType type) { return isChildOfType(type, CvInteractorType.PEPTIDE_MI_REF, true); }
/** * This method is an alternative equals to the CvObject.equals method, that basically checks * on the MI identifiers and then of the short label if the first check returns false * * @param cv1 One of the CvObjects * @param cv2 The other CvObject * @return True if (A) the MI are the same or (B) the short labels are the same in case A has failed * @since 1.8.0 */ public static boolean areEqual(CvObject cv1, CvObject cv2) { return areEqual(cv1, cv2, false); }
/** * Collect a non redundant list of all children psi-mi identity identifier including the given root term's. * * @param root term from which we start traversing children. * @return a non null collection of MIs. */ public static Set<String> getChildrenMIs(CvDagObject root) { Set<String> collectedMIs = new HashSet<String>(); getChildrenMIs(root, collectedMIs); return collectedMIs; }
@Transient private boolean hasMiIdentity( String miRef ) { if (getIdentifier() != null) { return getIdentifier().equals(miRef); } else { return CvObjectUtils.hasIdentity( this, miRef ); } } }
public Confidence createConfidenceRandom() { CvConfidenceType cvConfidenceType = CvObjectUtils.createIntactCvObject(getInstitution(), CvConfidenceType.class, "IA:"+ new Random().nextInt(1000), nextString( "cv")); Confidence conf = createConfidence(cvConfidenceType, Double.toString( new Random().nextDouble())); return conf; }
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); }
public String getExperimentalRoleMi() { if (experimentalRoleMi != null) { return experimentalRoleMi; } experimentalRoleMi = CvObjectUtils.getPsiMiIdentityXref(experimentalRole).getPrimaryId(); return experimentalRoleMi; }
public CvObjectStatsUnit(CvObject cvObject) { super(cvObject); identifier = CvObjectUtils.getIdentity(cvObject); }
public static boolean isNucleicAcidType(CvInteractorType type) { return isChildOfType(type, CvInteractorType.NUCLEIC_ACID_MI_REF, true); }