use of org.nextprot.api.core.domain.annotation.AnnotationEvidence in project nextprot-api by calipho-sib.
the class AntibodyResourceIdsServiceImpl method findAllAntibodyIdsByMasterId.
@Override
public List<Long> findAllAntibodyIdsByMasterId(String uniqueName) {
Long masterId = masterIdentifierService.findIdByUniqueName(uniqueName);
List<Annotation> annotations = antibodyMappingDao.findAntibodyMappingAnnotationsById(masterId);
Set<Long> names = new HashSet<>();
for (Annotation annotation : annotations) {
for (AnnotationEvidence evidence : annotation.getEvidences()) {
names.add(evidence.getResourceId());
}
}
return new ImmutableList.Builder<Long>().addAll(new ArrayList<>(names)).build();
}
use of org.nextprot.api.core.domain.annotation.AnnotationEvidence in project nextprot-api by calipho-sib.
the class PeptideMappingDaoIntegrationTest method shouldReturn_Some_Expected_Evidences.
@Test
public void shouldReturn_Some_Expected_Evidences() {
List<String> names = new ArrayList<>();
String pepName1 = "NX_PEPT01967984";
names.add(pepName1);
Map<String, List<AnnotationEvidence>> evMap = this.peptideMappingDao.findPeptideAnnotationEvidencesMap(names, true);
// 1 peptide name key excpected
assertTrue(evMap.size() == 1);
// 1 PeptideAtlas evidence expected
assertTrue(evMap.get(pepName1).size() == 1);
AnnotationEvidence ev = evMap.get(pepName1).get(0);
// setup later by service !
assertTrue(ev.getAnnotationId() == 0L);
System.out.println("assigned by:" + ev.getAssignedBy());
assertTrue(ev.getEvidenceId() > IdentifierOffset.PEPTIDE_MAPPING_ANNOTATION_EVIDENCE_OFFSET);
assertTrue(ev.getAssignedBy().startsWith("PeptideAtlas"));
assertTrue(ev.getEvidenceCodeAC().startsWith("ECO"));
assertTrue(ev.getEvidenceCodeName().length() > 0);
assertTrue(ev.getQualityQualifier().length() > 0);
assertTrue(ev.getResourceAccession().equals("PAp05117553"));
assertTrue(ev.getResourceType().equals("database"));
}
use of org.nextprot.api.core.domain.annotation.AnnotationEvidence in project nextprot-api by calipho-sib.
the class AnnotationTest method testNoEvidence.
/*
* this case seems to occur (in dev at least)
*/
@Test
public void testNoEvidence() {
Annotation a = new Annotation();
List<AnnotationEvidence> evidences = new ArrayList<>();
a.setEvidences(evidences);
Assert.assertTrue(!a.isExpressionLevelDetected().isPresent());
}
use of org.nextprot.api.core.domain.annotation.AnnotationEvidence in project nextprot-api by calipho-sib.
the class AnnotationTest method testTwoHigh.
@Test
public void testTwoHigh() {
Annotation a = new Annotation();
List<AnnotationEvidence> evidences = new ArrayList<>();
evidences.add(buildEvidence("high"));
evidences.add(buildEvidence("high"));
a.setEvidences(evidences);
Assert.assertTrue(a.isExpressionLevelDetected().isPresent());
Assert.assertTrue(a.isExpressionLevelDetected().get());
}
use of org.nextprot.api.core.domain.annotation.AnnotationEvidence in project nextprot-api by calipho-sib.
the class AnnotationTest method testHighAndLow.
@Test
public void testHighAndLow() {
Annotation a = new Annotation();
List<AnnotationEvidence> evidences = new ArrayList<>();
evidences.add(buildEvidence("high"));
evidences.add(buildEvidence("low"));
a.setEvidences(evidences);
Assert.assertTrue(a.isExpressionLevelDetected().isPresent());
Assert.assertTrue(a.isExpressionLevelDetected().get());
}
Aggregations