Skip to content
Snippets Groups Projects
Commit af66cb76 authored by David Hoksza's avatar David Hoksza
Browse files

chain_id in structure_table changed to VARCHAR(255) + minor related changes in the code.

parent 85e5eb75
No related branches found
No related tags found
1 merge request!117Pdb annotation
...@@ -289,7 +289,7 @@ public class ModelAnnotator { ...@@ -289,7 +289,7 @@ public class ModelAnnotator {
try { try {
elementAnnotator.annotateElement(element); elementAnnotator.annotateElement(element);
} catch (AnnotatorException e) { } catch (AnnotatorException e) {
logger.warn(elementUtils.getElementTag(element) + " " + elementAnnotator.getCommonName() + " annotation problem"); logger.warn(elementUtils.getElementTag(element) + " " + elementAnnotator.getCommonName() + " annotation problem: " + e.getMessage());
} }
} }
counter++; counter++;
......
...@@ -157,7 +157,7 @@ public class PdbAnnotator extends ElementAnnotator implements IExternalService { ...@@ -157,7 +157,7 @@ public class PdbAnnotator extends ElementAnnotator implements IExternalService {
ur.setUniprotId(md.getResource()); ur.setUniprotId(md.getResource());
ur.setSpecies((Species)bioEntity); ur.setSpecies((Species)bioEntity);
for (Structure s : structures) { for (Structure s : structures) {
s.setUniprot(ur); s.setUniprot(ur);
} }
ur.setStructures(structures); ur.setStructures(structures);
((Species)bioEntity).getUniprots().add(ur); ((Species)bioEntity).getUniprots().add(ur);
......
...@@ -44,7 +44,7 @@ CREATE TABLE structure_table ...@@ -44,7 +44,7 @@ CREATE TABLE structure_table
iddb integer NOT NULL DEFAULT nextval('structure_table_iddb_seq'::regclass), iddb integer NOT NULL DEFAULT nextval('structure_table_iddb_seq'::regclass),
uniprot_id integer NOT NULL, uniprot_id integer NOT NULL,
pdb_id character varying(255) NOT NULL, --should be character(4), but to be on the safe side... pdb_id character varying(255) NOT NULL, --should be character(4), but to be on the safe side...
chain_id character varying(1)NOT NULL, chain_id character varying(255) NOT NULL, --should be char(1), but for example 5T0C has has chains AK and BK
struct_start integer, struct_start integer,
struct_end integer, struct_end integer,
unp_start integer, unp_start integer,
......
DELETE FROM cache_type WHERE classname = 'lcsb.mapviewer.annotation.services.annotators.PdbAnnotator'
INSERT INTO cache_type(validity, classname) VALUES (365, 'lcsb.mapviewer.annotation.services.annotators.PdbAnnotator')
\ No newline at end of file
...@@ -60,7 +60,7 @@ public class ElementRestImplTest extends RestTestFunctions { ...@@ -60,7 +60,7 @@ public class ElementRestImplTest extends RestTestFunctions {
public void testGetElementsProcessAllColumns() throws Exception { public void testGetElementsProcessAllColumns() throws Exception {
try { try {
ElementsRestImpl projectRest = createMockElementRest("testFiles/model/sample.xml", true); ElementsRestImpl projectRest = createMockElementRest("testFiles/model/sample.xml", true);
List<Map<String, Object>> result = projectRest.getElements("sample", "", "", "*", token.getId(), ""); List<Map<String, Object>> result = projectRest.getElements("sample", "", "", "*", token.getId(), "", "", "");
for (Map<String, Object> element : result) { for (Map<String, Object> element : result) {
for (String paramName : element.keySet()) { for (String paramName : element.keySet()) {
Object val = element.get(paramName); Object val = element.get(paramName);
...@@ -85,7 +85,7 @@ public class ElementRestImplTest extends RestTestFunctions { ...@@ -85,7 +85,7 @@ public class ElementRestImplTest extends RestTestFunctions {
try { try {
String proteinType = new GenericProtein("1").getStringType(); String proteinType = new GenericProtein("1").getStringType();
ElementsRestImpl projectRest = createMockElementRest("testFiles/model/sample.xml", false); ElementsRestImpl projectRest = createMockElementRest("testFiles/model/sample.xml", false);
List<Map<String, Object>> result = projectRest.getElements("sample", "", "", "*", token.getId(), proteinType); List<Map<String, Object>> result = projectRest.getElements("sample", "", "", "*", token.getId(), proteinType, "", "");
assertEquals(12, result.size()); assertEquals(12, result.size());
} catch (Exception e) { } catch (Exception e) {
...@@ -98,7 +98,7 @@ public class ElementRestImplTest extends RestTestFunctions { ...@@ -98,7 +98,7 @@ public class ElementRestImplTest extends RestTestFunctions {
public void testGetElementsVisibility() throws Exception { public void testGetElementsVisibility() throws Exception {
try { try {
ElementsRestImpl elementRest = createMockElementRest("testFiles/model/sample.xml"); ElementsRestImpl elementRest = createMockElementRest("testFiles/model/sample.xml");
List<Map<String, Object>> result = elementRest.getElements("sample", "", "", "*", token.getId(), ""); List<Map<String, Object>> result = elementRest.getElements("sample", "", "", "*", token.getId(), "", "", "");
for (Map<String, Object> map : result) { for (Map<String, Object> map : result) {
assertTrue(map.get("hierarchyVisibilityLevel") instanceof String); assertTrue(map.get("hierarchyVisibilityLevel") instanceof String);
} }
...@@ -174,6 +174,10 @@ public class ElementRestImplTest extends RestTestFunctions { ...@@ -174,6 +174,10 @@ public class ElementRestImplTest extends RestTestFunctions {
throw e; throw e;
} }
} }
private ElementsRestImpl createMockElementRest(String string) throws Exception {
return createMockElementRest(string, false);
}
private ElementsRestImpl createMockElementRest(String string, Boolean annotate) throws Exception { private ElementsRestImpl createMockElementRest(String string, Boolean annotate) throws Exception {
Model model = super.getModelForFile(string, true); Model model = super.getModelForFile(string, true);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment