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
JAL-2629 add ability to select hmmer binaries folder
[jalview.git]
/
src
/
jalview
/
gui
/
AlignFrame.java
diff --git
a/src/jalview/gui/AlignFrame.java
b/src/jalview/gui/AlignFrame.java
index
6dccadc
..
9b5681b
100644
(file)
--- a/
src/jalview/gui/AlignFrame.java
+++ b/
src/jalview/gui/AlignFrame.java
@@
-63,7
+63,8
@@
import jalview.datamodel.SequenceGroup;
import jalview.datamodel.SequenceI;
import jalview.gui.ColourMenuHelper.ColourChangeListener;
import jalview.gui.ViewSelectionMenu.ViewSetProvider;
import jalview.datamodel.SequenceI;
import jalview.gui.ColourMenuHelper.ColourChangeListener;
import jalview.gui.ViewSelectionMenu.ViewSetProvider;
-import jalview.hmmer.HMMERCommands;
+import jalview.hmmer.HMMAlignThread;
+import jalview.hmmer.HMMBuildThread;
import jalview.io.AlignmentProperties;
import jalview.io.AnnotationFile;
import jalview.io.BioJsHTMLOutput;
import jalview.io.AlignmentProperties;
import jalview.io.AnnotationFile;
import jalview.io.BioJsHTMLOutput;
@@
-145,6
+146,7
@@
import javax.swing.JInternalFrame;
import javax.swing.JLayeredPane;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.JLayeredPane;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
+import javax.swing.JOptionPane;
import javax.swing.JScrollPane;
import javax.swing.SwingUtilities;
import javax.swing.JScrollPane;
import javax.swing.SwingUtilities;
@@
-164,6
+166,10
@@
public class AlignFrame extends GAlignFrame implements DropTargetListener,
public static final int DEFAULT_HEIGHT = 500;
public static final int DEFAULT_HEIGHT = 500;
+ boolean autoAlignNewSequences;
+
+ boolean recurring;
+
/*
* The currently displayed panel (selected tabbed view if more than one)
*/
/*
* The currently displayed panel (selected tabbed view if more than one)
*/
@@
-334,6
+340,11
@@
public class AlignFrame extends GAlignFrame implements DropTargetListener,
init();
}
init();
}
+ public void setIsRecurring(boolean status)
+ {
+ recurring = status;
+ }
+
/**
* initalise the alignframe from the underlying viewport data and the
* configurations
/**
* initalise the alignframe from the underlying viewport data and the
* configurations
@@
-496,6
+507,9
@@
public class AlignFrame extends GAlignFrame implements DropTargetListener,
{
hmmerMenu.removeAll();
{
hmmerMenu.removeAll();
+ hmmerMenu.add(changeHMMERLocation);
+ hmmerMenu.addSeparator();
+
hmmerMenu.add(autoAlignSeqs);
hmmerMenu.addSeparator();
hmmerMenu.add(autoAlignSeqs);
hmmerMenu.addSeparator();
@@
-800,6
+814,7
@@
public class AlignFrame extends GAlignFrame implements DropTargetListener,
ap.av.updateConservation(ap);
ap.av.updateConsensus(ap);
ap.av.updateStrucConsensus(ap);
ap.av.updateConservation(ap);
ap.av.updateConsensus(ap);
ap.av.updateStrucConsensus(ap);
+ ap.av.updateInformation(ap);
}
}
}
}
@@
-1038,8
+1053,7
@@
public class AlignFrame extends GAlignFrame implements DropTargetListener,
public void hmmBuild_actionPerformed(ActionEvent e)
throws IOException, InterruptedException
{
public void hmmBuild_actionPerformed(ActionEvent e)
throws IOException, InterruptedException
{
-
- HMMERCommands.hmmBuild(this);
+ new Thread(new HMMBuildThread(this)).start();
alignPanel.repaint();
}
alignPanel.repaint();
}
@@
-1048,14
+1062,28
@@
public class AlignFrame extends GAlignFrame implements DropTargetListener,
public void hmmAlign_actionPerformed(ActionEvent e)
throws IOException, InterruptedException
{
public void hmmAlign_actionPerformed(ActionEvent e)
throws IOException, InterruptedException
{
- HMMERCommands.hmmAlign(this);
+ new Thread(new HMMAlignThread(this, true)).start();
alignPanel.repaint();
}
@Override
alignPanel.repaint();
}
@Override
- public void hmmSearch_actionPerformed(ActionEvent e)
+ public void changeHMMERLocation_actionPerformed(ActionEvent e)
{
{
+ String location = JOptionPane.showInputDialog(
+ MessageManager.getString("label.enter_location"));
+ Cache.setProperty(Preferences.HMMER_PATH, location);
+ }
+ @Override
+ public void autoAlignSeqs_actionPerformed(boolean autoAlignSeqs)
+ {
+ autoAlignNewSequences = autoAlignSeqs;
+ alignPanel.repaint();
+ }
+
+ @Override
+ public void hmmSearch_actionPerformed(ActionEvent e)
+ {
alignPanel.repaint();
}
alignPanel.repaint();
}
@@
-1470,6
+1498,7
@@
public class AlignFrame extends GAlignFrame implements DropTargetListener,
@Override
public void associatedData_actionPerformed(ActionEvent e)
@Override
public void associatedData_actionPerformed(ActionEvent e)
+ throws IOException, InterruptedException
{
// Pick the tree file
JalviewFileChooser chooser = new JalviewFileChooser(
{
// Pick the tree file
JalviewFileChooser chooser = new JalviewFileChooser(
@@
-1961,9
+1990,12
@@
public class AlignFrame extends GAlignFrame implements DropTargetListener,
*
* @param e
* DOCUMENT ME!
*
* @param e
* DOCUMENT ME!
+ * @throws InterruptedException
+ * @throws IOException
*/
@Override
protected void pasteNew_actionPerformed(ActionEvent e)
*/
@Override
protected void pasteNew_actionPerformed(ActionEvent e)
+ throws IOException, InterruptedException
{
paste(true);
}
{
paste(true);
}
@@
-1973,9
+2005,12
@@
public class AlignFrame extends GAlignFrame implements DropTargetListener,
*
* @param e
* DOCUMENT ME!
*
* @param e
* DOCUMENT ME!
+ * @throws InterruptedException
+ * @throws IOException
*/
@Override
protected void pasteThis_actionPerformed(ActionEvent e)
*/
@Override
protected void pasteThis_actionPerformed(ActionEvent e)
+ throws IOException, InterruptedException
{
paste(false);
}
{
paste(false);
}
@@
-1985,8
+2020,10
@@
public class AlignFrame extends GAlignFrame implements DropTargetListener,
*
* @param newAlignment
* true to paste to a new alignment, otherwise add to this.
*
* @param newAlignment
* true to paste to a new alignment, otherwise add to this.
+ * @throws InterruptedException
+ * @throws IOException
*/
*/
- void paste(boolean newAlignment)
+ void paste(boolean newAlignment) throws IOException, InterruptedException
{
boolean externalPaste = true;
try
{
boolean externalPaste = true;
try
@@
-2314,7
+2351,6
@@
public class AlignFrame extends GAlignFrame implements DropTargetListener,
System.out.println("Exception whilst pasting: " + ex);
// could be anything being pasted in here
}
System.out.println("Exception whilst pasting: " + ex);
// could be anything being pasted in here
}
-
}
@Override
}
@Override
@@
-4619,9
+4655,12
@@
public class AlignFrame extends GAlignFrame implements DropTargetListener,
*
* @param file
* either a filename or a URL string.
*
* @param file
* either a filename or a URL string.
+ * @throws InterruptedException
+ * @throws IOException
*/
public void loadJalviewDataFile(String file, DataSourceType sourceType,
FileFormatI format, SequenceI assocSeq)
*/
public void loadJalviewDataFile(String file, DataSourceType sourceType,
FileFormatI format, SequenceI assocSeq)
+ throws IOException, InterruptedException
{
try
{
{
try
{
@@
-4702,24
+4741,13
@@
public class AlignFrame extends GAlignFrame implements DropTargetListener,
}
else if (FileFormat.HMMER3.equals(format))
{
}
else if (FileFormat.HMMER3.equals(format))
{
- HMMFile hmmFile = new HMMFile(new FileParse(file, sourceType)); // TODO
- // need
- // to
- // follow
- // standard
- // pipeline
- hmmFile.parse();
+ HMMFile hmmFile = new HMMFile(new FileParse(file, sourceType));
HiddenMarkovModel hmm = hmmFile.getHMM();
HiddenMarkovModel hmm = hmmFile.getHMM();
+ SequenceI hmmSeq = hmm.initHMMSequence(this, 0);
+ getViewport().initInformation(hmmSeq);
+ getViewport().updateInformation(alignPanel);
- hmm.mapToReferenceAnnotation(this);
-
-
- AlignmentAnnotation annotation = hmm.createAnnotation(
- getViewport().getAlignment().getWidth());
- getViewport().getAlignment().addAnnotation(annotation);
- hmm.initPlaceholder(this);
isAnnotation = true;
isAnnotation = true;
- alignPanel.repaint();
}
else if (FileFormat.Jnet.equals(format))
}
else if (FileFormat.Jnet.equals(format))
@@
-4746,6
+4774,10
@@
public class AlignFrame extends GAlignFrame implements DropTargetListener,
else
{
new FileLoader().LoadFile(viewport, file, sourceType, format);
else
{
new FileLoader().LoadFile(viewport, file, sourceType, format);
+ if (autoAlignNewSequences && !recurring)
+ {
+ new Thread(new HMMAlignThread(this, false)).start();
+ }
}
}
}
}
}
}
@@
-5730,4
+5762,6
@@
class PrintThread extends Thread
}
}
}
}
}
}
+
+
}
}