Search in sources :

Example 11 with DbXref

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

the class DbXrefURLResolverDelegateTest method testResolveEnsemblENSP.

// entry/NX_Q9BXA6/xref.json
@Test
public void testResolveEnsemblENSP() throws Exception {
    DbXref xref = createDbXref("ENSP00000466056", "Ensembl", "whatever");
    Assert.assertEquals("http://www.ensembl.org/Homo_sapiens/Transcript/ProteinSummary?db=core;p=ENSP00000466056", resolver.resolve(xref));
    Assert.assertEquals("http://www.ensembl.org/Homo_sapiens/Transcript/ProteinSummary?db=core;p=%s", xref.getLinkUrl());
}
Also used : DbXref(org.nextprot.api.core.domain.DbXref) Test(org.junit.Test)

Example 12 with DbXref

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

the class DbXrefURLResolverDelegateTest method testResolveUniGene.

@Test
public void testResolveUniGene() throws Exception {
    DbXref xref = createDbXref("Hs.83634", "UniGene", "https://www.ncbi.nlm.nih.gov/UniGene/clust.cgi?ORG=%d&CID=%s");
    Assert.assertEquals("https://www.ncbi.nlm.nih.gov/UniGene/clust.cgi?ORG=Hs&CID=83634", resolver.resolve(xref));
    Assert.assertEquals("https://www.ncbi.nlm.nih.gov/UniGene/clust.cgi?ORG=%d&CID=%s", xref.getLinkUrl());
}
Also used : DbXref(org.nextprot.api.core.domain.DbXref) Test(org.junit.Test)

Example 13 with DbXref

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

the class DbXrefURLResolverDelegateTest method testResolveCGH_DB.

@Test
public void testResolveCGH_DB() throws Exception {
    DbXref xref = createDbXref("9029-4", "CGH-DB", "http://www.cghtmd.jp/CGHDatabase/mapViewer?hid=%s&aid=%t&lang=en");
    Assert.assertEquals("http://www.cghtmd.jp/CGHDatabase/mapViewer?hid=9029&aid=4&lang=en", resolver.resolve(xref));
    Assert.assertEquals("http://www.cghtmd.jp/CGHDatabase/mapViewer?hid=%s&aid=4&lang=en", xref.getLinkUrl());
}
Also used : DbXref(org.nextprot.api.core.domain.DbXref) Test(org.junit.Test)

Example 14 with DbXref

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

the class DbXrefURLResolverDelegateTest method testResolveSRMAtlas.

// entry/NX_P01308/xref.json
@Test
public void testResolveSRMAtlas() throws Exception {
    DbXref xref = createDbXref("PAp00968082", "SRMAtlas", "https://db.systemsbiology.net/sbeams/cgi/PeptideAtlas/GetTransitions?organism_name=Human;default_search=1;peptide_sequence_constraint=%s;apply_action=QUERY");
    xref.setProperties(Collections.singletonList(createDbXrefProperty("sequence", "GFFYTPK")));
    Assert.assertEquals("https://db.systemsbiology.net/sbeams/cgi/PeptideAtlas/GetTransitions?organism_name=Human;default_search=1;peptide_sequence_constraint=GFFYTPK;apply_action=QUERY", resolver.resolve(xref));
    Assert.assertEquals("https://db.systemsbiology.net/sbeams/cgi/PeptideAtlas/GetTransitions?organism_name=Human;default_search=1;peptide_sequence_constraint=%s;apply_action=QUERY", xref.getLinkUrl());
}
Also used : DbXref(org.nextprot.api.core.domain.DbXref) Test(org.junit.Test)

Example 15 with DbXref

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

the class DbXrefURLResolverDelegateTest method testResolvePeptideAtlasNoPap.

// entry/NX_P01308/xref.json
@Test
public void testResolvePeptideAtlasNoPap() throws Exception {
    DbXref xref = createDbXref("P01308", "PeptideAtlas", "whatever");
    Assert.assertEquals("https://db.systemsbiology.net/sbeams/cgi/PeptideAtlas/GetProtein?protein_name=P01308;organism_name=Human;action=GO", resolver.resolve(xref));
    Assert.assertEquals("https://db.systemsbiology.net/sbeams/cgi/PeptideAtlas/GetProtein?protein_name=%s;organism_name=Human;action=GO", xref.getLinkUrl());
}
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