From: Jim Procter Date: Mon, 13 Sep 2021 15:02:25 +0000 (+0100) Subject: JAL-3829 minimal test of additional TDB filters - not at all robust X-Git-Tag: Release_2_11_2_0~39^2~1 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=817226e1c7264066e1d435faba8d41f108c5628b;p=jalview.git JAL-3829 minimal test of additional TDB filters - not at all robust --- diff --git a/test/jalview/gui/structurechooser/StructureChooserQuerySourceTest.java b/test/jalview/gui/structurechooser/StructureChooserQuerySourceTest.java index 414e8a7..36d7d0a 100644 --- a/test/jalview/gui/structurechooser/StructureChooserQuerySourceTest.java +++ b/test/jalview/gui/structurechooser/StructureChooserQuerySourceTest.java @@ -25,6 +25,7 @@ import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertTrue; import java.util.Collection; +import java.util.List; import java.util.Vector; import org.junit.Assert; @@ -267,11 +268,20 @@ public class StructureChooserQuerySourceTest // Best Alphafold Model // Best model (by confidence score) // Will also need to develop a more sophisticated filtering system - FilterOption opt = tdbquery.getAvailableFilterOptions(StructureChooser.VIEWS_FILTER).get(0); + List opts = tdbquery.getAvailableFilterOptions(StructureChooser.VIEWS_FILTER); + FilterOption opt_singlebest = opts.get(0); + FilterOption opt_manybest = opts.get(1); + assertEquals(opt_singlebest.getValue(), ThreeDBStructureChooserQuerySource.FILTER_FIRST_BEST_COVERAGE); + assertEquals(opt_manybest.getValue(), ThreeDBStructureChooserQuerySource.FILTER_TDBEACONS_COVERAGE); + try { - upResponse = tdbquery.fetchStructuresMetaData(upSeq, tdbquery.getDocFieldPrefs().getStructureSummaryFields(), opt, false); + upResponse = tdbquery.fetchStructuresMetaData(upSeq, tdbquery.getDocFieldPrefs().getStructureSummaryFields(), opt_singlebest, false); + tdbquery.updateAvailableFilterOptions(StructureChooser.VIEWS_FILTER,opts,upResponse.getSearchSummary()); // test ranking without additional PDBe data - FTSRestResponse firstRanked = tdbquery.selectFirstRankedQuery(upSeq, upResponse.getSearchSummary(), tdbquery.getDocFieldPrefs().getStructureSummaryFields(), opt.getValue(), false); + FTSRestResponse firstRanked = tdbquery.selectFirstRankedQuery(upSeq, upResponse.getSearchSummary(), tdbquery.getDocFieldPrefs().getStructureSummaryFields(), opt_singlebest.getValue(), false); + assertEquals(firstRanked.getNumberOfItemsFound(),1); + // many best response + upResponse = tdbquery.fetchStructuresMetaData(upSeq, tdbquery.getDocFieldPrefs().getStructureSummaryFields(), opt_manybest, false); assertTrue(firstRanked.getNumberOfItemsFound()