use of org.nextprot.api.core.domain.annotation.Annotation in project nextprot-api by calipho-sib.
the class ByAnnotationBioObjectComparatorTest method compareAnnotationsSameCatDiffCvName.
@Test
public void compareAnnotationsSameCatDiffCvName() throws Exception {
Annotation refAnnot1 = new Annotation();
refAnnot1.setAnnotationCategory(AnnotationCategory.GO_BIOLOGICAL_PROCESS);
refAnnot1.setAnnotationHash("010a85141bf174a186aaf714676cb397");
refAnnot1.setCvTermName("transmission of nerve impulse");
Annotation refAnnot2 = new Annotation();
refAnnot2.setAnnotationCategory(AnnotationCategory.GO_BIOLOGICAL_PROCESS);
refAnnot2.setAnnotationHash("3bffa5c7f436f45d5c9a2aec4757a492");
refAnnot2.setCvTermName("spike train");
ByAnnotationBioObjectComparator comparator = new ByAnnotationBioObjectComparator(newHashMap(refAnnot1, refAnnot2));
Annotation annotation1 = new Annotation();
annotation1.setBioObject(mockBioObject(BioObject.BioType.ENTRY_ANNOTATION, BioObject.ResourceType.EXTERNAL, "010a85141bf174a186aaf714676cb397"));
Annotation annotation2 = new Annotation();
annotation2.setBioObject(mockBioObject(BioObject.BioType.ENTRY_ANNOTATION, BioObject.ResourceType.EXTERNAL, "3bffa5c7f436f45d5c9a2aec4757a492"));
int cmp = comparator.compare(annotation1, annotation2);
Assert.assertEquals(1, cmp);
}
use of org.nextprot.api.core.domain.annotation.Annotation in project nextprot-api by calipho-sib.
the class ByAnnotationBioObjectComparatorTest method compareAnnotationsSameBioObjects.
@Test
public void compareAnnotationsSameBioObjects() throws Exception {
Annotation refAnnot1 = new Annotation();
refAnnot1.setAnnotationCategory(AnnotationCategory.GO_BIOLOGICAL_PROCESS);
refAnnot1.setAnnotationHash("010a85141bf174a186aaf714676cb397");
refAnnot1.setCvTermName("transmission of nerve impulse");
Annotation refAnnot2 = new Annotation();
refAnnot2.setAnnotationCategory(AnnotationCategory.GO_BIOLOGICAL_PROCESS);
refAnnot2.setAnnotationHash("3bffa5c7f436f45d5c9a2aec4757a492");
refAnnot2.setCvTermName("transmission of nerve impulse");
ByAnnotationBioObjectComparator comparator = new ByAnnotationBioObjectComparator(newHashMap(refAnnot1, refAnnot2));
Annotation annotation1 = new Annotation();
annotation1.setBioObject(mockBioObject(BioObject.BioType.ENTRY_ANNOTATION, BioObject.ResourceType.EXTERNAL, "010a85141bf174a186aaf714676cb397"));
Annotation annotation2 = new Annotation();
annotation2.setBioObject(mockBioObject(BioObject.BioType.ENTRY_ANNOTATION, BioObject.ResourceType.EXTERNAL, "3bffa5c7f436f45d5c9a2aec4757a492"));
int cmp = comparator.compare(annotation1, annotation2);
Assert.assertEquals(0, cmp);
}
use of org.nextprot.api.core.domain.annotation.Annotation in project nextprot-api by calipho-sib.
the class ByAnnotationVariantComparatorTest method compareVariantsSame.
@Test
public void compareVariantsSame() throws Exception {
ByAnnotationVariantComparator comparator = new ByAnnotationVariantComparator();
Annotation variant1 = mockAnnotationVariant(AnnotationCategory.VARIANT, "A", "V", new ByIsoformPositionComparatorTest.TargetIsoform("NX_P51610-1", 14, 14), new ByIsoformPositionComparatorTest.TargetIsoform("NX_P51610-4", 12, 12));
Annotation variant2 = mockAnnotationVariant(AnnotationCategory.VARIANT, "A", "V", new ByIsoformPositionComparatorTest.TargetIsoform("NX_P51610-1", 14, 14), new ByIsoformPositionComparatorTest.TargetIsoform("NX_P51610-4", 12, 12));
int cmp = comparator.compare(variant1, variant2);
Assert.assertEquals(0, cmp);
}
use of org.nextprot.api.core.domain.annotation.Annotation in project nextprot-api by calipho-sib.
the class ByAnnotationVariantComparatorTest method compareVariantsMutagenesisSamePositionSameVariation.
@Test
public void compareVariantsMutagenesisSamePositionSameVariation() throws Exception {
ByAnnotationVariantComparator comparator = new ByAnnotationVariantComparator();
Annotation variant1 = mockAnnotationVariant(AnnotationCategory.VARIANT, "A", "V", new ByIsoformPositionComparatorTest.TargetIsoform("NX_P51610-1", 14, 14), new ByIsoformPositionComparatorTest.TargetIsoform("NX_P51610-4", 12, 12));
Annotation variant2 = mockAnnotationVariant(AnnotationCategory.MUTAGENESIS, "A", "V", new ByIsoformPositionComparatorTest.TargetIsoform("NX_P51610-1", 14, 14), new ByIsoformPositionComparatorTest.TargetIsoform("NX_P51610-4", 12, 12));
int cmp = comparator.compare(variant1, variant2);
Assert.assertEquals(0, cmp);
}
use of org.nextprot.api.core.domain.annotation.Annotation in project nextprot-api by calipho-sib.
the class ByAnnotationVariantComparatorTest method compareVariantsDiffEndingLocation.
@Test
public void compareVariantsDiffEndingLocation() throws Exception {
ByAnnotationVariantComparator comparator = new ByAnnotationVariantComparator();
Annotation variant1 = mockAnnotationVariant(AnnotationCategory.VARIANT, "X", "W", new ByIsoformPositionComparatorTest.TargetIsoform("NX_P51610-1", 14, 14), new ByIsoformPositionComparatorTest.TargetIsoform("NX_P51610-4", 12, 36));
Annotation variant2 = mockAnnotationVariant(AnnotationCategory.VARIANT, "A", "V", new ByIsoformPositionComparatorTest.TargetIsoform("NX_P51610-1", 14, 14), new ByIsoformPositionComparatorTest.TargetIsoform("NX_P51610-4", 12, 12));
int cmp = comparator.compare(variant1, variant2);
Assert.assertEquals(-1, cmp);
}
Aggregations