Search in sources :

Example 1 with Xref2Annotation

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;
}
Also used : Xref2Annotation(org.nextprot.api.commons.constants.Xref2Annotation) Annotation(org.nextprot.api.core.domain.annotation.Annotation) Xref2Annotation(org.nextprot.api.commons.constants.Xref2Annotation)

Example 2 with Xref2Annotation

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;
}
Also used : Xref2Annotation(org.nextprot.api.commons.constants.Xref2Annotation) AnnotationEvidence(org.nextprot.api.core.domain.annotation.AnnotationEvidence) PublicationDbXref(org.nextprot.api.core.domain.PublicationDbXref) DbXref(org.nextprot.api.core.domain.DbXref)

Aggregations

Xref2Annotation (org.nextprot.api.commons.constants.Xref2Annotation)2 DbXref (org.nextprot.api.core.domain.DbXref)1 PublicationDbXref (org.nextprot.api.core.domain.PublicationDbXref)1 Annotation (org.nextprot.api.core.domain.annotation.Annotation)1 AnnotationEvidence (org.nextprot.api.core.domain.annotation.AnnotationEvidence)1