package jalview.gui;
+import jalview.datamodel.DBRefEntry;
+import jalview.datamodel.PDBEntry;
+import jalview.datamodel.SequenceI;
+import jalview.jbgui.GStructureChooser;
+import jalview.jbgui.PDBDocFieldPreferences;
+import jalview.structure.StructureSelectionManager;
+import jalview.util.MessageManager;
+import jalview.ws.dbsources.PDBRestClient;
+import jalview.ws.dbsources.PDBRestClient.PDBDocField;
+import jalview.ws.uimodel.PDBRestRequest;
+import jalview.ws.uimodel.PDBRestResponse;
+import jalview.ws.uimodel.PDBRestResponse.PDBResponseSummary;
+
import java.awt.event.ItemEvent;
import java.util.ArrayList;
import java.util.Collection;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
-import jalview.datamodel.DBRefEntry;
-import jalview.datamodel.PDBEntry;
-import jalview.datamodel.SequenceI;
-import jalview.jbgui.GStructureChooser;
-import jalview.jbgui.PDBDocFieldPreferences;
-import jalview.structure.StructureSelectionManager;
-import jalview.util.MessageManager;
-import jalview.ws.dbsources.PDBRestClient;
-import jalview.ws.dbsources.PDBRestClient.PDBDocField;
-import jalview.ws.uimodel.PDBRestRequest;
-import jalview.ws.uimodel.PDBRestResponse;
-import jalview.ws.uimodel.PDBRestResponse.PDBResponseSummary;
-
/**
* Provides the behaviors for the Structure chooser Panel
if (errors.size() > 0)
{
StringBuilder errorMsg = new StringBuilder();
- // "Operation was unsucessful due to the following: \n");
+ // "Operation was unsuccessful due to the following: \n");
for (String error : errors)
{
errorMsg.append(error).append("\n");
{
for (PDBEntry entry : seq.getPDBId())
{
- seqRefs.add(entry.getId());
+ if (isValidSeqName(entry.getId()))
+ {
+ seqRefs.add(entry.getId());
+ }
}
}
int count = 0;
for (DBRefEntry dbRef : seq.getDBRef())
{
- seqRefs.add(getDBRefId(dbRef));
+ if (isValidSeqName(getDBRefId(dbRef)))
+ {
+ seqRefs.add(getDBRefId(dbRef));
+ }
+ // seqRefs.add(getDBRefId(dbRef));
++count;
if (count > 10)
{
*/
public static boolean isValidSeqName(String seqName)
{
- String ignoreList = "pdb,uniprot";
+ System.out.println("seqName : " + seqName);
+ String ignoreList = "pdb,uniprot,swiss-prot";
if (seqName.length() < 3)
{
return false;
}
+ if (seqName.contains(":"))
+ {
+ return false;
+ }
+ seqName = seqName.toLowerCase();
for (String ignoredEntry : ignoreList.split(","))
{
- if (seqName.equalsIgnoreCase(ignoredEntry))
+ if (seqName.contains(ignoredEntry))
{
return false;
}