private static final String MODELPAGE = "PROVIDERPAGE";
+ private static final String TEMPFAC_TYPE = "TFTYPE";
+
+ private static final String TEMPFAC_TYPE_VERSION = "TFTYPE_V";
+
/**
* Permanent URI for retrieving the original structure data
*
{
return sf != null && sf.inFile != null && sf.inFile.exists();
}
+
+ public void setTempFacType(String strucTfType)
+ {
+ setProperty(TEMPFAC_TYPE,strucTfType);
+ }
+ public void setTempFacTypeVersion(String strucTfTypeVersion)
+ {
+ setProperty(TEMPFAC_TYPE_VERSION,strucTfTypeVersion);
+ }
+ public String getTempFacType()
+ {
+ return (String) getProperty(TEMPFAC_TYPE);
+ }
+ public String getTempFacTypeVersion()
+ {
+ return (String) getProperty(TEMPFAC_TYPE_VERSION);
+ }
+ public boolean hasTempFacType()
+ {
+ return _hasProperty(TEMPFAC_TYPE);
+ }
+ public boolean hasTempFacTypeVersion()
+ {
+ return _hasProperty(TEMPFAC_TYPE_VERSION);
+ }
}
@Override
public void run()
{
- FilterOption selectedFilterOpt = ((FilterOption) cmb_filterOption
- .getSelectedItem());
+ FilterOption selectedFilterOpt = getSelectedFilterOption();
String currentView = selectedFilterOpt.getView();
JTable restable = (currentView == VIEWS_FILTER) ? getResultTable()
: tbl_local_pdb;
if (currentView == VIEWS_FILTER)
{
- int[] selectedRows = restable.getSelectedRows();
- PDBEntry[] pdbEntriesToView = new PDBEntry[selectedRows.length];
- List<SequenceI> selectedSeqsToView = new ArrayList<>();
- pdbEntriesToView = data.collectSelectedRows(restable,
- selectedRows, selectedSeqsToView);
- SequenceI[] selectedSeqs = selectedSeqsToView
- .toArray(new SequenceI[selectedSeqsToView.size()]);
+ Object[] seqsAndPdb = collectSelectedSeqsAndPDBEntries();
+ SequenceI[] selectedSeqs=(SequenceI[]) seqsAndPdb[0];
+ PDBEntry[] pdbEntriesToView = (PDBEntry[])seqsAndPdb[1];
sViewer = launchStructureViewer(ssm, pdbEntriesToView, ap,
selectedSeqs);
}
}
/**
+ * collect selected structures from FTS search (PDB and TDB queries)
+ * @return Object[] { SequenceI[], PDBEntry[] } or null
+ */
+ protected Object[] collectSelectedSeqsAndPDBEntries()
+ {
+ if (getSelectedFilterOption()==null || getSelectedFilterOption().getView() != VIEWS_FILTER)
+ {
+ return null;
+ }
+ JTable restable = getResultTable();
+ int[] selectedRows = restable.getSelectedRows();
+ PDBEntry[] pdbEntriesToView = new PDBEntry[selectedRows.length];
+ List<SequenceI> selectedSeqsToView = new ArrayList<>();
+ pdbEntriesToView = data.collectSelectedRows(restable,
+ selectedRows, selectedSeqsToView);
+
+ SequenceI[] selectedSeqs = selectedSeqsToView
+ .toArray(new SequenceI[selectedSeqsToView.size()]);
+ return new Object[] { selectedSeqs,pdbEntriesToView};
+ }
+
+ private FilterOption getSelectedFilterOption()
+ {
+ return ((FilterOption) cmb_filterOption
+ .getSelectedItem());
+ }
+
+ /**
* Answers a structure viewer (new or existing) configured to superimpose
* added structures or not according to the user's choice
*
int typeColumnIndex = restable.getColumn("Provider").getModelIndex();
int humanUrl = restable.getColumn("Page URL").getModelIndex();
int modelformat = restable.getColumn("Model Format").getModelIndex();
+ int tftype = restable.getColumn("Confidence Score Type").getModelIndex();
+ int tftypev = restable.getColumn("Confidence Score Version").getModelIndex();
+
final int up_start_idx = restable.getColumn("Uniprot Start")
.getModelIndex();
final int up_end_idx = restable.getColumn("Uniprot End")
String modelPage = humanUrl < 1 ? null
: (String) restable.getValueAt(row, humanUrl);
String strucFormat = restable.getValueAt(row, modelformat).toString();
-
+ String strucTfType = tftype<1 ? null : restable.getValueAt(row, tftype)==null ? null : restable.getValueAt(row, tftype).toString();
+ String strucTfType_v = tftypev<1 ? null : restable.getValueAt(row, tftypev)==null ? null : restable.getValueAt(row, tftypev).toString();
SequenceI selectedSeq = (SequenceI) restable.getValueAt(row,
refSeqColIndex);
selectedSeqsToView.add(selectedSeq);
{
pdbEntry.setProviderPage(modelPage);
}
+ try
+ {
+ if (strucTfType!=null && "".equals(strucTfType)) {
+ pdbEntry.setTempFacType(strucTfType);
+ }
+ if (strucTfType_v!=null && "".equals(strucTfType_v)) {
+ pdbEntry.setTempFacTypeVersion(strucTfType_v);
+ }
+ } catch (Exception q)
+ {
+ Console.warn("Unknown filetype for 3D Beacons Model from: "
+ + strucFormat + " - " + pdbIdStr + " - " + modelPage);
+ }
+
selectedSeq.getDatasetSequence().addPDBId(pdbEntry);
}
pdbEntriesToView[count++] = pdbEntry;
"discoveredStructuresSet");
assertNotNull(ss);
assertTrue(ss.size() > 0);
+
+ sc.promptForTDBFetch(true);
+
+ // check collation
+ Object[] sqandpdb = sc.collectSelectedSeqsAndPDBEntries();
+ assertNotNull(sqandpdb);
+ SequenceI[] selsq = (SequenceI[]) sqandpdb[0];
+ PDBEntry[] selpdb = (PDBEntry[]) sqandpdb[1];
+ assertNotNull(selsq);
+ assertNotNull(selpdb);
+ assertEquals(1, selsq.length);
+ assertEquals(1, selpdb.length);
+
+
}
private void ThreadwaitFor(int i, StructureChooser sc)