/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8)
- * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.1)
+ * Copyright (C) 2014 The Jalview Authors
*
* This file is part of Jalview.
*
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
*/
package jalview.ws.dbsources;
import jalview.datamodel.PDBEntry;
import jalview.datamodel.SequenceI;
+import java.util.ArrayList;
+import java.util.List;
import java.util.Vector;
import MCview.PDBChain;
jalview.io.AppletFormatAdapter.FILE, "PDB");
if (pdbfile != null)
{
+ List<SequenceI> toremove=new ArrayList<SequenceI>();
for (SequenceI pdbcs : pdbfile.getSequences())
{
String chid = null;
}
else
{
- // remove this sequence from the alignment - since it's not from the
- // right chain
- pdbfile.deleteSequence(pdbcs);
+ // mark this sequence to be removed from the alignment
+ // - since it's not from the right chain
+ toremove.add(pdbcs);
}
}
+ // now remove marked sequences
+ for (SequenceI pdbcs:toremove) {
+ pdbfile.deleteSequence(pdbcs);
+ }
}
+
if (pdbfile == null || pdbfile.getHeight() < 1)
{
throw new Exception("No PDB Records for " + id + " chain "
+ ((chain == null) ? "' '" : chain));
}
+
} catch (Exception ex) // Problem parsing PDB file
{
stopQuery();