use of org.nextprot.api.commons.constants.Xref2Annotation in project nextprot-api by calipho-sib.
the class DbXrefServiceImpl method convertXrefIntoAnnotation.
private Annotation convertXrefIntoAnnotation(DbXref xref, String entryName, List<Isoform> isoforms) {
Preconditions.checkNotNull(xref.getProperties());
Annotation annotation = new Annotation();
annotation.setAnnotationId(xref.getDbXrefId() + IdentifierOffset.XREF_ANNOTATION_OFFSET);
Xref2Annotation xam = Xref2Annotation.getByDatabaseName(xref.getDatabaseName());
annotation.setCategory(xam.getAnnotCat());
// copy of some xref property
annotation.setDescription(xref.getPropertyValue(xam.getXrefPropName()));
annotation.setQualityQualifier(xam.getQualityQualifier());
annotation.setCvTermName(null);
annotation.setCvTermAccessionCode(null);
annotation.setSynonym(null);
annotation.setUniqueName("AN_" + entryName.substring(3) + "_XR_" + String.valueOf(xref.getDbXrefId()));
annotation.setParentXref(xref);
annotation.setEvidences(Collections.singletonList(newAnnotationEvidence(annotation)));
annotation.addTargetingIsoforms(newAnnotationIsoformSpecificityList(isoforms, annotation));
return annotation;
}
use of org.nextprot.api.commons.constants.Xref2Annotation in project nextprot-api by calipho-sib.
the class DbXrefServiceImpl method newAnnotationEvidence.
private AnnotationEvidence newAnnotationEvidence(Annotation xrefAnnotation) {
AnnotationEvidence evidence = new AnnotationEvidence();
DbXref pxref = xrefAnnotation.getParentXref();
evidence.setAnnotationId(xrefAnnotation.getAnnotationId());
Xref2Annotation xam = Xref2Annotation.getByDatabaseName(pxref.getDatabaseName());
evidence.setEvidenceId(xrefAnnotation.getAnnotationId() + IdentifierOffset.XREF_ANNOTATION_EVIDENCE_OFFSET);
evidence.setAssignedBy(xam.getSrcName());
evidence.setResourceId(pxref.getDbXrefId());
evidence.setResourceAccession(pxref.getAccession());
evidence.setResourceDb(pxref.getDatabaseName());
evidence.setResourceAssociationType("evidence");
evidence.setResourceType("database");
evidence.setEvidenceCodeOntology(xam.getEcoOntology());
evidence.setNegativeEvidence(false);
evidence.setExperimentalContextId(null);
evidence.setResourceDescription(null);
evidence.setProperties(new ArrayList<>());
evidence.setQualifierType(xam.getQualifierType());
evidence.setQualityQualifier(xam.getQualityQualifier());
evidence.setAssignmentMethod(xam.getAssignmentMethod());
evidence.setEvidenceCodeAC(xam.getEcoAC());
evidence.setEvidenceCodeName(xam.getEcoName());
return evidence;
}
Aggregations