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 aligned DNA codon translation bug(s) and generate AlignedCodonFrame mappings...
[jalview.git]
/
src
/
jalview
/
appletgui
/
AppletJmol.java
diff --git
a/src/jalview/appletgui/AppletJmol.java
b/src/jalview/appletgui/AppletJmol.java
index
b7e67c1
..
f64014b
100644
(file)
--- a/
src/jalview/appletgui/AppletJmol.java
+++ b/
src/jalview/appletgui/AppletJmol.java
@@
-67,6
+67,7
@@
public class AppletJmol extends Frame
TextField inputLine;
TextArea history;
SequenceI[] sequence;
TextField inputLine;
TextArea history;
SequenceI[] sequence;
+ String [] chains;
StructureSelectionManager ssm;
RenderPanel renderPanel;
AlignmentPanel ap;
StructureSelectionManager ssm;
RenderPanel renderPanel;
AlignmentPanel ap;
@@
-78,11
+79,13
@@
public class AppletJmol extends Frame
public AppletJmol(PDBEntry pdbentry,
SequenceI[] seq,
public AppletJmol(PDBEntry pdbentry,
SequenceI[] seq,
+ String[] chains,
AlignmentPanel ap,
String protocol)
{
this.ap = ap;
this.sequence = seq;
AlignmentPanel ap,
String protocol)
{
this.ap = ap;
this.sequence = seq;
+ this.chains = chains;
this.pdbentry = pdbentry;
String alreadyMapped = StructureSelectionManager
this.pdbentry = pdbentry;
String alreadyMapped = StructureSelectionManager
@@
-92,7
+95,7
@@
public class AppletJmol extends Frame
if (alreadyMapped != null)
{
StructureSelectionManager.getStructureSelectionManager()
if (alreadyMapped != null)
{
StructureSelectionManager.getStructureSelectionManager()
- .setMapping(seq, pdbentry.getFile(), protocol);
+ .setMapping(seq, chains, pdbentry.getFile(), protocol);
//PROMPT USER HERE TO ADD TO NEW OR EXISTING VIEW?
//FOR NOW, LETS JUST OPEN A NEW WINDOW
}
//PROMPT USER HERE TO ADD TO NEW OR EXISTING VIEW?
//FOR NOW, LETS JUST OPEN A NEW WINDOW
}
@@
-166,9
+169,7
@@
public class AppletJmol extends Frame
viewer.openFile(pdbentry.getFile());
}
viewer.openFile(pdbentry.getFile());
}
- this.setBounds(400, 400, 400, 400);
-
- this.setVisible(true);
+ jalview.bin.JalviewLite.addFrame(this, "Jmol", 400,400);
}
public void loadInline(String string)
}
public void loadInline(String string)
@@
-353,6
+354,7
@@
public class AppletJmol extends Frame
{
if (evt.getSource() == seqColour)
{
{
if (evt.getSource() == seqColour)
{
+ lastCommand = null;
colourBySequence = seqColour.getState();
colourBySequence(ap);
}
colourBySequence = seqColour.getState();
colourBySequence(ap);
}
@@
-440,14
+442,11
@@
public class AppletJmol extends Frame
resetLastRes.append(":" + chain);
}
resetLastRes.append(":" + chain);
}
- eval.append(";color gold;wireframe 100");
+ eval.append(";wireframe 100;"+eval.toString()+".CA;");
- Color col = new Color(viewer.getAtomArgb(atomIndex));
+ resetLastRes.append(";wireframe 0;"+resetLastRes.toString()+".CA;spacefill 0;");
- resetLastRes.append(";color["
- + col.getRed() + ","
- + col.getGreen() + ","
- + col.getBlue() + "];wireframe 0");
+ eval.append("spacefill 200;select none");
viewer.evalStringQuiet(eval.toString());
viewer.evalStringQuiet(eval.toString());
@@
-461,21
+460,32
@@
public class AppletJmol extends Frame
//End StructureListener
////////////////////////////
//End StructureListener
////////////////////////////
- FeatureRenderer fr;
- public void colourBySequence(AlignmentPanel ap)
+ public Color getColour(int atomIndex, int pdbResNum, String chain, String pdbfile)
{
{
- if(!colourBySequence)
- return;
+ if (!pdbfile.equals(pdbentry.getFile()))
+ return null;
+
+ return new Color(viewer.getAtomArgb(atomIndex));
+ }
+
+ String lastCommand;
+ FeatureRenderer fr=null;
+ public void colourBySequence(AlignmentPanel sourceap)
+ {
+ this.ap = sourceap;
+ if (!colourBySequence)
+ return;
StructureMapping[] mapping = ssm.getMapping(pdbentry.getFile());
if (mapping.length < 1)
return;
StructureMapping[] mapping = ssm.getMapping(pdbentry.getFile());
if (mapping.length < 1)
return;
- SequenceRenderer sr = ap.seqPanel.seqCanvas.getSequenceRenderer();
+ SequenceRenderer sr = new SequenceRenderer(ap.av);
boolean showFeatures = false;
boolean showFeatures = false;
+
if (ap.av.showSequenceFeatures)
{
showFeatures = true;
if (ap.av.showSequenceFeatures)
{
showFeatures = true;
@@
-494,14
+504,15
@@
public class AppletJmol extends Frame
{
for (int m = 0; m < mapping.length; m++)
{
{
for (int m = 0; m < mapping.length; m++)
{
- if (mapping[m].getSequence() == sequence[s])
+ if (mapping[m].getSequence() == sequence[s]
+ && ap.av.alignment.findIndex(sequence[s]) > -1)
{
for (int r = 0; r < sequence[s].getLength(); r++)
{
int pos = mapping[m].getPDBResNum(
sequence[s].findPosition(r));
{
for (int r = 0; r < sequence[s].getLength(); r++)
{
int pos = mapping[m].getPDBResNum(
sequence[s].findPosition(r));
- if (pos < 1 || pos==lastPos)
+ if (pos < 1 || pos == lastPos)
continue;
lastPos = pos;
continue;
lastPos = pos;
@@
-511,7
+522,7
@@
public class AppletJmol extends Frame
if (showFeatures)
col = fr.findFeatureColour(col, sequence[s], r);
if (showFeatures)
col = fr.findFeatureColour(col, sequence[s], r);
- if (command.toString().endsWith(":" + mapping[m].getChain()+
+ if (command.toString().endsWith(":" + mapping[m].getChain() +
";color["
+ col.getRed() + ","
+ col.getGreen() + ","
";color["
+ col.getRed() + ","
+ col.getGreen() + ","
@@
-529,19
+540,23
@@
public class AppletJmol extends Frame
}
command.append(";color["
}
command.append(";color["
- + col.getRed() + ","
- + col.getGreen() + ","
- + col.getBlue() + "]");
-
+ + col.getRed() + ","
+ + col.getGreen() + ","
+ + col.getBlue() + "]");
}
break;
}
}
}
}
break;
}
}
}
- viewer.evalStringQuiet(command.toString());
+ if (lastCommand == null || !lastCommand.equals(command.toString()))
+ {
+ viewer.evalStringQuiet(command.toString());
+ }
+ lastCommand = command.toString();
}
}
+
StringBuffer condenseCommand(String command, int pos)
{
StringBuffer condenseCommand(String command, int pos)
{
@@
-607,14
+622,14
@@
public class AppletJmol extends Frame
MCview.PDBfile pdb;
if (loadedInline)
{
MCview.PDBfile pdb;
if (loadedInline)
{
- pdb = ssm.setMapping(sequence,
+ pdb = ssm.setMapping(sequence,chains,
pdbentry.getFile(),
AppletFormatAdapter.PASTE);
pdbentry.setFile("INLINE"+pdb.id);
}
else
{
pdbentry.getFile(),
AppletFormatAdapter.PASTE);
pdbentry.setFile("INLINE"+pdb.id);
}
else
{
- pdb = ssm.setMapping(sequence,
+ pdb = ssm.setMapping(sequence,chains,
pdbentry.getFile(),
AppletFormatAdapter.URL);
}
pdbentry.getFile(),
AppletFormatAdapter.URL);
}
@@
-713,7
+728,7
@@
public class AppletJmol extends Frame
picked+=strInfo.substring(strInfo.indexOf(":")+1,
strInfo.indexOf("."));
picked+=strInfo.substring(strInfo.indexOf(":")+1,
strInfo.indexOf("."));
- picked+=".C";
+ picked+=".CA";
if (!atomsPicked.contains(picked))
{
if (!atomsPicked.contains(picked))
{