use of org.nextprot.api.core.domain.DbXref in project nextprot-api by calipho-sib.
the class EntryPageServiceImpl method filterXrefInPageView.
@Override
public Entry filterXrefInPageView(String entryName, String pageViewName) {
Entry entry = entryBuilderService.build(EntryConfig.newConfig(entryName).withEverything());
PageView pageView = PageViewFactory.valueOf(pageViewName.toUpperCase()).getPageView();
List<DbXref> xrefs = pageView.getFurtherExternalLinksXrefs(entry);
entry.setXrefs(xrefs);
entry.setAnnotations(Collections.emptyList());
entry.setPublications(Collections.emptyList());
entry.setExperimentalContexts(Collections.emptyList());
entry.setIdentifiers(Collections.emptyList());
entry.setInteractions(Collections.emptyList());
entry.setEnzymes(Collections.emptyList());
return entry;
}
use of org.nextprot.api.core.domain.DbXref in project nextprot-api by calipho-sib.
the class CvTermSolrIndexer method convertToSolrDocument.
@Override
public SolrInputDocument convertToSolrDocument(CvTerm terminology) {
String ontology = terminology.getOntology();
if (// CaliphoMisc-194, ignore this ontology
ontology.equals("OrganelleCv"))
// CaliphoMisc-194, ignore this ontology
return null;
else if (// CaliphoMisc-194, ignore this ontology
ontology.equals("NextprotAnnotationCv"))
// CaliphoMisc-194, ignore this ontology
return null;
else if (ontology.equals("UniprotFamilyCv"))
return null;
SolrInputDocument doc = new SolrInputDocument();
doc.addField("id", terminology.getId());
doc.addField("ac", terminology.getAccession());
String filters = terminology.getOntologyAltname().replaceAll("[ _-]", "").toLowerCase().replaceAll("uniprot", "up").replaceAll("nextprot", "aanp");
doc.addField("filters", filters);
doc.addField("name", terminology.getName());
doc.addField("name_s", terminology.getName().toLowerCase());
doc.addField("description", terminology.getDescription());
List<String> synonstrings = terminology.getSynonyms();
if (synonstrings != null) {
int i = synonstrings.size();
StringBuilder sb = new StringBuilder();
for (String syn : synonstrings) {
sb.append(syn);
if (--i != 0)
sb.append(" | ");
}
doc.addField("synonyms", sb.toString());
}
List<CvTerm.TermProperty> properties = terminology.getProperties();
if (properties != null) {
doc.addField("properties", TerminologyUtils.convertPropertiesToString(properties));
}
List<DbXref> xrefs = terminology.getXrefs();
// If filter is needed alternatively use: terminology.getFilteredXrefs(String category)
if (xrefs != null) {
doc.addField("other_xrefs", TerminologyUtils.convertXrefsToSolrString(xrefs));
}
return doc;
}
use of org.nextprot.api.core.domain.DbXref in project nextprot-api by calipho-sib.
the class DbXrefDaoImpl method findEntryIdentifierXrefs.
@Override
public Set<DbXref> findEntryIdentifierXrefs(String entryName) {
SqlParameterSource namedParams = new MapSqlParameterSource("uniqueName", entryName);
List<DbXref> xrefs = new NamedParameterJdbcTemplate(dsLocator.getDataSource()).query(sqlDictionary.getSQLQuery("dbxref-by-master-via-identifiers"), namedParams, new DbXRefRowMapper(entryName));
return new HashSet<>(xrefs);
}
use of org.nextprot.api.core.domain.DbXref in project nextprot-api by calipho-sib.
the class DbXrefDaoImpl method findEntryInteractionInteractantsXrefs.
@Override
public Set<DbXref> findEntryInteractionInteractantsXrefs(String entryName) {
SqlParameterSource namedParams = new MapSqlParameterSource("uniqueName", entryName);
List<DbXref> xrefs = new NamedParameterJdbcTemplate(dsLocator.getDataSource()).query(sqlDictionary.getSQLQuery("dbxref-by-master-via-interactions-interactants"), namedParams, new DbXRefRowMapper(entryName));
return new HashSet<>(xrefs);
}
use of org.nextprot.api.core.domain.DbXref in project nextprot-api by calipho-sib.
the class DbXrefDaoImpl method findAntibodyXrefs.
@Override
public Set<DbXref> findAntibodyXrefs(List<Long> ids) {
SqlParameterSource namedParams = new MapSqlParameterSource("ids", ids);
List<DbXref> xrefs = new NamedParameterJdbcTemplate(dsLocator.getDataSource()).query(sqlDictionary.getSQLQuery("dbxref-by-antibody-ids"), namedParams, new DbXRefRowMapper());
return new HashSet<>(xrefs);
}
Aggregations