1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
package jalview.gui.structurechooser; |
22 |
|
|
23 |
|
import static org.testng.Assert.assertEquals; |
24 |
|
import static org.testng.Assert.assertTrue; |
25 |
|
import static org.testng.Assert.fail; |
26 |
|
|
27 |
|
import java.util.ArrayList; |
28 |
|
import java.util.List; |
29 |
|
import java.util.Vector; |
30 |
|
|
31 |
|
import org.junit.Assert; |
32 |
|
import org.testng.AssertJUnit; |
33 |
|
import org.testng.annotations.AfterMethod; |
34 |
|
import org.testng.annotations.BeforeClass; |
35 |
|
import org.testng.annotations.BeforeMethod; |
36 |
|
import org.testng.annotations.DataProvider; |
37 |
|
import org.testng.annotations.Test; |
38 |
|
|
39 |
|
import jalview.datamodel.DBRefEntry; |
40 |
|
import jalview.datamodel.DBRefSource; |
41 |
|
import jalview.datamodel.PDBEntry; |
42 |
|
import jalview.datamodel.Sequence; |
43 |
|
import jalview.datamodel.SequenceI; |
44 |
|
import jalview.fts.api.FTSData; |
45 |
|
import jalview.fts.api.FTSDataColumnI; |
46 |
|
import jalview.fts.core.FTSRestRequest; |
47 |
|
import jalview.fts.core.FTSRestResponse; |
48 |
|
import jalview.fts.service.pdb.PDBFTSRestClientTest; |
49 |
|
import jalview.fts.service.threedbeacons.TDB_FTSData; |
50 |
|
import jalview.fts.service.threedbeacons.TDBeaconsFTSRestClient; |
51 |
|
import jalview.fts.threedbeacons.TDBeaconsFTSRestClientTest; |
52 |
|
import jalview.gui.JvOptionPane; |
53 |
|
import jalview.gui.StructureChooser; |
54 |
|
import jalview.jbgui.FilterOption; |
55 |
|
|
|
|
| 98.6% |
Uncovered Elements: 2 (140) |
Complexity: 12 |
Complexity Density: 0.1 |
|
56 |
|
public class StructureChooserQuerySourceTest |
57 |
|
{ |
58 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
59 |
1 |
@BeforeClass(alwaysRun = true)... |
60 |
|
public void setUpJvOptionPane() |
61 |
|
{ |
62 |
1 |
JvOptionPane.setInteractiveMode(false); |
63 |
1 |
JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); |
64 |
|
} |
65 |
|
|
66 |
|
Sequence seq, upSeq, upSeq_insulin, upSeq_r1ab; |
67 |
|
|
68 |
|
private Sequence upSeq_fer1_maize; |
69 |
|
|
70 |
|
private Sequence upSeq_epas1_human; |
71 |
|
|
72 |
|
|
73 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (33) |
Complexity: 2 |
Complexity Density: 0.06 |
|
74 |
9 |
@BeforeMethod(alwaysRun = true)... |
75 |
|
public void setUp() throws Exception |
76 |
|
{ |
77 |
9 |
seq = new Sequence("PDB|4kqy|4KQY|A", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 1, |
78 |
|
26); |
79 |
9 |
seq.createDatasetSequence(); |
80 |
45 |
for (int x = 1; x < 5; x++) |
81 |
|
{ |
82 |
36 |
DBRefEntry dbRef = new DBRefEntry(); |
83 |
36 |
dbRef.setAccessionId("XYZ_" + x); |
84 |
36 |
seq.addDBRef(dbRef); |
85 |
|
} |
86 |
|
|
87 |
9 |
PDBEntry dbRef = new PDBEntry(); |
88 |
9 |
dbRef.setId("1tim"); |
89 |
|
|
90 |
9 |
Vector<PDBEntry> pdbIds = new Vector<>(); |
91 |
9 |
pdbIds.add(dbRef); |
92 |
|
|
93 |
9 |
seq.setPDBId(pdbIds); |
94 |
|
|
95 |
|
|
96 |
9 |
upSeq = new Sequence("P38398", |
97 |
|
"MDLSALRVEEVQNVINAMQKILECPICLELIKEPVSTKCDHIFCKFCMLKLLNQKKGPSQCPLCKNDITKRS\n" |
98 |
|
+ "LQESTRFSQLVEELLKIICAFQLDTGLEYANSYNFAKKENNSPEHLKDEVSIIQSMGYRNRAKRLLQSEPEN\n" |
99 |
|
+ "PSLQETSLSVQLSNLGTVRTLRTKQRIQPQKTSVYIELGSDSSEDTVNKATYCSVGDQELLQITPQGTRDEI\n" |
100 |
|
+ "SLDSAKKAACEFSETDVTNTEHHQPSNNDLNTTEKRAAERHPEKYQGSSVSNLHVEPCGTNTHASSLQHENS\n" |
101 |
|
+ "SLLLTKDRMNVEKAEFCNKSKQPGLARSQHNRWAGSKETCNDRRTPSTEKKVDLNADPLCERKEWNKQKLPC\n" |
102 |
|
+ "SENPRDTEDVPWITLNSSIQKVNEWFSRSDELLGSDDSHDGESESNAKVADVLDVLNEVDEYSGSSEKIDLL\n" |
103 |
|
+ "ASDPHEALICKSERVHSKSVESNIEDKIFGKTYRKKASLPNLSHVTENLIIGAFVTEPQIIQERPLTNKLKR\n" |
104 |
|
+ "KRRPTSGLHPEDFIKKADLAVQKTPEMINQGTNQTEQNGQVMNITNSGHENKTKGDSIQNEKNPNPIESLEK\n" |
105 |
|
+ "ESAFKTKAEPISSSISNMELELNIHNSKAPKKNRLRRKSSTRHIHALELVVSRNLSPPNCTELQIDSCSSSE\n" |
106 |
|
+ "EIKKKKYNQMPVRHSRNLQLMEGKEPATGAKKSNKPNEQTSKRHDSDTFPELKLTNAPGSFTKCSNTSELKE\n" |
107 |
|
+ "FVNPSLPREEKEEKLETVKVSNNAEDPKDLMLSGERVLQTERSVESSSISLVPGTDYGTQESISLLEVSTLG\n" |
108 |
|
+ "KAKTEPNKCVSQCAAFENPKGLIHGCSKDNRNDTEGFKYPLGHEVNHSRETSIEMEESELDAQYLQNTFKVS\n" |
109 |
|
+ "KRQSFAPFSNPGNAEEECATFSAHSGSLKKQSPKVTFECEQKEENQGKNESNIKPVQTVNITAGFPVVGQKD\n" |
110 |
|
+ "KPVDNAKCSIKGGSRFCLSSQFRGNETGLITPNKHGLLQNPYRIPPLFPIKSFVKTKCKKNLLEENFEEHSM\n" |
111 |
|
+ "SPEREMGNENIPSTVSTISRNNIRENVFKEASSSNINEVGSSTNEVGSSINEIGSSDENIQAELGRNRGPKL\n" |
112 |
|
+ "NAMLRLGVLQPEVYKQSLPGSNCKHPEIKKQEYEEVVQTVNTDFSPYLISDNLEQPMGSSHASQVCSETPDD\n" |
113 |
|
+ "LLDDGEIKEDTSFAENDIKESSAVFSKSVQKGELSRSPSPFTHTHLAQGYRRGAKKLESSEENLSSEDEELP\n" |
114 |
|
+ "CFQHLLFGKVNNIPSQSTRHSTVATECLSKNTEENLLSLKNSLNDCSNQVILAKASQEHHLSEETKCSASLF\n" |
115 |
|
+ "SSQCSELEDLTANTNTQDPFLIGSSKQMRHQSESQGVGLSDKELVSDDEERGTGLEENNQEEQSMDSNLGEA\n" |
116 |
|
+ "ASGCESETSVSEDCSGLSSQSDILTTQQRDTMQHNLIKLQQEMAELEAVLEQHGSQPSNSYPSIISDSSALE\n" |
117 |
|
+ "DLRNPEQSTSEKAVLTSQKSSEYPISQNPEGLSADKFEVSADSSTSKNKEPGVERSSPSKCPSLDDRWYMHS\n" |
118 |
|
+ "CSGSLQNRNYPSQEELIKVVDVEEQQLEESGPHDLTETSYLPRQDLEGTPYLESGISLFSDDPESDPSEDRA\n" |
119 |
|
+ "PESARVGNIPSSTSALKVPQLKVAESAQSPAAAHTTDTAGYNAMEESVSREKPELTASTERVNKRMSMVVSG\n" |
120 |
|
+ "LTPEEFMLVYKFARKHHITLTNLITEETTHVVMKTDAEFVCERTLKYFLGIAGGKWVVSYFWVTQSIKERKM\n" |
121 |
|
+ "LNEHDFEVRGDVVNGRNHQGPKRARESQDRKIFRGLEICCYGPFTNMPTDQLEWMVQLCGASVVKELSSFTL\n" |
122 |
|
+ "GTGVHPIVVVQPDAWTEDNGFHAIGQMCEAPVVTREWVLDSVALYQCQELDTYLIPQIPHSHY\n" |
123 |
|
+ "", |
124 |
|
1, 1863); |
125 |
9 |
upSeq.createDatasetSequence(); |
126 |
9 |
upSeq.setDescription("Breast cancer type 1 susceptibility protein"); |
127 |
9 |
upSeq.addDBRef(new DBRefEntry("UNIPROT", "0", "P38398", null, true)); |
128 |
|
|
129 |
9 |
upSeq_insulin = new Sequence("INS_HUMAN", |
130 |
|
"MALWMRLLPLLALLALWGPDPAAAFVNQHLCGSHLVEALYLVCGERGFFYTPKTRREAEDLQVGQVELGGGP" |
131 |
|
+ "GAGSLQPLALEGSLQKRGIVEQCCTSICSLYQLENYCN"); |
132 |
9 |
upSeq_insulin.createDatasetSequence(); |
133 |
9 |
upSeq_insulin.setDescription("Insulin"); |
134 |
9 |
upSeq_insulin |
135 |
|
.addDBRef(new DBRefEntry("UNIPROT", "0", "P01308", null, true)); |
136 |
|
|
137 |
9 |
upSeq_r1ab = new Sequence("R1AB_SARS2", |
138 |
|
"MESLVPGFNEKTHVQLSLPVLQVRDVLVRGFGDSVEEVLSEARQHLKDGTCGLVEVEKGVLPQLEQPYVFIK\n" |
139 |
|
+ "RSDARTAPHGHVMVELVAELEGIQYGRSGETLGVLVPHVGEIPVAYRKVLLRKNGNKGAGGHSYGADLKSFD\n" |
140 |
|
+ "LGDELGTDPYEDFQENWNTKHSSGVTRELMRELNGGAYTRYVDNNFCGPDGYPLECIKDLLARAGKASCTLS\n" |
141 |
|
+ "EQLDFIDTKRGVYCCREHEHEIAWYTERSEKSYELQTPFEIKLAKKFDTFNGECPNFVFPLNSIIKTIQPRV\n" |
142 |
|
+ "EKKKLDGFMGRIRSVYPVASPNECNQMCLSTLMKCDHCGETSWQTGDFVKATCEFCGTENLTKEGATTCGYL\n" |
143 |
|
+ "PQNAVVKIYCPACHNSEVGPEHSLAEYHNESGLKTILRKGGRTIAFGGCVFSYVGCHNKCAYWVPRASANIG\n" |
144 |
|
+ "CNHTGVVGEGSEGLNDNLLEILQKEKVNINIVGDFKLNEEIAIILASFSASTSAFVETVKGLDYKAFKQIVE\n" |
145 |
|
+ "SCGNFKVTKGKAKKGAWNIGEQKSILSPLYAFASEAARVVRSIFSRTLETAQNSVRVLQKAAITILDGISQY\n" |
146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RQWLPTGTLLVDSDLNDFVSDADSTLIGD\n" |
234 |
|
+ "CATVHTANKWDLIISDMYDPKTKNVTKENDSKEGFFTYICGFIQQKLALGGSVAIKITEHSWNADLYKLMGH\n" |
235 |
|
+ "FAWWTAFVTNVNASSSEAFLIGCNYLGKPREQIDGYVMHANYIFWRNTNPIQLSSYSLFDMSKFPLKLRGTA\n" |
236 |
|
+ "VMSLKEGQINDMILSLLSKGRLIIRENNRVVISSDVLVNN"); |
237 |
9 |
upSeq_r1ab.setDescription("sars2 r1ab polyprotein"); |
238 |
9 |
upSeq_r1ab |
239 |
|
.addDBRef(new DBRefEntry("UNIPROT", "0", "P0DTD1", null, true)); |
240 |
9 |
upSeq_r1ab.createDatasetSequence(); |
241 |
9 |
upSeq_fer1_maize = new Sequence("FER1_MAIZE", |
242 |
|
"MATVLGSPRAPAFFFSSSSLRAAPAPTAVALPAAKVGIMGRSASSRRRLRAQATYNVKLITPEGE" |
243 |
|
+ "VELQVPDDVYILDQAEEDGIDLPYSCRAGSCSSCAGKVVSGSVDQSDQSYLDDGQIADGWVLTCHAYPTSDV" |
244 |
|
+ "VIETHKEEELTGA"); |
245 |
9 |
upSeq_fer1_maize.setDescription("Feredoxin 1 Maize"); |
246 |
9 |
upSeq_fer1_maize |
247 |
|
.addDBRef(new DBRefEntry("UNIPROT", "0", "P27787", null, true)); |
248 |
9 |
upSeq_fer1_maize.createDatasetSequence(); |
249 |
|
|
250 |
9 |
upSeq_epas1_human = new Sequence("EPAS1_HUMAN", |
251 |
|
"MTADKEKKRSSSERRKEKSRDAARCRRSKETEVFYELAHELPLPHSVSSHLDKASIMRLAISFLRTHKLLSS\n" |
252 |
|
+ "VCSENESEAEADQQMDNLYLKALEGFIAVVTQDGDMIFLSENISKFMGLTQVELTGHSIFDFTHPCDHEEIR\n" |
253 |
|
+ "ENLSLKNGSGFGKKSKDMSTERDFFMRMKCTVTNRGRTVNLKSATWKVLHCTGQVKVYNNCPPHNSLCGYKE\n" |
254 |
|
+ "PLLSCLIIMCEPIQHPSHMDIPLDSKTFLSRHSMDMKFTYCDDRITELIGYHPEELLGRSAYEFYHALDSEN\n" |
255 |
|
+ "MTKSHQNLCTKGQVVSGQYRMLAKHGGYVWLETQGTVIYNPRNLQPQCIMCVNYVLSEIEKNDVVFSMDQTE\n" |
256 |
|
+ "SLFKPHLMAMNSIFDSSGKGAVSEKSNFLFTKLKEEPEELAQLAPTPGDAIISLDFGNQNFEESSAYGKAIL\n" |
257 |
|
+ "PPSQPWATELRSHSTQSEAGSLPAFTVPQAAAPGSTTPSATSSSSSCSTPNSPEDYYTSLDNDLKIEVIEKL\n" |
258 |
|
+ "FAMDTEAKDQCSTQTDFNELDLETLAPYIPMDGEDFQLSPICPEERLLAENPQSTPQHCFSAMTNIFQPLAP\n" |
259 |
|
+ "VAPHSPFLLDKFQQQLESKKTEPEHRPMSSIFFDAGSKASLPPCCGQASTPLSSMGGRSNTQWPPDPPLHFG\n" |
260 |
|
+ "PTKWAVGDQRTEFLGAAPLGPPVSPPHVSTFKTRSAKGFGARGPDVLSPAMVALSNKLKLKRQLEYEEQAFQ\n" |
261 |
|
+ "DLSGGDPPGGSTSHLMWKRMKNLRGGSCPLMPDKPLSANVPNDKFTQNPMRGLGHPLRHLPLPQPPSAISPG\n" |
262 |
|
+ "ENSKSRFPPQCYATQYQDYSLSSAHKVSGMASRLLGPSFESYLLPELTRYDCEVNVPVLGSSTLLQGGDLLR\n" |
263 |
|
+ "ALDQAT"); |
264 |
9 |
upSeq_epas1_human |
265 |
|
.setDescription("Endothelial PAS domain-containing protein 1"); |
266 |
9 |
upSeq_epas1_human |
267 |
|
.addDBRef(new DBRefEntry("UNIPROT", "0", "Q99814", null, true)); |
268 |
9 |
upSeq_epas1_human.createDatasetSequence(); |
269 |
|
} |
270 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
|
271 |
8 |
@AfterMethod(alwaysRun = true)... |
272 |
|
public void tearDown() throws Exception |
273 |
|
{ |
274 |
8 |
seq = null; |
275 |
8 |
upSeq = null; |
276 |
8 |
upSeq_r1ab = null; |
277 |
8 |
upSeq_fer1_maize = null; |
278 |
8 |
upSeq_epas1_human = null; |
279 |
|
} |
280 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (31) |
Complexity: 2 |
Complexity Density: 0.07 |
1PASS
|
|
281 |
1 |
@SuppressWarnings("deprecation")... |
282 |
|
@Test(groups = { "Functional" }) |
283 |
|
public void buildPDBQueryTest() |
284 |
|
{ |
285 |
1 |
System.out.println("seq >>>> " + seq); |
286 |
|
|
287 |
1 |
StructureChooserQuerySource scquery = StructureChooserQuerySource |
288 |
|
.getQuerySourceFor(new SequenceI[] |
289 |
|
{ seq }); |
290 |
1 |
AssertJUnit |
291 |
|
.assertTrue(scquery instanceof PDBStructureChooserQuerySource); |
292 |
1 |
String query = scquery.buildQuery(seq); |
293 |
1 |
AssertJUnit.assertEquals("pdb_id:1tim", query); |
294 |
1 |
seq.getAllPDBEntries().clear(); |
295 |
1 |
query = scquery.buildQuery(seq); |
296 |
1 |
AssertJUnit.assertEquals( |
297 |
|
"text:XYZ_1 OR text:XYZ_2 OR text:XYZ_3 OR text:XYZ_4 OR text:4kqy", |
298 |
|
query); |
299 |
1 |
seq.setDBRefs(null); |
300 |
1 |
query = scquery.buildQuery(seq); |
301 |
1 |
System.out.println(query); |
302 |
1 |
AssertJUnit.assertEquals("text:4kqy", query); |
303 |
|
|
304 |
1 |
DBRefEntry uniprotDBRef = new DBRefEntry(); |
305 |
1 |
uniprotDBRef.setAccessionId("P12345"); |
306 |
1 |
uniprotDBRef.setSource(DBRefSource.UNIPROT); |
307 |
1 |
seq.addDBRef(uniprotDBRef); |
308 |
|
|
309 |
1 |
DBRefEntry pdbDBRef = new DBRefEntry(); |
310 |
1 |
pdbDBRef.setAccessionId("1XYZ"); |
311 |
1 |
pdbDBRef.setSource(DBRefSource.PDB); |
312 |
1 |
seq.addDBRef(pdbDBRef); |
313 |
|
|
314 |
5 |
for (int x = 1; x < 5; x++) |
315 |
|
{ |
316 |
4 |
DBRefEntry dbRef = new DBRefEntry(); |
317 |
4 |
dbRef.setAccessionId("XYZ_" + x); |
318 |
4 |
seq.addDBRef(dbRef); |
319 |
|
} |
320 |
1 |
System.out.println(""); |
321 |
1 |
System.out.println(seq.getDBRefs()); |
322 |
1 |
System.out.println(query); |
323 |
1 |
query = scquery.buildQuery(seq); |
324 |
1 |
AssertJUnit.assertEquals( |
325 |
|
"uniprot_accession:P12345 OR uniprot_id:P12345 OR pdb_id:1xyz", |
326 |
|
query); |
327 |
|
} |
328 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (13) |
Complexity: 1 |
Complexity Density: 0.08 |
1PASS
|
|
329 |
1 |
@SuppressWarnings("deprecation")... |
330 |
|
@Test(groups = { "Functional" }) |
331 |
|
public void buildThreeDBQueryTest() |
332 |
|
{ |
333 |
1 |
System.out.println("seq >>>> " + upSeq); |
334 |
1 |
TDBeaconsFTSRestClientTest.setMock(); |
335 |
1 |
PDBFTSRestClientTest.setMock(); |
336 |
1 |
StructureChooserQuerySource scquery = StructureChooserQuerySource |
337 |
|
.getQuerySourceFor(new SequenceI[] |
338 |
|
{ upSeq }); |
339 |
|
|
340 |
|
|
341 |
1 |
AssertJUnit.assertTrue( |
342 |
|
scquery instanceof ThreeDBStructureChooserQuerySource); |
343 |
1 |
String query = scquery.buildQuery(upSeq); |
344 |
1 |
AssertJUnit.assertEquals("P38398", query); |
345 |
|
|
346 |
|
|
347 |
|
|
348 |
1 |
upSeq.getAllPDBEntries().clear(); |
349 |
1 |
query = scquery.buildQuery(upSeq); |
350 |
1 |
AssertJUnit.assertEquals("P38398", query); |
351 |
1 |
upSeq.setDBRefs(null); |
352 |
1 |
query = scquery.buildQuery(upSeq); |
353 |
|
|
354 |
|
|
355 |
|
|
356 |
|
|
357 |
|
|
358 |
|
|
359 |
|
|
360 |
|
|
361 |
|
|
362 |
|
|
363 |
1 |
AssertJUnit.assertEquals(null, query); |
364 |
|
|
365 |
|
|
366 |
|
|
367 |
|
|
368 |
|
|
369 |
|
|
370 |
|
|
371 |
|
|
372 |
|
|
373 |
|
|
374 |
|
|
375 |
|
|
376 |
|
|
377 |
|
|
378 |
|
|
379 |
|
|
380 |
|
|
381 |
|
|
382 |
|
|
383 |
|
|
384 |
|
|
385 |
|
|
386 |
|
|
387 |
|
|
388 |
|
|
389 |
|
|
390 |
|
|
391 |
|
|
392 |
|
|
393 |
|
|
394 |
|
|
395 |
|
|
396 |
|
|
397 |
|
|
398 |
|
|
399 |
|
|
400 |
|
|
401 |
|
|
402 |
|
|
403 |
|
} |
404 |
|
|
|
|
| 94.7% |
Uncovered Elements: 2 (38) |
Complexity: 3 |
Complexity Density: 0.08 |
1PASS
|
|
405 |
5 |
@Test(groups = { "Functional" }, dataProvider = "testUpSeqs")... |
406 |
|
public void cascadingThreeDBandPDBQuerys(SequenceI testUpSeq) |
407 |
|
{ |
408 |
5 |
TDBeaconsFTSRestClientTest.setMock(); |
409 |
5 |
PDBFTSRestClientTest.setMock(); |
410 |
5 |
ThreeDBStructureChooserQuerySource tdbquery = new ThreeDBStructureChooserQuerySource(); |
411 |
5 |
PDBStructureChooserQuerySource pdbquery = new PDBStructureChooserQuerySource(); |
412 |
|
|
413 |
5 |
FTSRestResponse upResponse = null; |
414 |
5 |
List<FTSRestResponse> pdbResponse = null; |
415 |
|
|
416 |
|
|
417 |
|
|
418 |
|
|
419 |
|
|
420 |
5 |
List<FilterOption> opts = tdbquery |
421 |
|
.getAvailableFilterOptions(StructureChooser.VIEWS_FILTER); |
422 |
5 |
FilterOption opt_singlebest = opts.get(0); |
423 |
5 |
FilterOption opt_manybest = opts.get(1); |
424 |
5 |
assertEquals(opt_singlebest.getValue(), |
425 |
|
ThreeDBStructureChooserQuerySource.FILTER_FIRST_BEST_COVERAGE); |
426 |
5 |
assertEquals(opt_manybest.getValue(), |
427 |
|
ThreeDBStructureChooserQuerySource.FILTER_TDBEACONS_COVERAGE); |
428 |
|
|
429 |
5 |
try |
430 |
|
{ |
431 |
5 |
upResponse = tdbquery.fetchStructuresMetaData(testUpSeq, |
432 |
|
tdbquery.getDocFieldPrefs().getStructureSummaryFields(), |
433 |
|
opt_singlebest, false); |
434 |
5 |
tdbquery.updateAvailableFilterOptions(StructureChooser.VIEWS_FILTER, |
435 |
|
opts, upResponse.getSearchSummary()); |
436 |
|
|
437 |
5 |
FTSRestResponse firstRanked = tdbquery.selectFirstRankedQuery( |
438 |
|
testUpSeq, upResponse.getSearchSummary(), |
439 |
|
tdbquery.getDocFieldPrefs().getStructureSummaryFields(), |
440 |
|
opt_singlebest.getValue(), false); |
441 |
5 |
assertEquals(firstRanked.getNumberOfItemsFound(), 1); |
442 |
|
|
443 |
5 |
upResponse = tdbquery.fetchStructuresMetaData(testUpSeq, |
444 |
|
tdbquery.getDocFieldPrefs().getStructureSummaryFields(), |
445 |
|
opt_manybest, false); |
446 |
5 |
assertTrue(firstRanked.getSearchSummary().size() < upResponse |
447 |
|
.getSearchSummary().size()); |
448 |
|
|
449 |
5 |
List<String> pdb_Queries = tdbquery.buildPDBFTSQueryFor(upResponse); |
450 |
5 |
assertTrue(pdb_Queries.size() > 0); |
451 |
5 |
for (String pdb_Query : pdb_Queries) |
452 |
|
{ |
453 |
10 |
assertTrue(pdb_Query.trim().length() > 0); |
454 |
|
} |
455 |
|
|
456 |
5 |
pdbResponse = tdbquery.fetchStructuresMetaDataFor(pdbquery, |
457 |
|
upResponse); |
458 |
|
|
459 |
5 |
assertEquals(pdbResponse.size(), pdb_Queries.size()); |
460 |
5 |
for (FTSRestResponse pdbr : pdbResponse) |
461 |
|
{ |
462 |
10 |
assertTrue(pdbr.getNumberOfItemsFound() > 0); |
463 |
|
} |
464 |
|
|
465 |
|
|
466 |
5 |
FTSRestResponse joinedResp = tdbquery.joinResponses(upResponse, |
467 |
|
pdbResponse); |
468 |
5 |
assertEquals(upResponse.getNumberOfItemsFound(), |
469 |
|
joinedResp.getNumberOfItemsFound()); |
470 |
|
|
471 |
|
|
472 |
5 |
if (testUpSeq.getDisplayId(true) |
473 |
|
.equals(upSeq_epas1_human.getDisplayId(true))) |
474 |
|
{ |
475 |
|
|
476 |
1 |
TDBResultAnalyser tDBResultAnalyz = new TDBResultAnalyser(testUpSeq, |
477 |
|
joinedResp.getSearchSummary(), tdbquery.lastTdbRequest, |
478 |
|
ThreeDBStructureChooserQuerySource.FILTER_FIRST_BEST_COVERAGE, |
479 |
|
tdbquery.remove_prefix( |
480 |
|
ThreeDBStructureChooserQuerySource.FILTER_FIRST_BEST_COVERAGE)); |
481 |
1 |
List<FTSData> ordered = tDBResultAnalyz.getFilteredResponse(); |
482 |
1 |
List<FTSData> selected = tDBResultAnalyz.selectStructures(ordered); |
483 |
1 |
assertEquals(((TDB_FTSData) selected.get(0)).getProvider(), |
484 |
|
"AlphaFold DB"); |
485 |
|
|
486 |
|
|
487 |
|
|
488 |
|
|
489 |
|
|
490 |
|
|
491 |
|
|
492 |
|
|
493 |
|
|
494 |
|
} |
495 |
|
|
496 |
|
} catch ( |
497 |
|
|
498 |
|
Exception x) |
499 |
|
{ |
500 |
0 |
x.printStackTrace(); |
501 |
0 |
Assert.fail("Unexpected Exception"); |
502 |
|
} |
503 |
|
|
504 |
5 |
StructureChooserQuerySource scquery = StructureChooserQuerySource |
505 |
|
.getQuerySourceFor(new SequenceI[] |
506 |
|
{ testUpSeq }); |
507 |
|
|
508 |
|
} |
509 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
1PASS
|
|
510 |
1 |
@DataProvider(name = "testUpSeqs")... |
511 |
|
public Object[][] testUpSeqs() throws Exception |
512 |
|
{ |
513 |
1 |
setUp(); |
514 |
1 |
return new Object[][] { { upSeq }, { upSeq_insulin }, { upSeq_r1ab }, |
515 |
|
{ upSeq_fer1_maize }, |
516 |
|
{ upSeq_epas1_human } }; |
517 |
|
} |
518 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (8) |
Complexity: 1 |
Complexity Density: 0.12 |
1PASS
|
|
519 |
1 |
@Test(groups = { "Functional" })... |
520 |
|
public void sanitizeSeqNameTest() |
521 |
|
{ |
522 |
1 |
String name = "ab_cdEF|fwxyz012349"; |
523 |
1 |
AssertJUnit.assertEquals(name, |
524 |
|
PDBStructureChooserQuerySource.sanitizeSeqName(name)); |
525 |
|
|
526 |
|
|
527 |
1 |
name = "abcde12[345]fg"; |
528 |
1 |
AssertJUnit.assertEquals("abcde12fg", |
529 |
|
PDBStructureChooserQuerySource.sanitizeSeqName(name)); |
530 |
|
|
531 |
|
|
532 |
1 |
name = "ab[cd],.\t£$*!- \\\"@:e"; |
533 |
1 |
AssertJUnit.assertEquals("abcde", |
534 |
|
PDBStructureChooserQuerySource.sanitizeSeqName(name)); |
535 |
|
|
536 |
1 |
name = "abcde12[345a]fg"; |
537 |
1 |
AssertJUnit.assertEquals("abcde12345afg", |
538 |
|
PDBStructureChooserQuerySource.sanitizeSeqName(name)); |
539 |
|
} |
540 |
|
} |