pdbRequest.setFieldToSearchBy("(text:");
pdbRequest.setWantedFields(wantedFields);
pdbRequest.setSearchTerm(buildQuery(seq) + ")");
- pdbRequest.setAssociatedSequence(seq.getName());
+ pdbRequest.setAssociatedSequence(seq);
pdbRestCleint = new PDBRestClient();
PDBRestResponse resultList;
try
resultList = pdbRestCleint.executeRequest(pdbRequest);
} catch (Exception e)
{
+ e.printStackTrace();
errors.add(e.getMessage());
continue;
}
*/
public static boolean isValidSeqName(String seqName)
{
- System.out.println("seqName : " + seqName);
+ // System.out.println("seqName : " + seqName);
String ignoreList = "pdb,uniprot,swiss-prot";
if (seqName.length() < 3)
{
!chk_invertFilter.isSelected());
pdbRequest.setSearchTerm(buildQuery(seq) + ")");
pdbRequest.setWantedFields(wantedFields);
- pdbRequest.setAssociatedSequence(seq.getName());
+ pdbRequest.setAssociatedSequence(seq);
pdbRestCleint = new PDBRestClient();
PDBRestResponse resultList;
try
resultList = pdbRestCleint.executeRequest(pdbRequest);
} catch (Exception e)
{
+ e.printStackTrace();
errors.add(e.getMessage());
continue;
}
String currentView = selectedFilterOpt.getView();
if (currentView == VIEWS_FILTER)
{
- int pdbIdCol = PDBRestClient.getPDBIdColumIndex(
- lastPdbRequest.getWantedFields(), true);
+ int pdbIdColIndex = tbl_summary.getColumn(
+ PDBRestClient.PDBDocField.PDB_ID.getName()).getModelIndex();
+ int refSeqColIndex = tbl_summary.getColumn("Ref Sequence")
+ .getModelIndex();
int[] selectedRows = tbl_summary.getSelectedRows();
PDBEntry[] pdbEntriesToView = new PDBEntry[selectedRows.length];
int count = 0;
+ ArrayList<SequenceI> selectedSeqsToView = new ArrayList<SequenceI>();
for (int summaryRow : selectedRows)
{
- String pdbIdStr = tbl_summary.getValueAt(summaryRow, pdbIdCol)
+ String pdbIdStr = tbl_summary.getValueAt(summaryRow, pdbIdColIndex)
.toString();
-
+ SequenceI selectedSeq = (SequenceI) tbl_summary.getValueAt(
+ summaryRow, refSeqColIndex);
+ selectedSeqsToView.add(selectedSeq);
PDBEntry pdbEntry = cachedEntryMap.get(pdbIdStr.toLowerCase());
if (pdbEntry == null)
{
}
pdbEntriesToView[count++] = pdbEntry;
}
+ SequenceI[] selectedSeqs = selectedSeqsToView
+ .toArray(new SequenceI[selectedSeqsToView.size()]);
launchStructureViewer(ap.getStructureSelectionManager(),
- pdbEntriesToView, ap, selectedSequences);
+ pdbEntriesToView, ap, selectedSeqs);
}
else if(currentView == VIEWS_LOCAL_PDB){
int[] selectedRows = tbl_local_pdb.getSelectedRows();
pdbRequest.setFieldToSearchBy("(pdb_id:");
pdbRequest.setWantedFields(wantedFields);
pdbRequest.setSearchTerm(txt_search.getText() + ")");
- pdbRequest.setAssociatedSequence(selectedSequence.getName());
+ pdbRequest.setAssociatedSequence(selectedSequence);
pdbRestCleint = new PDBRestClient();
PDBRestResponse resultList;
try
package jalview.ws.uimodel;
+import jalview.datamodel.SequenceI;
import jalview.ws.dbsources.PDBRestClient.PDBDocField;
import java.util.Collection;
private String fieldToSortBy;
- private String associatedSequence;
+ private SequenceI associatedSequence;
private boolean allowEmptySequence;
return isSortAscending;
}
- public String getAssociatedSequence()
+ public SequenceI getAssociatedSequence()
{
return associatedSequence;
}
- public void setAssociatedSequence(String associatedSequence)
+ public void setAssociatedSequence(SequenceI associatedSequence)
{
this.associatedSequence = associatedSequence;
}
package jalview.ws.uimodel;
+import jalview.datamodel.SequenceI;
import jalview.ws.dbsources.PDBRestClient.PDBDocField;
import java.util.Collection;
};
if (request.getAssociatedSequence() != null)
{
- tableModel.addColumn("Sequence"); // Create sequence column header if
+ tableModel.addColumn("Ref Sequence"); // Create sequence column header if
// exists in the request
}
for (PDBDocField field : request.getWantedFields())
{
private String pdbId;
- private String[] summaryRowData;
+ private Object[] summaryRowData;
- private String associatedSequence;
+ private SequenceI associatedSequence;
public PDBResponseSummary(JSONObject pdbJsonDoc, PDBRestRequest request)
{
Collection<PDBDocField> diplayFields = request.getWantedFields();
- String associatedSeq = request.getAssociatedSequence();
+ SequenceI associatedSeq = request.getAssociatedSequence();
int colCounter = 0;
- summaryRowData = new String[(associatedSeq != null) ? diplayFields
+ summaryRowData = new Object[(associatedSeq != null) ? diplayFields
.size() + 1 : diplayFields.size()];
if (associatedSeq != null)
{
this.pdbId = pdbId;
}
- public String[] getSummaryData()
+ public Object[] getSummaryData()
{
return summaryRowData;
}
public String toString()
{
StringBuilder summaryFieldValues = new StringBuilder();
- for (String summaryField : summaryRowData)
+ for (Object summaryField : summaryRowData)
{
- summaryFieldValues.append(summaryField).append("\t");
+ summaryFieldValues.append(summaryField.toString()).append("\t");
}
return summaryFieldValues.toString();
}