2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ The Jalview Authors
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
21 package jalview.fts.service.pdb;
23 import static org.testng.AssertJUnit.assertEquals;
24 import static org.testng.AssertJUnit.assertTrue;
26 import java.io.BufferedReader;
27 import java.io.FileReader;
28 import java.io.IOException;
29 import java.util.ArrayList;
30 import java.util.Iterator;
31 import java.util.List;
33 import javax.ws.rs.core.MediaType;
35 import org.json.simple.JSONArray;
36 import org.json.simple.JSONObject;
37 import org.json.simple.parser.JSONParser;
38 import org.json.simple.parser.ParseException;
39 import org.testng.Assert;
40 import org.testng.annotations.AfterMethod;
41 import org.testng.annotations.BeforeClass;
42 import org.testng.annotations.BeforeMethod;
43 import org.testng.annotations.Test;
45 import com.sun.jersey.api.client.Client;
46 import com.sun.jersey.api.client.ClientResponse;
47 import com.sun.jersey.api.client.WebResource;
48 import com.sun.jersey.api.client.config.ClientConfig;
49 import com.sun.jersey.api.client.config.DefaultClientConfig;
51 import jalview.fts.api.FTSDataColumnI;
52 import jalview.fts.core.FTSRestClient;
53 import jalview.fts.core.FTSRestRequest;
54 import jalview.fts.core.FTSRestResponse;
55 import jalview.gui.JvOptionPane;
57 public class PDBFTSRestClientTest
60 @BeforeClass(alwaysRun = true)
61 public void setUpJvOptionPane()
63 JvOptionPane.setInteractiveMode(false);
64 JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
67 @BeforeMethod(alwaysRun = true)
68 public void setUp() throws Exception
72 @AfterMethod(alwaysRun = true)
73 public void tearDown() throws Exception
77 @Test(groups = { "External", "Network" })
78 public void executeRequestTest()
80 List<FTSDataColumnI> wantedFields = new ArrayList<FTSDataColumnI>();
83 wantedFields.add(PDBFTSRestClient.getInstance()
84 .getDataColumnByNameOrCode("molecule_type"));
85 wantedFields.add(PDBFTSRestClient.getInstance()
86 .getDataColumnByNameOrCode("pdb_id"));
87 wantedFields.add(PDBFTSRestClient.getInstance()
88 .getDataColumnByNameOrCode("genus"));
89 wantedFields.add(PDBFTSRestClient.getInstance()
90 .getDataColumnByNameOrCode("gene_name"));
91 wantedFields.add(PDBFTSRestClient.getInstance()
92 .getDataColumnByNameOrCode("title"));
93 } catch (Exception e1)
97 System.out.println("wantedFields >>" + wantedFields);
99 FTSRestRequest request = new FTSRestRequest();
100 request.setAllowEmptySeq(false);
101 request.setResponseSize(100);
102 request.setFieldToSearchBy("text:");
103 request.setSearchTerm("abc");
104 request.setWantedFields(wantedFields);
106 FTSRestResponse response;
109 response = PDBFTSRestClient.getInstance().executeRequest(request);
110 } catch (Exception e)
113 Assert.fail("Couldn't execute webservice call!");
116 assertTrue(response.getNumberOfItemsFound() > 99);
117 assertTrue(response.getSearchSummary() != null);
118 assertTrue(response.getSearchSummary().size() > 99);
121 @Test(groups = { "Functional" })
122 public void getPDBDocFieldsAsCommaDelimitedStringTest()
124 List<FTSDataColumnI> wantedFields = new ArrayList<FTSDataColumnI>();
127 wantedFields.add(PDBFTSRestClient.getInstance()
128 .getDataColumnByNameOrCode("molecule_type"));
129 wantedFields.add(PDBFTSRestClient.getInstance()
130 .getDataColumnByNameOrCode("pdb_id"));
131 wantedFields.add(PDBFTSRestClient.getInstance()
132 .getDataColumnByNameOrCode("genus"));
133 wantedFields.add(PDBFTSRestClient.getInstance()
134 .getDataColumnByNameOrCode("gene_name"));
135 wantedFields.add(PDBFTSRestClient.getInstance()
136 .getDataColumnByNameOrCode("title"));
137 } catch (Exception e)
142 String expectedResult = "molecule_type,pdb_id,genus,gene_name,title";
143 String actualResult = PDBFTSRestClient.getInstance()
144 .getDataColumnsFieldsAsCommaDelimitedString(wantedFields);
146 assertEquals("", expectedResult, actualResult);
149 @Test(groups = { "External, Network" })
150 public void parsePDBJsonExceptionStringTest()
152 List<FTSDataColumnI> wantedFields = new ArrayList<FTSDataColumnI>();
155 wantedFields.add(PDBFTSRestClient.getInstance()
156 .getDataColumnByNameOrCode("molecule_type"));
157 wantedFields.add(PDBFTSRestClient.getInstance()
158 .getDataColumnByNameOrCode("pdb_id"));
159 wantedFields.add(PDBFTSRestClient.getInstance()
160 .getDataColumnByNameOrCode("genus"));
161 wantedFields.add(PDBFTSRestClient.getInstance()
162 .getDataColumnByNameOrCode("gene_name"));
163 wantedFields.add(PDBFTSRestClient.getInstance()
164 .getDataColumnByNameOrCode("title"));
165 } catch (Exception e1)
167 e1.printStackTrace();
170 FTSRestRequest request = new FTSRestRequest();
171 request.setAllowEmptySeq(false);
172 request.setResponseSize(100);
173 request.setFieldToSearchBy("text:");
174 request.setSearchTerm("abc");
175 request.setWantedFields(wantedFields);
177 String jsonErrorResponse = "";
180 jsonErrorResponse = readJsonStringFromFile(
181 "test/jalview/io/pdb_request_json_error.txt");
182 } catch (IOException e)
187 String parsedErrorResponse = PDBFTSRestClient
188 .parseJsonExceptionString(jsonErrorResponse);
190 String expectedErrorMsg = "\n============= PDB Rest Client RunTime error =============\n"
192 + "Message: org.apache.solr.search.SyntaxError: Cannot parse 'text:abc OR text:go:abc AND molecule_sequence:['' TO *]': Encountered \" \":\" \": \"\" at line 1, column 19.\n"
193 + "query: text:abc OR text:go:abc AND molecule_sequence:['' TO *]\n"
196 assertEquals(expectedErrorMsg, parsedErrorResponse);
203 expectedExceptions = Exception.class)
204 public void testForExpectedRuntimeException() throws Exception
206 // FIXME JBPNote: looks like this test fails for no good reason - what
207 // exception was supposed to be raised ?
208 List<FTSDataColumnI> wantedFields = new ArrayList<FTSDataColumnI>();
209 wantedFields.add(PDBFTSRestClient.getInstance()
210 .getDataColumnByNameOrCode("pdb_id"));
212 FTSRestRequest request = new FTSRestRequest();
213 request.setFieldToSearchBy("text:");
214 request.setSearchTerm("abc OR text:go:abc");
215 request.setWantedFields(wantedFields);
216 PDBFTSRestClient.getInstance().executeRequest(request);
219 // JBP: Is this actually external ? Looks like it is mocked
220 // JBP looks like the mock is not up to date for this test
221 @Test(groups = { "External" })
222 public void parsePDBJsonResponseTest()
224 List<FTSDataColumnI> wantedFields = new ArrayList<FTSDataColumnI>();
227 wantedFields.add(PDBFTSRestClient.getInstance()
228 .getDataColumnByNameOrCode("molecule_type"));
229 wantedFields.add(PDBFTSRestClient.getInstance()
230 .getDataColumnByNameOrCode("pdb_id"));
231 wantedFields.add(PDBFTSRestClient.getInstance()
232 .getDataColumnByNameOrCode("genus"));
233 wantedFields.add(PDBFTSRestClient.getInstance()
234 .getDataColumnByNameOrCode("gene_name"));
235 wantedFields.add(PDBFTSRestClient.getInstance()
236 .getDataColumnByNameOrCode("title"));
237 } catch (Exception e1)
239 e1.printStackTrace();
242 FTSRestRequest request = new FTSRestRequest();
243 request.setAllowEmptySeq(false);
244 request.setWantedFields(wantedFields);
246 String jsonString = "";
249 jsonString = readJsonStringFromFile(
250 "test/jalview/io/pdb_response_json.txt");
251 } catch (IOException e)
255 FTSRestResponse response = PDBFTSRestClient
256 .parsePDBJsonResponse(jsonString, request);
257 assertTrue(response.getSearchSummary() != null);
258 assertTrue(response.getNumberOfItemsFound() == 931);
259 assertTrue(response.getSearchSummary().size() == 14);
260 System.out.println("Search summary : " + response.getSearchSummary());
263 @Test(groups = { "Functional" })
264 public void getPDBIdColumIndexTest()
266 List<FTSDataColumnI> wantedFields = new ArrayList<FTSDataColumnI>();
269 wantedFields.add(PDBFTSRestClient.getInstance()
270 .getDataColumnByNameOrCode("molecule_type"));
271 wantedFields.add(PDBFTSRestClient.getInstance()
272 .getDataColumnByNameOrCode("genus"));
273 wantedFields.add(PDBFTSRestClient.getInstance()
274 .getDataColumnByNameOrCode("gene_name"));
275 wantedFields.add(PDBFTSRestClient.getInstance()
276 .getDataColumnByNameOrCode("title"));
277 wantedFields.add(PDBFTSRestClient.getInstance()
278 .getDataColumnByNameOrCode("pdb_id"));
279 } catch (Exception e)
285 assertEquals(5, PDBFTSRestClient.getInstance()
286 .getPrimaryKeyColumIndex(wantedFields, true));
287 assertEquals(4, PDBFTSRestClient.getInstance()
288 .getPrimaryKeyColumIndex(wantedFields, false));
289 } catch (Exception e)
291 // TODO Auto-generated catch block
296 @Test(groups = { "External" })
297 public void externalServiceIntegrationTest()
299 ClientConfig clientConfig = new DefaultClientConfig();
300 Client client = Client.create(clientConfig);
302 // Build request parameters for the REST Request
303 WebResource webResource = client
304 .resource(PDBFTSRestClient.PDB_SEARCH_ENDPOINT)
305 .queryParam("wt", "json").queryParam("rows", String.valueOf(1))
306 .queryParam("q", "text:abc AND molecule_sequence:['' TO *]");
308 // Execute the REST request
309 ClientResponse clientResponse = webResource
310 .accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
312 // Get the JSON string from the response object
313 String pdbJsonResponseString = clientResponse.getEntity(String.class);
315 // Check the response status and report exception if one occurs
316 if (clientResponse.getStatus() != 200)
318 Assert.fail("Webservice call failed!!!");
324 JSONParser jsonParser = new JSONParser();
325 JSONObject jsonObj = (JSONObject) jsonParser
326 .parse(pdbJsonResponseString);
327 JSONObject pdbResponse = (JSONObject) jsonObj.get("response");
328 String queryTime = ((JSONObject) jsonObj.get("responseHeader"))
329 .get("QTime").toString();
330 String numFound = pdbResponse.get("numFound").toString();
331 JSONArray docs = (JSONArray) pdbResponse.get("docs");
332 Iterator<JSONObject> docIter = docs.iterator();
334 assertTrue("Couldn't Retrieve 'response' object",
335 pdbResponse != null);
336 assertTrue("Couldn't Retrieve 'QTime' value", queryTime != null);
337 assertTrue("Couldn't Retrieve 'numFound' value", numFound != null);
338 assertTrue("Couldn't Retrieve 'docs' object",
339 docs != null || !docIter.hasNext());
341 JSONObject pdbJsonDoc = docIter.next();
343 for (FTSDataColumnI field : PDBFTSRestClient.getInstance()
344 .getAllFTSDataColumns())
346 if (field.getName().equalsIgnoreCase("ALL"))
350 if (pdbJsonDoc.get(field.getCode()) == null)
352 // System.out.println(">>>\t" + field.getCode());
355 + " has been removed from PDB doc Entity",
356 !pdbJsonResponseString.contains(field.getCode()));
359 } catch (ParseException e)
362 ">>> Test failed due to exception while parsing pdb response json !!!");
369 * reads any string from filePath
373 * @throws IOException
375 public static String readJsonStringFromFile(String filePath)
379 BufferedReader br = new BufferedReader(new FileReader(filePath));
382 StringBuilder sb = new StringBuilder();
383 String line = br.readLine();
388 sb.append(System.lineSeparator());
389 line = br.readLine();
391 fileContent = sb.toString();
399 public static void setMock()
401 List<String[]> mocks = new ArrayList<String[]>();
404 { "https://www.ebi.ac.uk/pdbe/search/pdb/select?wt=json&fl=pdb_id,title,experimental_method,resolution&rows=500&start=0&q=(4igk+OR+7lyb+OR+3k0h+OR+3k0k+OR+1t15+OR+3pxc+OR+3pxd+OR+3pxe+OR+1jm7+OR+7jzv+OR+3pxa+OR+3pxb+OR+1y98+OR+1n5o+OR+4ifi+OR+4y2g+OR+3k15+OR+3k16+OR+4jlu+OR+2ing+OR+4ofb+OR+6g2i+OR+3coj+OR+1jnx+OR+4y18+OR+4u4a+OR+1oqa+OR+1t29+OR+1t2u+OR+1t2v)+AND+molecule_sequence:%5B''+TO+*%5D+AND+status:REL&sort=",
405 "{\n" + " \"responseHeader\":{\n" + " \"status\":0,\n"
406 + " \"QTime\":0,\n" + " \"params\":{\n"
407 + " \"q\":\"(4igk OR 7lyb OR 3k0h OR 3k0k OR 1t15 OR 3pxc OR 3pxd OR 3pxe OR 1jm7 OR 7jzv OR 3pxa OR 3pxb OR 1y98 OR 1n5o OR 4ifi OR 4y2g OR 3k15 OR 3k16 OR 4jlu OR 2ing OR 4ofb OR 6g2i OR 3coj OR 1jnx OR 4y18 OR 4u4a OR 1oqa OR 1t29 OR 1t2u OR 1t2v) AND molecule_sequence:['' TO *] AND status:REL\",\n"
408 + " \"fl\":\"pdb_id,title,experimental_method,resolution\",\n"
409 + " \"start\":\"0\",\n"
410 + " \"sort\":\"\",\n"
411 + " \"rows\":\"500\",\n"
412 + " \"wt\":\"json\"}},\n"
413 + " \"response\":{\"numFound\":64,\"start\":0,\"docs\":[\n"
415 + " \"experimental_method\":[\"X-ray diffraction\"],\n"
416 + " \"pdb_id\":\"4ofb\",\n"
417 + " \"resolution\":3.05,\n"
418 + " \"title\":\"Crystal structure of human BRCA1 BRCT in complex with nonphosphopeptide inhibitor\"},\n"
420 + " \"experimental_method\":[\"X-ray diffraction\"],\n"
421 + " \"pdb_id\":\"3pxe\",\n"
422 + " \"resolution\":2.85,\n"
423 + " \"title\":\"Impact of BRCA1 BRCT domain missense substitutions on phospho-peptide recognition: E1836K\"},\n"
425 + " \"experimental_method\":[\"X-ray diffraction\"],\n"
426 + " \"pdb_id\":\"4jlu\",\n"
427 + " \"resolution\":3.5,\n"
428 + " \"title\":\"Crystal structure of BRCA1 BRCT with doubly phosphorylated Abraxas\"},\n"
430 + " \"experimental_method\":[\"X-ray diffraction\"],\n"
431 + " \"pdb_id\":\"4y2g\",\n"
432 + " \"resolution\":2.5,\n"
433 + " \"title\":\"Structure of BRCA1 BRCT domains in complex with Abraxas single phosphorylated peptide\"},\n"
435 + " \"experimental_method\":[\"Solution NMR\"],\n"
436 + " \"pdb_id\":\"1oqa\",\n"
437 + " \"title\":\"Solution structure of the BRCT-c domain from human BRCA1\"},\n"
439 + " \"experimental_method\":[\"X-ray diffraction\"],\n"
440 + " \"pdb_id\":\"4u4a\",\n"
441 + " \"resolution\":3.51,\n"
442 + " \"title\":\"Complex Structure of BRCA1 BRCT with singly phospho Abraxas\"},\n"
444 + " \"experimental_method\":[\"X-ray diffraction\"],\n"
445 + " \"pdb_id\":\"3k16\",\n"
446 + " \"resolution\":3.0,\n"
447 + " \"title\":\"Crystal Structure of BRCA1 BRCT D1840T in complex with a minimal recognition tetrapeptide with a free carboxy C-terminus\"},\n"
449 + " \"experimental_method\":[\"X-ray diffraction\"],\n"
450 + " \"pdb_id\":\"1t15\",\n"
451 + " \"resolution\":1.85,\n"
452 + " \"title\":\"Crystal Structure of the Brca1 BRCT Domains in Complex with the Phosphorylated Interacting Region from Bach1 Helicase\"},\n"
454 + " \"experimental_method\":[\"X-ray diffraction\"],\n"
455 + " \"pdb_id\":\"3k15\",\n"
456 + " \"resolution\":2.8,\n"
457 + " \"title\":\"Crystal Structure of BRCA1 BRCT D1840T in complex with a minimal recognition tetrapeptide with an amidated C-terminus\"},\n"
459 + " \"experimental_method\":[\"X-ray diffraction\"],\n"
460 + " \"pdb_id\":\"1t2v\",\n"
461 + " \"resolution\":3.3,\n"
462 + " \"title\":\"Structural basis of phospho-peptide recognition by the BRCT domain of BRCA1, structure with phosphopeptide\"},\n"
464 + " \"experimental_method\":[\"X-ray diffraction\"],\n"
465 + " \"pdb_id\":\"1y98\",\n"
466 + " \"resolution\":2.5,\n"
467 + " \"title\":\"Structure of the BRCT repeats of BRCA1 bound to a CtIP phosphopeptide.\"},\n"
469 + " \"experimental_method\":[\"X-ray diffraction\"],\n"
470 + " \"pdb_id\":\"1t29\",\n"
471 + " \"resolution\":2.3,\n"
472 + " \"title\":\"Crystal structure of the BRCA1 BRCT repeats bound to a phosphorylated BACH1 peptide\"},\n"
474 + " \"experimental_method\":[\"X-ray diffraction\"],\n"
475 + " \"pdb_id\":\"3k0k\",\n"
476 + " \"resolution\":2.7,\n"
477 + " \"title\":\"Crystal Structure of BRCA1 BRCT in complex with a minimal recognition tetrapeptide with a free carboxy C-terminus.\"},\n"
479 + " \"experimental_method\":[\"X-ray diffraction\"],\n"
480 + " \"pdb_id\":\"3k0h\",\n"
481 + " \"resolution\":2.7,\n"
482 + " \"title\":\"The crystal structure of BRCA1 BRCT in complex with a minimal recognition tetrapeptide with an amidated C-terminus\"},\n"
484 + " \"experimental_method\":[\"X-ray diffraction\"],\n"
485 + " \"pdb_id\":\"4ifi\",\n"
486 + " \"resolution\":2.2,\n"
487 + " \"title\":\"Structure of human BRCA1 BRCT in complex with BAAT peptide\"},\n"
489 + " \"experimental_method\":[\"X-ray diffraction\"],\n"
490 + " \"pdb_id\":\"3pxd\",\n"
491 + " \"resolution\":2.8,\n"
492 + " \"title\":\"Impact of BRCA1 BRCT domain missense substitutions on phospho-peptide recognition: R1835P\"},\n"
494 + " \"experimental_method\":[\"X-ray diffraction\"],\n"
495 + " \"pdb_id\":\"3pxc\",\n"
496 + " \"resolution\":2.8,\n"
497 + " \"title\":\"Impact of BRCA1 BRCT domain missense substitutions on phospho-peptide recognition: R1699Q\"},\n"
499 + " \"experimental_method\":[\"X-ray diffraction\"],\n"
500 + " \"pdb_id\":\"1jnx\",\n"
501 + " \"resolution\":2.5,\n"
502 + " \"title\":\"Crystal structure of the BRCT repeat region from the breast cancer associated protein, BRCA1\"},\n"
504 + " \"experimental_method\":[\"X-ray diffraction\"],\n"
505 + " \"pdb_id\":\"3pxa\",\n"
506 + " \"resolution\":2.55,\n"
507 + " \"title\":\"Impact of BRCA1 BRCT domain missense substitutions on phospho-peptide recognition: G1656D\"},\n"
509 + " \"experimental_method\":[\"Solution NMR\"],\n"
510 + " \"pdb_id\":\"1jm7\",\n"
511 + " \"title\":\"Solution structure of the BRCA1/BARD1 RING-domain heterodimer\"},\n"
513 + " \"experimental_method\":[\"X-ray diffraction\"],\n"
514 + " \"pdb_id\":\"4igk\",\n"
515 + " \"resolution\":1.75,\n"
516 + " \"title\":\"Structure of human BRCA1 BRCT in complex with ATRIP peptide\"},\n"
518 + " \"experimental_method\":[\"X-ray diffraction\"],\n"
519 + " \"pdb_id\":\"1t2u\",\n"
520 + " \"resolution\":2.8,\n"
521 + " \"title\":\"Structural basis of phosphopeptide recognition by the BRCT domain of BRCA1: structure of BRCA1 missense variant V1809F\"},\n"
523 + " \"experimental_method\":[\"X-ray diffraction\"],\n"
524 + " \"pdb_id\":\"3pxb\",\n"
525 + " \"resolution\":2.5,\n"
526 + " \"title\":\"Impact of BRCA1 BRCT domain missense substitutions on phospho-peptide recognition: T1700A\"},\n"
528 + " \"experimental_method\":[\"X-ray diffraction\"],\n"
529 + " \"pdb_id\":\"1n5o\",\n"
530 + " \"resolution\":2.8,\n"
531 + " \"title\":\"Structural consequences of a cancer-causing BRCA1-BRCT missense mutation\"},\n"
533 + " \"experimental_method\":[\"X-ray diffraction\"],\n"
534 + " \"pdb_id\":\"3coj\",\n"
535 + " \"resolution\":3.21,\n"
536 + " \"title\":\"Crystal Structure of the BRCT Domains of Human BRCA1 in Complex with a Phosphorylated Peptide from Human Acetyl-CoA Carboxylase 1\"},\n"
538 + " \"experimental_method\":[\"Electron Microscopy\"],\n"
539 + " \"pdb_id\":\"6g2i\",\n"
540 + " \"resolution\":5.9,\n"
541 + " \"title\":\"Filament of acetyl-CoA carboxylase and BRCT domains of BRCA1 (ACC-BRCT) at 5.9 A resolution\"},\n"
543 + " \"experimental_method\":[\"X-ray diffraction\"],\n"
544 + " \"pdb_id\":\"4jlu\",\n"
545 + " \"resolution\":3.5,\n"
546 + " \"title\":\"Crystal structure of BRCA1 BRCT with doubly phosphorylated Abraxas\"},\n"
548 + " \"experimental_method\":[\"X-ray diffraction\"],\n"
549 + " \"pdb_id\":\"4ofb\",\n"
550 + " \"resolution\":3.05,\n"
551 + " \"title\":\"Crystal structure of human BRCA1 BRCT in complex with nonphosphopeptide inhibitor\"},\n"
553 + " \"experimental_method\":[\"X-ray diffraction\"],\n"
554 + " \"pdb_id\":\"3pxe\",\n"
555 + " \"resolution\":2.85,\n"
556 + " \"title\":\"Impact of BRCA1 BRCT domain missense substitutions on phospho-peptide recognition: E1836K\"},\n"
558 + " \"experimental_method\":[\"X-ray diffraction\"],\n"
559 + " \"pdb_id\":\"4u4a\",\n"
560 + " \"resolution\":3.51,\n"
561 + " \"title\":\"Complex Structure of BRCA1 BRCT with singly phospho Abraxas\"},\n"
563 + " \"experimental_method\":[\"X-ray diffraction\"],\n"
564 + " \"pdb_id\":\"4y2g\",\n"
565 + " \"resolution\":2.5,\n"
566 + " \"title\":\"Structure of BRCA1 BRCT domains in complex with Abraxas single phosphorylated peptide\"},\n"
568 + " \"experimental_method\":[\"X-ray diffraction\"],\n"
569 + " \"pdb_id\":\"4y18\",\n"
570 + " \"resolution\":3.5,\n"
571 + " \"title\":\"Structure of BRCA1 BRCT domains in complex with Abraxas double phosphorylated peptide\"},\n"
573 + " \"experimental_method\":[\"X-ray diffraction\"],\n"
574 + " \"pdb_id\":\"2ing\",\n"
575 + " \"resolution\":3.6,\n"
576 + " \"title\":\"X-ray Structure of the BRCA1 BRCT mutant M1775K\"},\n"
578 + " \"experimental_method\":[\"X-ray diffraction\"],\n"
579 + " \"pdb_id\":\"1t15\",\n"
580 + " \"resolution\":1.85,\n"
581 + " \"title\":\"Crystal Structure of the Brca1 BRCT Domains in Complex with the Phosphorylated Interacting Region from Bach1 Helicase\"},\n"
583 + " \"experimental_method\":[\"X-ray diffraction\"],\n"
584 + " \"pdb_id\":\"1t29\",\n"
585 + " \"resolution\":2.3,\n"
586 + " \"title\":\"Crystal structure of the BRCA1 BRCT repeats bound to a phosphorylated BACH1 peptide\"},\n"
588 + " \"experimental_method\":[\"Solution NMR\"],\n"
589 + " \"pdb_id\":\"1jm7\",\n"
590 + " \"title\":\"Solution structure of the BRCA1/BARD1 RING-domain heterodimer\"},\n"
592 + " \"experimental_method\":[\"X-ray diffraction\"],\n"
593 + " \"pdb_id\":\"1t2v\",\n"
594 + " \"resolution\":3.3,\n"
595 + " \"title\":\"Structural basis of phospho-peptide recognition by the BRCT domain of BRCA1, structure with phosphopeptide\"},\n"
597 + " \"experimental_method\":[\"X-ray diffraction\"],\n"
598 + " \"pdb_id\":\"4ifi\",\n"
599 + " \"resolution\":2.2,\n"
600 + " \"title\":\"Structure of human BRCA1 BRCT in complex with BAAT peptide\"},\n"
602 + " \"experimental_method\":[\"X-ray diffraction\"],\n"
603 + " \"pdb_id\":\"4igk\",\n"
604 + " \"resolution\":1.75,\n"
605 + " \"title\":\"Structure of human BRCA1 BRCT in complex with ATRIP peptide\"},\n"
607 + " \"experimental_method\":[\"X-ray diffraction\"],\n"
608 + " \"pdb_id\":\"3k0k\",\n"
609 + " \"resolution\":2.7,\n"
610 + " \"title\":\"Crystal Structure of BRCA1 BRCT in complex with a minimal recognition tetrapeptide with a free carboxy C-terminus.\"},\n"
612 + " \"experimental_method\":[\"X-ray diffraction\"],\n"
613 + " \"pdb_id\":\"3k16\",\n"
614 + " \"resolution\":3.0,\n"
615 + " \"title\":\"Crystal Structure of BRCA1 BRCT D1840T in complex with a minimal recognition tetrapeptide with a free carboxy C-terminus\"},\n"
617 + " \"experimental_method\":[\"X-ray diffraction\"],\n"
618 + " \"pdb_id\":\"3k15\",\n"
619 + " \"resolution\":2.8,\n"
620 + " \"title\":\"Crystal Structure of BRCA1 BRCT D1840T in complex with a minimal recognition tetrapeptide with an amidated C-terminus\"},\n"
622 + " \"experimental_method\":[\"X-ray diffraction\"],\n"
623 + " \"pdb_id\":\"3k0h\",\n"
624 + " \"resolution\":2.7,\n"
625 + " \"title\":\"The crystal structure of BRCA1 BRCT in complex with a minimal recognition tetrapeptide with an amidated C-terminus\"},\n"
627 + " \"experimental_method\":[\"X-ray diffraction\"],\n"
628 + " \"pdb_id\":\"1y98\",\n"
629 + " \"resolution\":2.5,\n"
630 + " \"title\":\"Structure of the BRCT repeats of BRCA1 bound to a CtIP phosphopeptide.\"},\n"
632 + " \"experimental_method\":[\"X-ray diffraction\"],\n"
633 + " \"pdb_id\":\"3coj\",\n"
634 + " \"resolution\":3.21,\n"
635 + " \"title\":\"Crystal Structure of the BRCT Domains of Human BRCA1 in Complex with a Phosphorylated Peptide from Human Acetyl-CoA Carboxylase 1\"},\n"
637 + " \"experimental_method\":[\"X-ray diffraction\"],\n"
638 + " \"pdb_id\":\"4y18\",\n"
639 + " \"resolution\":3.5,\n"
640 + " \"title\":\"Structure of BRCA1 BRCT domains in complex with Abraxas double phosphorylated peptide\"},\n"
642 + " \"experimental_method\":[\"Electron Microscopy\"],\n"
643 + " \"pdb_id\":\"7jzv\",\n"
644 + " \"resolution\":3.9,\n"
645 + " \"title\":\"Cryo-EM structure of the BRCA1-UbcH5c/BARD1 E3-E2 module bound to a nucleosome\"},\n"
647 + " \"experimental_method\":[\"Electron Microscopy\"],\n"
648 + " \"pdb_id\":\"7jzv\",\n"
649 + " \"resolution\":3.9,\n"
650 + " \"title\":\"Cryo-EM structure of the BRCA1-UbcH5c/BARD1 E3-E2 module bound to a nucleosome\"},\n"
652 + " \"experimental_method\":[\"Electron Microscopy\"],\n"
653 + " \"pdb_id\":\"7lyb\",\n"
654 + " \"resolution\":3.28,\n"
655 + " \"title\":\"Cryo-EM structure of the human nucleosome core particle in complex with BRCA1-BARD1-UbcH5c\"},\n"
657 + " \"experimental_method\":[\"Electron Microscopy\"],\n"
658 + " \"pdb_id\":\"7lyb\",\n"
659 + " \"resolution\":3.28,\n"
660 + " \"title\":\"Cryo-EM structure of the human nucleosome core particle in complex with BRCA1-BARD1-UbcH5c\"},\n"
662 + " \"experimental_method\":[\"Electron Microscopy\"],\n"
663 + " \"pdb_id\":\"7lyb\",\n"
664 + " \"resolution\":3.28,\n"
665 + " \"title\":\"Cryo-EM structure of the human nucleosome core particle in complex with BRCA1-BARD1-UbcH5c\"},\n"
667 + " \"experimental_method\":[\"Electron Microscopy\"],\n"
668 + " \"pdb_id\":\"7jzv\",\n"
669 + " \"resolution\":3.9,\n"
670 + " \"title\":\"Cryo-EM structure of the BRCA1-UbcH5c/BARD1 E3-E2 module bound to a nucleosome\"},\n"
672 + " \"experimental_method\":[\"Electron Microscopy\"],\n"
673 + " \"pdb_id\":\"7lyb\",\n"
674 + " \"resolution\":3.28,\n"
675 + " \"title\":\"Cryo-EM structure of the human nucleosome core particle in complex with BRCA1-BARD1-UbcH5c\"},\n"
677 + " \"experimental_method\":[\"Electron Microscopy\"],\n"
678 + " \"pdb_id\":\"7jzv\",\n"
679 + " \"resolution\":3.9,\n"
680 + " \"title\":\"Cryo-EM structure of the BRCA1-UbcH5c/BARD1 E3-E2 module bound to a nucleosome\"},\n"
682 + " \"experimental_method\":[\"Electron Microscopy\"],\n"
683 + " \"pdb_id\":\"7lyb\",\n"
684 + " \"resolution\":3.28,\n"
685 + " \"title\":\"Cryo-EM structure of the human nucleosome core particle in complex with BRCA1-BARD1-UbcH5c\"},\n"
687 + " \"experimental_method\":[\"Electron Microscopy\"],\n"
688 + " \"pdb_id\":\"7jzv\",\n"
689 + " \"resolution\":3.9,\n"
690 + " \"title\":\"Cryo-EM structure of the BRCA1-UbcH5c/BARD1 E3-E2 module bound to a nucleosome\"},\n"
692 + " \"experimental_method\":[\"Electron Microscopy\"],\n"
693 + " \"pdb_id\":\"7lyb\",\n"
694 + " \"resolution\":3.28,\n"
695 + " \"title\":\"Cryo-EM structure of the human nucleosome core particle in complex with BRCA1-BARD1-UbcH5c\"},\n"
697 + " \"experimental_method\":[\"Electron Microscopy\"],\n"
698 + " \"pdb_id\":\"7lyb\",\n"
699 + " \"resolution\":3.28,\n"
700 + " \"title\":\"Cryo-EM structure of the human nucleosome core particle in complex with BRCA1-BARD1-UbcH5c\"},\n"
702 + " \"experimental_method\":[\"Electron Microscopy\"],\n"
703 + " \"pdb_id\":\"7lyb\",\n"
704 + " \"resolution\":3.28,\n"
705 + " \"title\":\"Cryo-EM structure of the human nucleosome core particle in complex with BRCA1-BARD1-UbcH5c\"},\n"
707 + " \"experimental_method\":[\"Electron Microscopy\"],\n"
708 + " \"pdb_id\":\"7jzv\",\n"
709 + " \"resolution\":3.9,\n"
710 + " \"title\":\"Cryo-EM structure of the BRCA1-UbcH5c/BARD1 E3-E2 module bound to a nucleosome\"},\n"
712 + " \"experimental_method\":[\"Electron Microscopy\"],\n"
713 + " \"pdb_id\":\"6g2i\",\n"
714 + " \"resolution\":5.9,\n"
715 + " \"title\":\"Filament of acetyl-CoA carboxylase and BRCT domains of BRCA1 (ACC-BRCT) at 5.9 A resolution\"},\n"
717 + " \"experimental_method\":[\"Electron Microscopy\"],\n"
718 + " \"pdb_id\":\"7jzv\",\n"
719 + " \"resolution\":3.9,\n"
720 + " \"title\":\"Cryo-EM structure of the BRCA1-UbcH5c/BARD1 E3-E2 module bound to a nucleosome\"},\n"
722 + " \"experimental_method\":[\"Electron Microscopy\"],\n"
723 + " \"pdb_id\":\"7lyb\",\n"
724 + " \"resolution\":3.28,\n"
725 + " \"title\":\"Cryo-EM structure of the human nucleosome core particle in complex with BRCA1-BARD1-UbcH5c\"},\n"
727 + " \"experimental_method\":[\"Electron Microscopy\"],\n"
728 + " \"pdb_id\":\"7jzv\",\n"
729 + " \"resolution\":3.9,\n"
730 + " \"title\":\"Cryo-EM structure of the BRCA1-UbcH5c/BARD1 E3-E2 module bound to a nucleosome\"}]\n"
735 for (int i = 1; i < 3; i++)
739 { readJsonStringFromFile(
740 "test/jalview/fts/threedbeacons/p01308_pdbfts_query_pt"
741 + i + ".txt").trim(),
742 readJsonStringFromFile(
743 "test/jalview/fts/threedbeacons/p01308_pdbfts_query_pt"
744 + i + "_resp.txt").trim() });
746 for (int i = 1; i < 6; i++)
751 { readJsonStringFromFile(
752 "test/jalview/fts/threedbeacons/p0dtd1_pdbfts_fts_query_pt"
753 + i + ".txt").trim(),
754 readJsonStringFromFile(
755 "test/jalview/fts/threedbeacons/p0dtd1_pdbfts_fts_query_pt"
756 + i + "_resp.txt").trim() });
761 { "https://www.ebi.ac.uk/pdbe/search/pdb/select?wt=json&fl=pdb_id,title,experimental_method,resolution&rows=500&start=0&q=(1gaq+OR+5h92+OR+3b2f+OR+3w5u+OR+5h8y+OR+3w5v)+AND+molecule_sequence:%5B''+TO+*%5D+AND+status:REL&sort=",
762 "{\n" + " \"responseHeader\":{\n" + " \"status\":0,\n"
763 + " \"QTime\":0,\n" + " \"params\":{\n"
764 + " \"q\":\"(1gaq OR 5h92 OR 3b2f OR 3w5u OR 5h8y OR 3w5v) AND molecule_sequence:['' TO *] AND status:REL\",\n"
765 + " \"fl\":\"pdb_id,title,experimental_method,resolution\",\n"
766 + " \"start\":\"0\",\n"
767 + " \"sort\":\"\",\n"
768 + " \"rows\":\"500\",\n"
769 + " \"wt\":\"json\"}},\n"
770 + " \"response\":{\"numFound\":11,\"start\":0,\"docs\":[\n"
772 + " \"experimental_method\":[\"X-ray diffraction\"],\n"
773 + " \"pdb_id\":\"3b2f\",\n"
774 + " \"resolution\":1.7,\n"
775 + " \"title\":\"Maize Ferredoxin 1\"},\n"
777 + " \"experimental_method\":[\"X-ray diffraction\"],\n"
778 + " \"pdb_id\":\"5h92\",\n"
779 + " \"resolution\":2.08,\n"
780 + " \"title\":\"Crystal structure of the complex between maize Sulfite Reductase and ferredoxin in the form-3 crystal\"},\n"
782 + " \"experimental_method\":[\"X-ray diffraction\"],\n"
783 + " \"pdb_id\":\"5h8y\",\n"
784 + " \"resolution\":2.2,\n"
785 + " \"title\":\"Crystal structure of the complex between maize sulfite reductase and ferredoxin in the form-2 crystal\"},\n"
787 + " \"experimental_method\":[\"X-ray diffraction\"],\n"
788 + " \"pdb_id\":\"1gaq\",\n"
789 + " \"resolution\":2.59,\n"
790 + " \"title\":\"CRYSTAL STRUCTURE OF THE COMPLEX BETWEEN FERREDOXIN AND FERREDOXIN-NADP+ REDUCTASE\"},\n"
792 + " \"experimental_method\":[\"X-ray diffraction\"],\n"
793 + " \"pdb_id\":\"3w5u\",\n"
794 + " \"resolution\":2.7,\n"
795 + " \"title\":\"Cross-linked complex between Ferredoxin and Ferredoxin-NADP+ reductase\"},\n"
797 + " \"experimental_method\":[\"X-ray diffraction\"],\n"
798 + " \"pdb_id\":\"3w5v\",\n"
799 + " \"resolution\":3.81,\n"
800 + " \"title\":\"Cross-linked complex between Ferredoxin and Ferredoxin-NADP+ reductase\"},\n"
802 + " \"experimental_method\":[\"X-ray diffraction\"],\n"
803 + " \"pdb_id\":\"3w5u\",\n"
804 + " \"resolution\":2.7,\n"
805 + " \"title\":\"Cross-linked complex between Ferredoxin and Ferredoxin-NADP+ reductase\"},\n"
807 + " \"experimental_method\":[\"X-ray diffraction\"],\n"
808 + " \"pdb_id\":\"3w5v\",\n"
809 + " \"resolution\":3.81,\n"
810 + " \"title\":\"Cross-linked complex between Ferredoxin and Ferredoxin-NADP+ reductase\"},\n"
812 + " \"experimental_method\":[\"X-ray diffraction\"],\n"
813 + " \"pdb_id\":\"1gaq\",\n"
814 + " \"resolution\":2.59,\n"
815 + " \"title\":\"CRYSTAL STRUCTURE OF THE COMPLEX BETWEEN FERREDOXIN AND FERREDOXIN-NADP+ REDUCTASE\"},\n"
817 + " \"experimental_method\":[\"X-ray diffraction\"],\n"
818 + " \"pdb_id\":\"5h92\",\n"
819 + " \"resolution\":2.08,\n"
820 + " \"title\":\"Crystal structure of the complex between maize Sulfite Reductase and ferredoxin in the form-3 crystal\"},\n"
822 + " \"experimental_method\":[\"X-ray diffraction\"],\n"
823 + " \"pdb_id\":\"5h8y\",\n"
824 + " \"resolution\":2.2,\n"
825 + " \"title\":\"Crystal structure of the complex between maize sulfite reductase and ferredoxin in the form-2 crystal\"}]\n"
829 { "https://www.ebi.ac.uk/pdbe/search/pdb/select?wt=json&fl=pdb_id,title,experimental_method,resolution&rows=500&start=0&q=(4gs9+OR+6bvb+OR+8ck8+OR+8ck3+OR+6x3d+OR+8ck4+OR+6x28+OR+6i7r+OR+3h82+OR+6i7q+OR+6x21+OR+4xt2+OR+5kiz+OR+7q5v+OR+6x2h+OR+7q5x+OR+3f1n+OR+3f1o+OR+2a24+OR+3f1p+OR+1p97+OR+4ghi+OR+3h7w+OR+6d09+OR+6czw+OR+7ujv+OR+5tbm+OR+5ufp+OR+4pky+OR+6d0b+OR+6d0c+OR+6x37)+AND+molecule_sequence:%5B''+TO+*%5D+AND+status:REL&sort=",
830 readJsonStringFromFile(
831 "test/jalview/fts/threedbeacons/q99814_tdb_pdbfts_query_resp.txt") });
832 } catch (Throwable e)
834 Assert.fail("Couldn't read mock data.", e);
837 * updating mocks for p0dtd1 require very long URLs to be queried
838 for i in test/jalview/fts/threedbeacons/p0dtd1_pdbfts_fts_query_pt?.txt; do wget -i $i -O ${i/.txt/_resp.txt}; done
840 FTSRestClient.createMockFTSRestClient(
841 (FTSRestClient) PDBFTSRestClient.getInstance(),
842 mocks.toArray(new String[0][2]));