Search in sources :

Example 1 with AnnotationVariant

use of org.nextprot.api.core.domain.annotation.AnnotationVariant in project nextprot-api by calipho-sib.

the class ByAnnotationVariantComparatorTest method mockAnnotationVariant.

private static Annotation mockAnnotationVariant(AnnotationCategory category, String original, String variant, ByIsoformPositionComparatorTest.TargetIsoform... targets) {
    Annotation mock = Mockito.mock(Annotation.class);
    when(mock.getVariant()).thenReturn(new AnnotationVariant(original, variant, ""));
    when(mock.getAPICategory()).thenReturn(category);
    Map<String, AnnotationIsoformSpecificity> map = new HashMap<>();
    for (ByIsoformPositionComparatorTest.TargetIsoform target : targets) {
        AnnotationIsoformSpecificity specificity = Mockito.mock(AnnotationIsoformSpecificity.class);
        when(specificity.getFirstPosition()).thenReturn(target.getStart());
        when(specificity.getLastPosition()).thenReturn(target.getEnd());
        when(specificity.getIsoformAccession()).thenReturn(target.getIsoformAccession());
        when(mock.getStartPositionForIsoform(target.getIsoformAccession())).thenReturn(target.getStart());
        when(mock.getEndPositionForIsoform(target.getIsoformAccession())).thenReturn(target.getEnd());
        map.put(target.getIsoformAccession(), specificity);
    }
    when(mock.getTargetingIsoformsMap()).thenReturn(map);
    return mock;
}
Also used : AnnotationVariant(org.nextprot.api.core.domain.annotation.AnnotationVariant) HashMap(java.util.HashMap) AnnotationIsoformSpecificity(org.nextprot.api.core.domain.annotation.AnnotationIsoformSpecificity) Annotation(org.nextprot.api.core.domain.annotation.Annotation)

Example 2 with AnnotationVariant

use of org.nextprot.api.core.domain.annotation.AnnotationVariant in project nextprot-api by calipho-sib.

the class AnnotationVariantTest method testParse4.

public void testParse4() {
    String rd = "In [GLC3A:UNIPROT_DISEASE:DI-00935]; acts as GLC1A.";
    AnnotationVariant av = new AnnotationVariant("I", "L", rd);
    assertEquals(av.getDescription(), "acts as GLC1A.");
    assertEquals(av.getDiseaseTerms().size(), 1);
    assertEquals(av.getDiseaseTerms().get(0), "DI-00935");
}
Also used : AnnotationVariant(org.nextprot.api.core.domain.annotation.AnnotationVariant)

Example 3 with AnnotationVariant

use of org.nextprot.api.core.domain.annotation.AnnotationVariant in project nextprot-api by calipho-sib.

the class AnnotationVariantTest method testParse5.

public void testParse5() {
    String rd = "In [GLC3A:UNIPROT_DISEASE:DI-00935] and " + "[GLC1A:UNIPROT_DISEASE:DI-00937].";
    AnnotationVariant av = new AnnotationVariant("I", "L", rd);
    assertEquals(av.getDescription(), null);
    assertEquals(av.getDiseaseTerms().size(), 2);
    assertEquals(av.getDiseaseTerms().get(0), "DI-00935");
    assertEquals(av.getDiseaseTerms().get(1), "DI-00937");
}
Also used : AnnotationVariant(org.nextprot.api.core.domain.annotation.AnnotationVariant)

Example 4 with AnnotationVariant

use of org.nextprot.api.core.domain.annotation.AnnotationVariant in project nextprot-api by calipho-sib.

the class AnnotationVariantTest method testParse2.

public void testParse2() {
    String rd = "this is just a comment";
    AnnotationVariant av = new AnnotationVariant("I", "L", rd);
    assertEquals(av.getDescription(), "this is just a comment");
    assertEquals(av.getDiseaseTerms(), null);
}
Also used : AnnotationVariant(org.nextprot.api.core.domain.annotation.AnnotationVariant)

Example 5 with AnnotationVariant

use of org.nextprot.api.core.domain.annotation.AnnotationVariant in project nextprot-api by calipho-sib.

the class AnnotationVariantTest method testParse1.

public void testParse1() {
    String rd = null;
    AnnotationVariant av = new AnnotationVariant("I", "L", rd);
    assertEquals(av.getDescription(), null);
    assertEquals(av.getDiseaseTerms(), null);
}
Also used : AnnotationVariant(org.nextprot.api.core.domain.annotation.AnnotationVariant)

Aggregations

AnnotationVariant (org.nextprot.api.core.domain.annotation.AnnotationVariant)9 Annotation (org.nextprot.api.core.domain.annotation.Annotation)2 AnnotationIsoformSpecificity (org.nextprot.api.core.domain.annotation.AnnotationIsoformSpecificity)2 HashMap (java.util.HashMap)1 NextProtException (org.nextprot.api.commons.exception.NextProtException)1 Isoform (org.nextprot.api.core.domain.Isoform)1 PepXIsoformMatch (org.nextprot.api.web.domain.PepXResponse.PepXIsoformMatch)1