Search in sources :

Example 1 with EnsemblXrefPropertyConverter

use of org.nextprot.api.core.service.dbxref.conv.EnsemblXrefPropertyConverter in project nextprot-api by calipho-sib.

the class DbXrefServiceImpl method getDbXrefEnsemblInfos.

private Map<Long, List<DbXrefProperty>> getDbXrefEnsemblInfos(String uniqueName, List<DbXref> xrefs) {
    List<Long> ensemblRefIds = xrefs.stream().filter(xref -> xref.getAccession().startsWith("ENST")).map(DbXref::getDbXrefId).collect(Collectors.toList());
    List<DbXref.EnsemblInfos> ensemblXRefInfosList = dbXRefDao.findDbXrefEnsemblInfos(uniqueName, ensemblRefIds);
    EnsemblXrefPropertyConverter converter = EnsemblXrefPropertyConverter.getInstance();
    Map<Long, List<DbXrefProperty>> map = new HashMap<>();
    for (DbXref.EnsemblInfos infos : ensemblXRefInfosList) {
        map.put(infos.getTranscriptXrefId(), converter.convert(infos));
    }
    return map;
}
Also used : PublicationDbXref(org.nextprot.api.core.domain.PublicationDbXref) DbXref(org.nextprot.api.core.domain.DbXref) EnsemblXrefPropertyConverter(org.nextprot.api.core.service.dbxref.conv.EnsemblXrefPropertyConverter) ImmutableList(com.google.common.collect.ImmutableList)

Aggregations

ImmutableList (com.google.common.collect.ImmutableList)1 DbXref (org.nextprot.api.core.domain.DbXref)1 PublicationDbXref (org.nextprot.api.core.domain.PublicationDbXref)1 EnsemblXrefPropertyConverter (org.nextprot.api.core.service.dbxref.conv.EnsemblXrefPropertyConverter)1