本文整理了Java中uk.ac.ebi.intact.model.Annotation
类的一些代码示例,展示了Annotation
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Annotation
类的具体详情如下:
包路径:uk.ac.ebi.intact.model.Annotation
类名称:Annotation
[英]Funtional description of an object.
[中]对一个物体的功能描述。
代码示例来源:origin: uk.ac.ebi.intact.core/intact-core
private Collection<String> convertAnnotToString(Collection<Annotation> annot){
Collection<String> annotations = new ArrayList<String>(annot.size());
for (Annotation a : annot){
if (a.getCvTopic() == null){
annotations.add(a.getAnnotationText() != null ? a.getAnnotationText() : "");
}
else {
annotations.add(a.getCvTopic().getShortLabel() + (a.getAnnotationText() != null ? a.getAnnotationText() : ""));
}
}
return annotations;
}
代码示例来源:origin: uk.ac.ebi.intact.core/intact-core
protected Annotation cloneAnnotation(Annotation annotation) throws IntactClonerException {
if (annotation == null) return null;
Annotation clone = new Annotation();
clonerManager.addClone(annotation, clone);
clone.setCvTopic(clone(annotation.getCvTopic()));
clone.setAnnotationText(annotation.getAnnotationText());
return clone;
}
代码示例来源:origin: uk.ac.ebi.intact.core/intact-core
@Deprecated
public Annotation( Institution owner, CvTopic topic ) {
//super call sets creation time data
super( );
setCvTopic( topic );
setOwner(owner);
}
代码示例来源:origin: uk.ac.ebi.intact.core/intact-core
public Annotation createAnnotation(String annotationText, CvTopic cvTopic) {
Annotation annotation = new Annotation(institution, cvTopic);
annotation.setAnnotationText(annotationText);
return annotation;
}
代码示例来源:origin: uk.ac.ebi.intact.core/intact-core
public static boolean sameAnnotation( Annotation a1, Annotation a2 ) {
if (a1.getAc() != null && a2.getAc() != null) {
return a1.getAc().equals(a2.getAc());
}
if ( !same( a1.getAnnotationText(), a2.getAnnotationText() ) ) {
return false;
}
if ( !CvObjectUtils.areEqual( a1.getCvTopic(), a2.getCvTopic() ) ) {
return false;
}
return true;
}
代码示例来源:origin: uk.ac.ebi.intact.dataexchange/intact-cvutils
if (this.areEqual(annot.getCvTopic(),annotation.getCvTopic())) {
if ( annot.getAnnotationText() != null
&& annot.getAnnotationText().equals( annotation.getAnnotationText() ) ) {
containsAnnotation = true;
break;
} else{
annot.setAnnotationText( annotation.getAnnotationText() );
IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getAnnotationDao().update( annot );
containsAnnotation = true;
final CvTopic topic = annotation.getCvTopic();
log.debug( "Added Annotation(" + topic.getShortLabel() + ", '" + annotation.getAnnotationText() +
"') onto " + cvObject.getClass().getSimpleName() + "(" + cvObject.getShortLabel() +
")" );
代码示例来源:origin: uk.ac.ebi.intact.core/intact-core-readonly
public static boolean isNegative(Interaction interaction) {
Collection<Annotation> annotations = fetchAnnotations(interaction);
for (Annotation annotation : annotations) {
if (annotation.getCvTopic() != null && annotation.getCvTopic().getShortLabel().equals(CvTopic.NEGATIVE)) {
return true;
}
}
return false;
}
代码示例来源:origin: uk.ac.ebi.intact.util/data-conversion
annotation = new Annotation( institution, cvTopic );
annotation.setAnnotationText( annotationTag.getText() );
IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getAnnotationDao().persist( annotation );
for ( Iterator iterator3 = _annotations.iterator(); iterator3.hasNext() && annotation == null; ) {
Annotation _annotation = (Annotation) iterator3.next();
if ( authorConfidence.equals( _annotation.getCvTopic() ) ) {
annotation = _annotation;
annotation = new Annotation( institution, authorConfidence );
annotation.setAnnotationText( confidence.getValue() );
IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getAnnotationDao().persist( annotation );
代码示例来源:origin: uk.ac.ebi.intact.dataexchange/intact-cvutils
if ( CvTopic.OBSOLETE_MI_REF.equals( CvObjectUtils.getIdentity( annot.getCvTopic() ) ) ) {
alreadyContainsObsolete = true;
if ( CvTopic.OBSOLETE_MI_REF.equals( CvObjectUtils.getIdentity( annot.getCvTopic() ) ) ) {
annotatedText = annot.getAnnotationText();
final Annotation annotation = new Annotation( existingCv.getOwner(), obsoleteTopic, annotatedText );
existingCv.addAnnotation( annotation );
stats.addUpdatedCv( existingCv );
代码示例来源:origin: uk.ac.ebi.intact.core/intact-core
private void markAsHidden(CvObject cv, CvTopic hidden) {
final Annotation hiddenAnnotation = new Annotation(hidden, null);
cv.addAnnotation(hiddenAnnotation);
corePersister.saveOrUpdate(cv);
}
代码示例来源:origin: uk.ac.ebi.intact.bridges.coredep/intact-cdb
Annotation annotation = new Annotation( institution, topic );
annotation.setAnnotationText( text );
Annotation newAnnotation = new Annotation( institution, topic );
newAnnotation.setAnnotationText( text );
String oldText = annotation.getAnnotationText();
annotation.setAnnotationText( text );
String _text = annotation.getAnnotationText();
experiment.removeAnnotation( annotation );
代码示例来源:origin: uk.ac.ebi.intact.core/intact-core
@Transient
@Deprecated
/**
* @deprecated now it is always stored as a simple annotation
*/
public String getPostalAddress() {
Annotation annot = AnnotatedObjectUtils.findAnnotationByTopicMiOrLabel(this, "postaladdress");
return annot != null ? annot.getAnnotationText() : null;
}
代码示例来源:origin: uk.ac.ebi.intact.core/intact-core-readonly
private Annotation synchronizeAnnotation( Annotation annotation, AnnotatedObject parent ) {
if (annotation.getAc() != null) {
return IntactContext.getCurrentInstance().getDataContext().getDaoFactory()
.getAnnotationDao().getByAc(annotation.getAc());
}
else {
}
annotation.setCvTopic( synchronize( annotation.getCvTopic() ) );
if (annotation.getAc() == null && parent.getAc() != null) {
annotatedObjectsToPersist.put(keyBuilder.keyForAnnotation(annotation, parent), annotation);
}
return annotation;
}
代码示例来源:origin: uk.ac.ebi.intact.dataexchange/intact-cvutils
@Override
public void visitAnnotation( Annotation annotation ) {
final CvTopic topic = annotation.getCvTopic();
final String mi = topic.getIdentifier();
if ( mi != null ) {
final CvTopic oboTerm = ( CvTopic ) mi2cv.get( createCvKey( topic.getClass(), mi ) );
if ( oboTerm == null ) {
log.warn( "Could not find topic " + topic.getClass().getSimpleName() + "( " + topic.getShortLabel() + " ) by MI: " + mi );
} else {
annotation.setCvTopic( oboTerm );
}
}
}
}
代码示例来源:origin: uk.ac.ebi.intact.core/intact-persister
CvTopic cvTopic = annotation.getCvTopic();
cvTopic = (CvTopic) cvPersister.syncIfTransient(annotation.getCvTopic());
annotation.setCvTopic(cvTopic);
annotation.setOwner(institutionPersister.syncIfTransient(annotation.getOwner()));
代码示例来源:origin: uk.ac.ebi.intact.dataexchange.psimi/intact-psixml-converters
if (CvTopic.NON_UNIPROT.equalsIgnoreCase(a.getCvTopic().getShortLabel())){
hasNoUniprotUpdate = true;
Annotation noUniprot = new Annotation(noUniprotUpdate);
protein.addAnnotation(noUniprot);
代码示例来源:origin: uk.ac.ebi.intact.core/intact-core
protected void traverseAnnotation(Annotation annotation, IntactVisitor... visitors) {
if (annotation == null) return;
for (IntactVisitor visitor : visitors) {
visitor.visitAnnotation(annotation);
}
// check if this element has been traversed already, to avoid cyclic recursion
if (recursionChecker.isAlreadyTraversed(annotation)) {
return;
}
traverse(annotation.getCvTopic(), visitors);
traverse(annotation.getOwner(), visitors);
}
代码示例来源:origin: uk.ac.ebi.intact.dataexchange.psimi/intact-psixml-converters
public static void populateAnnotations(Collection<Attribute> attributesToConvert, Annotated annotated, Institution institution) {
AnnotationConverter annotationConverter = new AnnotationConverter(institution);
if (!attributesToConvert.isEmpty()) {
for (Attribute attribute : attributesToConvert) {
Annotation annotation = annotationConverter.psiToIntact(attribute);
annotation.setOwner(institution);
if (!annotated.getAnnotations().contains(annotation)) {
annotated.getAnnotations().add(annotation);
}
}
}
}
代码示例来源:origin: uk.ac.ebi.intact.core/intact-core
/**
* Creates a valid Annotation instance. A valid instance must have at least
* a non-null Institution specified. A side-effect of this constructor is to
* set the <code>created</code> and <code>updated</code> fields of the instance
* to the current time.
*
* @param topic Refers to the controlled vocabulary topic this Annotation relates
* to. This should be non-null.
*
* @throws NullPointerException thrown if no Institution specified.
*/
public Annotation( CvTopic topic ) {
//super call sets creation time data
super( );
setCvTopic( topic );
}
代码示例来源:origin: uk.ac.ebi.intact.core/intact-core
if (areSameCvObject(annot.getCvTopic(), clonedAnnotation.getCvTopic())) {
annot.setAnnotationText(clonedAnnotation.getAnnotationText());
found = true;
内容来源于网络,如有侵权,请联系作者删除!