use of org.nextprot.api.core.domain.EntityName in project nextprot-api by calipho-sib.
the class IsoformUtilsTest method createIsoforms.
private List<Isoform> createIsoforms(String... mainNames) {
List<Isoform> list = new ArrayList<>();
for (String mainName : mainNames) {
Isoform isoform = new Isoform();
EntityName name = new EntityName();
name.setName(mainName);
isoform.setMainEntityName(name);
list.add(isoform);
}
return list;
}
use of org.nextprot.api.core.domain.EntityName in project nextprot-api by calipho-sib.
the class OverviewServiceIntegrationTest method mockEntityNameWithOtherRecNames.
private static EntityName mockEntityNameWithOtherRecNames(String name, String category, String qualifier, List<EntityName> recNames) {
EntityName entityName = mockEntityName(name, category, qualifier);
Mockito.when(entityName.getOtherRecommendedEntityNames()).thenReturn(recNames);
return entityName;
}
use of org.nextprot.api.core.domain.EntityName in project nextprot-api by calipho-sib.
the class OverviewServiceIntegrationTest method mockEntityNameWithSynonyms.
private static EntityName mockEntityNameWithSynonyms(String name, String category, String qualifier, List<EntityName> synonyms) {
EntityName entityName = mockEntityName(name, category, qualifier);
Mockito.when(entityName.getSynonyms()).thenReturn(synonyms);
return entityName;
}
use of org.nextprot.api.core.domain.EntityName in project nextprot-api by calipho-sib.
the class OverviewServiceIntegrationTest method testNamesForQ3L8U1.
@Test
public void testNamesForQ3L8U1() {
Overview overview = overviewService.findOverviewByEntry("NX_Q3L8U1");
// / protein names
EntityName recName = overview.getRecommendedProteinName();
assertEntityNameEquals(recName, Overview.EntityNameClass.PROTEIN_NAMES, "PR_699748", "Chromodomain-helicase-DNA-binding protein 9");
// recommended names
Assert.assertTrue(new EntityNameCollectionTester(recName.getOtherRecommendedEntityNames()).contains(Arrays.asList(mockEntityName("3.6.4.12", "EC", "EC"))));
// synonyms
Assert.assertTrue(new EntityNameCollectionTester(recName.getSynonyms()).contains(Arrays.asList(mockEntityName("CHD-9", "protein", "short"))));
// alternative names
Assert.assertTrue(new EntityNameCollectionTester(overview.getAlternativeProteinNames()).contains(Arrays.asList(mockEntityName("ATP-dependent helicase CHD9", "protein", "full"), mockEntityNameWithSynonyms("Chromatin-related mesenchymal modulator", "protein", "full", Arrays.asList(mockEntityName("CReMM", "protein", "short"))), mockEntityName("Chromatin-remodeling factor CHROM1", "protein", "full"), mockEntityName("Kismet homolog 2", "protein", "full"), mockEntityName("Peroxisomal proliferator-activated receptor A-interacting complex 320 kDa protein", "protein", "full"), mockEntityName("PPAR-alpha-interacting complex protein 320 kDa", "protein", "full"))));
// / gene names
List<EntityName> geneNames = overview.getGeneNames();
Assert.assertEquals(1, geneNames.size());
assertEntityNameEquals(geneNames.get(0), Overview.EntityNameClass.GENE_NAMES, "PR_1181044", "CHD9");
Assert.assertTrue(new EntityNameCollectionTester(geneNames.get(0).getOtherRecommendedEntityNames()).contains(Collections.<EntityName>emptyList()));
Assert.assertTrue(new EntityNameCollectionTester(geneNames.get(0).getSynonyms()).contains(Arrays.asList(mockEntityName("KIAA0308", "gene name"), mockEntityName("KISH2", "gene name"), mockEntityName("PRIC320", "gene name"), mockEntityName("AD-013", "ORF"), mockEntityName("x0008", "ORF"))));
}
use of org.nextprot.api.core.domain.EntityName in project nextprot-api by calipho-sib.
the class OverviewServiceImpl method findOverviewByEntry.
@Override
@Cacheable("overview")
public Overview findOverviewByEntry(String uniqueName) {
Overview overview = new Overview();
List<History> history = this.historyDao.findHistoryByEntry(uniqueName);
if (history != null && history.size() != 0)
overview.setHistory(history.get(0));
List<EntityName> entityNames = this.entryNameDao.findNames(uniqueName);
entityNames.addAll(entryNameDao.findAlternativeChainNames(uniqueName));
setNamesInOverview(entityNames, overview);
overview.setFamilies(this.familyService.findFamilies(uniqueName));
overview.setIsoformNames(convertIsoNamestoOverviewName(isoformService.findIsoformsByEntryName(uniqueName)));
overview.setProteinExistences(proteinExistenceService.getProteinExistences(uniqueName));
return overview;
}
Aggregations