use of org.nextprot.api.core.domain.Entry in project nextprot-api by calipho-sib.
the class BuildEntryTest method testWithEnsemblGeneShouldBePresent.
@Test
public void testWithEnsemblGeneShouldBePresent() throws Exception {
Entry entry = entryBuilderService.build(EntryConfig.newConfig("NX_P01308").withGenomicMappings().withChromosomalLocations());
Assert.assertEquals(1, entry.getChromosomalLocations().size());
Assert.assertEquals("ENSG00000254647", entry.getChromosomalLocations().get(0).getAccession());
Assert.assertTrue(!entry.getGenomicMappings().isEmpty());
Assert.assertEquals("ENSG00000254647", entry.getGenomicMappings().get(0).getAccession());
Assert.assertEquals("Ensembl", entry.getGenomicMappings().get(0).getDatabase());
}
use of org.nextprot.api.core.domain.Entry in project nextprot-api by calipho-sib.
the class BuildEntryTest method testNonEnsgShouldHaveUndefinedAccession.
@Test
public void testNonEnsgShouldHaveUndefinedAccession() throws Exception {
Entry entry = entryBuilderService.build(EntryConfig.newConfig("NX_Q96PT3").withGenomicMappings().withChromosomalLocations().withXrefs());
Assert.assertEquals(1, entry.getChromosomalLocations().size());
Assert.assertTrue(!entry.getChromosomalLocations().get(0).getAccession().isEmpty());
Assert.assertTrue(entry.getGenomicMappings().isEmpty());
}
use of org.nextprot.api.core.domain.Entry in project nextprot-api by calipho-sib.
the class BuildEntryTest method testVirtualGene2ShouldBeAbsent.
@Test
public void testVirtualGene2ShouldBeAbsent() throws Exception {
Entry entry = entryBuilderService.build(EntryConfig.newConfig("NX_O00370").withGenomicMappings().withChromosomalLocations().withXrefs());
Assert.assertEquals(1, entry.getChromosomalLocations().size());
Assert.assertTrue(!entry.getChromosomalLocations().get(0).getAccession().isEmpty());
Assert.assertTrue(entry.getGenomicMappings().isEmpty());
for (DbXref xref : entry.getXrefs()) {
Assert.assertTrue(!xref.getAccession().matches("VG.+"));
}
}
use of org.nextprot.api.core.domain.Entry in project nextprot-api by calipho-sib.
the class PepXIntegrationAndValidationTest method testPepXService.
@Test
public void testPepXService() throws Exception {
List<String> peptides = getPeptides();
for (String peptide : peptides) {
List<Entry> entries = pepXService.findEntriesWithPeptides(peptide, true);
for (Entry entry : entries) {
System.out.println("testing peptide:" + peptide + " for " + entry.getUniprotName());
// we should have at least one annotation for each entry / peptide match (can be a null variant)
assertFalse(entry.getAnnotations().isEmpty());
}
}
}
use of org.nextprot.api.core.domain.Entry in project nextprot-api by calipho-sib.
the class PepXIntegrationAndValidationTest method testSinglePeptideWithUnicityUnique.
@Test
public void testSinglePeptideWithUnicityUnique() throws Exception {
// NX_PEPT01668698 DJCQAQGVAJQTMK
// replaced any J in original with L otherwise pepx don't match the peptide !!!!
String peptide = "DICQAQGVAIQTMK";
List<Entry> result = pepXService.findEntriesWithPeptides(peptide, true);
Assert.assertEquals(1, result.size());
List<Annotation> annots = result.get(0).getAnnotationsByCategory(AnnotationCategory.PEPX_VIRTUAL_ANNOTATION);
Assert.assertEquals(1, annots.size());
Annotation a = annots.get(0);
Assert.assertEquals("DICQAQGVAIQTMK", a.getCvTermName());
assertTrue(a.getPropertiesByKey(PropertyApiModel.NAME_PEPTIDE_PROTEOTYPICITY).stream().allMatch(p -> p.getValue().equals("Y")));
assertTrue(a.getPropertiesByKey(PropertyApiModel.NAME_PEPTIDE_UNICITY).stream().allMatch(p -> p.getValue().equals(PeptideUnicity.Value.UNIQUE.name())));
assertTrue(a.getPropertiesByKey(PropertyApiModel.NAME_PEPTIDE_UNICITY_WITH_VARIANTS).stream().allMatch(p -> p.getValue().equals(PeptideUnicity.Value.UNIQUE.name())));
}
Aggregations