git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix for unicode char labels causing arrayOutOfBoundsException bug spotted by cameron...
[jalview.git]
/
src
/
jalview
/
gui
/
AppJmol.java
diff --git
a/src/jalview/gui/AppJmol.java
b/src/jalview/gui/AppJmol.java
index
c082463
..
f340457
100644
(file)
--- a/
src/jalview/gui/AppJmol.java
+++ b/
src/jalview/gui/AppJmol.java
@@
-33,6
+33,7
@@
import jalview.structure.*;
import jalview.datamodel.PDBEntry;
import jalview.io.*;
import jalview.schemes.*;
import jalview.datamodel.PDBEntry;
import jalview.io.*;
import jalview.schemes.*;
+import jalview.ws.ebi.EBIFetchClient;
import org.jmol.api.*;
import org.jmol.adapter.smarter.SmarterJmolAdapter;
import org.jmol.api.*;
import org.jmol.adapter.smarter.SmarterJmolAdapter;
@@
-648,27
+649,33
@@
public synchronized void addSequence(SequenceI [] seq)
StringBuffer command = new StringBuffer();
int lastPos = -1;
StringBuffer command = new StringBuffer();
int lastPos = -1;
- for (int s = 0; s < sequence.length; s++)
+ for (int sp,s = 0; s < sequence.length; s++)
{
for (int m = 0; m < mapping.length; m++)
{
if (mapping[m].getSequence() == sequence[s]
{
for (int m = 0; m < mapping.length; m++)
{
if (mapping[m].getSequence() == sequence[s]
- && ap.av.alignment.findIndex(sequence[s])>-1)
+ && (sp=ap.av.alignment.findIndex(sequence[s]))>-1)
{
{
- for (int r = 0; r < sequence[s].getLength(); r++)
+ SequenceI asp = ap.av.alignment.getSequenceAt(sp);
+ for (int r = 0; r < asp.getLength(); r++)
{
{
+ // No mapping to gaps in sequence.
+ if (jalview.util.Comparison.isGap(asp.getCharAt(r)))
+ {
+ continue;
+ }
int pos = mapping[m].getPDBResNum(
int pos = mapping[m].getPDBResNum(
- sequence[s].findPosition(r));
+ asp.findPosition(r));
if (pos < 1 || pos==lastPos)
continue;
lastPos = pos;
if (pos < 1 || pos==lastPos)
continue;
lastPos = pos;
- Color col = sr.getResidueBoxColour(sequence[s], r);
+ Color col = sr.getResidueBoxColour(asp, r);
if (showFeatures)
if (showFeatures)
- col = fr.findFeatureColour(col, sequence[s], r);
+ col = fr.findFeatureColour(col, asp, r);
if (command.toString().endsWith(":" + mapping[m].getChain()+
";color["
if (command.toString().endsWith(":" + mapping[m].getChain()+
";color["