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
Replaced image
[jalview.git]
/
src
/
jalview
/
appletgui
/
RedundancyPanel.java
diff --git
a/src/jalview/appletgui/RedundancyPanel.java
b/src/jalview/appletgui/RedundancyPanel.java
index
c71fe29
..
efabb9b
100755
(executable)
--- a/
src/jalview/appletgui/RedundancyPanel.java
+++ b/
src/jalview/appletgui/RedundancyPanel.java
@@
-33,16
+33,16
@@
public class RedundancyPanel extends SliderPanel implements Runnable, WindowList
AlignmentPanel ap;
\r
\r
Stack historyList = new Stack(); // simpler than synching with alignFrame.
\r
AlignmentPanel ap;
\r
\r
Stack historyList = new Stack(); // simpler than synching with alignFrame.
\r
- Vector originalSequences;
\r
- Hashtable originalColours;
\r
- SequenceI[] oldAlignment;
\r
float [] redundancy;
\r
float [] redundancy;
\r
+ SequenceI [] originalSequences;
\r
Frame frame;
\r
Frame frame;
\r
+ Vector redundantSeqs;
\r
\r
public RedundancyPanel(AlignmentPanel ap)
\r
{
\r
super(ap, 0, false, null);
\r
\r
\r
public RedundancyPanel(AlignmentPanel ap)
\r
{
\r
super(ap, 0, false, null);
\r
\r
+ redundantSeqs = new Vector();
\r
this.ap = ap;
\r
undoButton.setVisible(true);
\r
applyButton.setVisible(true);
\r
this.ap = ap;
\r
undoButton.setVisible(true);
\r
applyButton.setVisible(true);
\r
@@
-52,7
+52,7
@@
public class RedundancyPanel extends SliderPanel implements Runnable, WindowList
valueField.setText("100");
\r
\r
slider.setVisibleAmount(1);
\r
valueField.setText("100");
\r
\r
slider.setVisibleAmount(1);
\r
- slider.setMinimum(40);
\r
+ slider.setMinimum(0);
\r
slider.setMaximum(100+slider.getVisibleAmount());
\r
slider.setValue(100);
\r
\r
slider.setMaximum(100+slider.getVisibleAmount());
\r
slider.setValue(100);
\r
\r
@@
-95,65
+95,65
@@
public class RedundancyPanel extends SliderPanel implements Runnable, WindowList
\r
validate();
\r
\r
\r
validate();
\r
\r
- Vector sel = new Vector();
\r
+ String[] omitHidden = null;
\r
+
\r
SequenceGroup sg = ap.av.getSelectionGroup();
\r
int height;
\r
SequenceGroup sg = ap.av.getSelectionGroup();
\r
int height;
\r
- originalSequences = new Vector();
\r
- originalColours = new Hashtable();
\r
+
\r
+ int start, end;
\r
\r
if ( (sg != null) && (sg.getSize(false) >= 1))
\r
{
\r
\r
if ( (sg != null) && (sg.getSize(false) >= 1))
\r
{
\r
- height = sg.getSize(false);
\r
- for (int i = 0; i < sg.getSize(false); i++)
\r
- {
\r
- sel.addElement(sg.getSequenceAt(i));
\r
- }
\r
+ originalSequences = sg.getSequencesInOrder(ap.av.alignment);
\r
+ start = sg.getStartRes();
\r
+ end = sg.getEndRes();
\r
}
\r
else
\r
{
\r
}
\r
else
\r
{
\r
- height = ap.av.alignment.getHeight();
\r
- for (int i = 0; i < ap.av.alignment.getHeight(); i++)
\r
- {
\r
- sel.addElement(ap.av.alignment.getSequenceAt(i));
\r
- }
\r
+ originalSequences = ap.av.alignment.getSequencesArray();
\r
+ start = 0;
\r
+ end = ap.av.alignment.getWidth();
\r
}
\r
\r
}
\r
\r
+ height = originalSequences.length;
\r
+
\r
redundancy = new float[height];
\r
for (int i = 0; i < height; i++)
\r
{
\r
redundancy[i] = 0f;
\r
}
\r
\r
redundancy = new float[height];
\r
for (int i = 0; i < height; i++)
\r
{
\r
redundancy[i] = 0f;
\r
}
\r
\r
+ // if (ap.av.hasHiddenColumns)
\r
+ {
\r
+ // omitHidden = ap.av.getSelectionAsString();
\r
+ }
\r
+
\r
\r
// long start = System.currentTimeMillis();
\r
\r
float pid;
\r
\r
// long start = System.currentTimeMillis();
\r
\r
float pid;
\r
- SequenceI seqi, seqj;
\r
- for (int i = 0; i < sel.size(); i++)
\r
+ String seqi, seqj;
\r
+ for (int i = 0; i < height; i++)
\r
{
\r
{
\r
- originalSequences.addElement(sel.elementAt(i));
\r
- originalColours.put(sel.elementAt(i),
\r
- ((SequenceI) sel.elementAt(i)).getColor());
\r
-
\r
for (int j = 0; j < i; j++)
\r
{
\r
if(i==j)
\r
continue;
\r
\r
for (int j = 0; j < i; j++)
\r
{
\r
if(i==j)
\r
continue;
\r
\r
- seqi = (SequenceI) sel.elementAt(i);
\r
- seqj = (SequenceI) sel.elementAt(j);
\r
-
\r
- if (sg != null)
\r
+ if(omitHidden==null)
\r
{
\r
{
\r
- pid = jalview.util.Comparison.PID(seqi,
\r
- seqj,
\r
- sg.getStartRes(), sg.getEndRes());
\r
+ seqi = originalSequences[i].getSequence(start, end);
\r
+ seqj = originalSequences[j].getSequence(start, end);
\r
}
\r
else
\r
}
\r
else
\r
- pid = jalview.util.Comparison.PID( seqi, seqj );
\r
+ {
\r
+ seqi = omitHidden[i];
\r
+ seqj = omitHidden[j];
\r
+ }
\r
\r
\r
+ pid = jalview.util.Comparison.PID( seqi, seqj );
\r
\r
\r
- if(seqj.getLength() < seqi.getLength())
\r
+ if(seqj.length() < seqi.length())
\r
redundancy[j] = Math.max(pid, redundancy[j]);
\r
else
\r
redundancy[i] = Math.max(pid, redundancy[i]);
\r
redundancy[j] = Math.max(pid, redundancy[j]);
\r
else
\r
redundancy[i] = Math.max(pid, redundancy[i]);
\r
@@
-181,11
+181,13
@@
public class RedundancyPanel extends SliderPanel implements Runnable, WindowList
for(int i=0; i<redundancy.length; i++)
\r
{
\r
if (value > redundancy[i])
\r
for(int i=0; i<redundancy.length; i++)
\r
{
\r
if (value > redundancy[i])
\r
- ((SequenceI)originalSequences.elementAt(i)).setColor(java.awt.Color.white);
\r
- else
\r
- ((SequenceI)originalSequences.elementAt(i)).setColor(java.awt.Color.red);
\r
+ redundantSeqs.removeElement(originalSequences[i]);
\r
+ else if(!redundantSeqs.contains(originalSequences[i]))
\r
+ redundantSeqs.addElement(originalSequences[i]);
\r
}
\r
\r
}
\r
\r
+ ap.idPanel.idCanvas.setHighlighted(redundantSeqs);
\r
+
\r
PaintRefresher.Refresh(null,ap.av.alignment);
\r
\r
}
\r
PaintRefresher.Refresh(null,ap.av.alignment);
\r
\r
}
\r
@@
-212,7
+214,7
@@
public class RedundancyPanel extends SliderPanel implements Runnable, WindowList
{
\r
if (value <= redundancy[i])
\r
{
\r
{
\r
if (value <= redundancy[i])
\r
{
\r
- SequenceI seq = (SequenceI) originalSequences.elementAt(i);
\r
+ SequenceI seq = originalSequences[i];
\r
ap.av.alignment.deleteSequence(seq);
\r
del.addElement(seq);
\r
if (sg != null)
\r
ap.av.alignment.deleteSequence(seq);
\r
del.addElement(seq);
\r
if (sg != null)
\r
@@
-270,13
+272,7
@@
public class RedundancyPanel extends SliderPanel implements Runnable, WindowList
\r
public void windowClosing(WindowEvent evt)
\r
{
\r
\r
public void windowClosing(WindowEvent evt)
\r
{
\r
- for(int i=0; i<originalSequences.size(); i++)
\r
- {
\r
- SequenceI seq = (SequenceI)originalSequences.elementAt(i);
\r
- seq.setColor( (java.awt.Color)originalColours.get(seq));
\r
- }
\r
-
\r
- PaintRefresher.Refresh(ap.av.alignment);
\r
+ ap.idPanel.idCanvas.setHighlighted(null);
\r
}
\r
\r
public void windowClosed(WindowEvent evt)
\r
}
\r
\r
public void windowClosed(WindowEvent evt)
\r