import static org.testng.Assert.assertTrue;
import java.util.Collection;
+import java.util.List;
import java.util.Vector;
import org.junit.Assert;
// 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<FilterOption> 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()<upResponse.getNumberOfItemsFound());
// NB Could have race condition here
String pdb_Query = tdbquery.buildPDBFTSQueryFor(upResponse);