Search in sources :

Example 71 with DbXref

use of org.nextprot.api.core.domain.DbXref in project nextprot-api by calipho-sib.

the class DbXrefDaoImpl method findPeptideXrefs.

@Override
public Set<DbXref> findPeptideXrefs(List<String> names) {
    SqlParameterSource namedParams = new MapSqlParameterSource("names", names);
    List<DbXref> xrefs = new NamedParameterJdbcTemplate(dsLocator.getDataSource()).query(sqlDictionary.getSQLQuery("dbxref-by-peptide-names"), namedParams, new DbXRefRowMapper());
    return new HashSet<>(xrefs);
}
Also used : DbXref(org.nextprot.api.core.domain.DbXref) PublicationDbXref(org.nextprot.api.core.domain.PublicationDbXref) MapSqlParameterSource(org.springframework.jdbc.core.namedparam.MapSqlParameterSource) SqlParameterSource(org.springframework.jdbc.core.namedparam.SqlParameterSource) MapSqlParameterSource(org.springframework.jdbc.core.namedparam.MapSqlParameterSource) NamedParameterJdbcTemplate(org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate)

Example 72 with DbXref

use of org.nextprot.api.core.domain.DbXref in project nextprot-api by calipho-sib.

the class PublicationDirectLink method getLinkFor.

private static String getLinkFor(String dbName, String accession) {
    DbXref xref = new DbXref();
    xref.setAccession(accession);
    xref.setDatabaseName(dbName);
    xref.setLinkUrl(db2link.get(dbName));
    return resolver.resolve(xref);
}
Also used : DbXref(org.nextprot.api.core.domain.DbXref)

Example 73 with DbXref

use of org.nextprot.api.core.domain.DbXref in project nextprot-api by calipho-sib.

the class HsspXrefURLResolverTest method testResolveHSSP.

@Test
public void testResolveHSSP() throws Exception {
    DbXref xref = DbXrefURLResolverDelegateTest.createDbXref("PS50853", "HSSP", "%s");
    Assert.assertEquals("http://ps50853", resolver.resolve(xref));
}
Also used : DbXref(org.nextprot.api.core.domain.DbXref) Test(org.junit.Test)

Example 74 with DbXref

use of org.nextprot.api.core.domain.DbXref in project nextprot-api by calipho-sib.

the class HsspXrefURLResolverTest method testResolveHSSPWithPDB.

@Test
public void testResolveHSSPWithPDB() throws Exception {
    DbXref xref = DbXrefURLResolverDelegateTest.createDbXref("PS50853", "HSSP", "%s");
    xref.setProperties(Collections.singletonList(DbXrefURLResolverDelegateTest.createDbXrefProperty("PDB accession", "1A7F")));
    Assert.assertEquals("http://1a7f", resolver.resolve(xref));
}
Also used : DbXref(org.nextprot.api.core.domain.DbXref) Test(org.junit.Test)

Example 75 with DbXref

use of org.nextprot.api.core.domain.DbXref in project nextprot-api by calipho-sib.

the class JcrbXrefURLResolverTest method testResolveIFO.

@Test
public void testResolveIFO() throws Exception {
    DbXref xref = DbXrefURLResolverDelegateTest.createDbXref("IFO1234", "IFO", "whatever/%s");
    Assert.assertEquals("http://cellbank.nibio.go.jp/~cellbank/cgi-bin/search_res_det.cgi?RNO=ifo1234", resolver.resolve(xref));
}
Also used : DbXref(org.nextprot.api.core.domain.DbXref) Test(org.junit.Test)

Aggregations

DbXref (org.nextprot.api.core.domain.DbXref)146 Test (org.junit.Test)118 PublicationDbXref (org.nextprot.api.core.domain.PublicationDbXref)12 MapSqlParameterSource (org.springframework.jdbc.core.namedparam.MapSqlParameterSource)7 NamedParameterJdbcTemplate (org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate)7 SqlParameterSource (org.springframework.jdbc.core.namedparam.SqlParameterSource)7 DbXrefConverterTest.createDbXref (org.nextprot.api.core.service.dbxref.conv.DbXrefConverterTest.createDbXref)5 Entry (org.nextprot.api.core.domain.Entry)4 Xref2Annotation (org.nextprot.api.commons.constants.Xref2Annotation)3 AnnotationEvidence (org.nextprot.api.core.domain.annotation.AnnotationEvidence)3 DbXrefURLResolverDelegateTest (org.nextprot.api.core.service.dbxref.resolver.DbXrefURLResolverDelegateTest)3 CoreUnitBaseTest (org.nextprot.api.core.test.base.CoreUnitBaseTest)3 WebIntegrationBaseTest (org.nextprot.api.web.dbunit.base.mvc.WebIntegrationBaseTest)3 ImmutableList (com.google.common.collect.ImmutableList)2 Isoform (org.nextprot.api.core.domain.Isoform)2 Annotation (org.nextprot.api.core.domain.annotation.Annotation)2 PageView (org.nextprot.api.core.domain.ui.page.PageView)2 EnsemblXrefPropertyConverter (org.nextprot.api.core.service.dbxref.conv.EnsemblXrefPropertyConverter)2 Preconditions (com.google.common.base.Preconditions)1 Multimap (com.google.common.collect.Multimap)1