continue;
}
- int lastPos = -1;
for (int s = 0; s < sequence[pdbfnum].length; s++)
{
for (int sp, m = 0; m < mapping.length; m++)
if (mapping[m].getSequence() == sequence[pdbfnum][s]
&& (sp = al.findIndex(sequence[pdbfnum][s])) > -1)
{
+ int lastPos = StructureMapping.UNASSIGNED_VALUE;
SequenceI asp = al.getSequenceAt(sp);
for (int r = 0; r < asp.getLength(); r++)
{
}
int pos = mapping[m].getPDBResNum(asp.findPosition(r));
- if (pos < 1 || pos == lastPos)
+ if (pos == lastPos)
{
continue;
}
+ if (pos == StructureMapping.UNASSIGNED_VALUE)
+ {
+ // terminate current colour op
+ if (command.length() > 0
+ && command.charAt(command.length() - 1) != ';')
+ {
+ command.append(";");
+ }
+ // reset lastPos
+ lastPos = StructureMapping.UNASSIGNED_VALUE;
+ continue;
+ }
lastPos = pos;
// TODO: deal with case when buffer is too large for Jmol to parse
// - execute command and flush
- command.append(";");
+ if (command.length() > 0
+ && command.charAt(command.length() - 1) == ';')
+ {
+ command.append(";");
+ }
+
if (command.length() > 51200)
{
// add another chunk