This repository has been archived by the owner on Sep 27, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move the specification of the MT chromosome to Select Reference dialog
- Loading branch information
Stephen Clayton
committed
Aug 9, 2016
1 parent
6ae6679
commit 3f884c2
Showing
6 changed files
with
196 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="IO.ReferenceDialog"> | ||
<grid id="cbd77" binding="contentPane" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1"> | ||
<margin top="10" left="10" bottom="10" right="10"/> | ||
<constraints> | ||
<xy x="48" y="54" width="436" height="297"/> | ||
</constraints> | ||
<properties/> | ||
<border type="none"/> | ||
<children> | ||
<grid id="94766" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1"> | ||
<margin top="0" left="0" bottom="0" right="0"/> | ||
<constraints> | ||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/> | ||
</constraints> | ||
<properties/> | ||
<border type="none"/> | ||
<children> | ||
<hspacer id="98af6"> | ||
<constraints> | ||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/> | ||
</constraints> | ||
</hspacer> | ||
<grid id="9538f" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="true" same-size-vertically="false" hgap="-1" vgap="-1"> | ||
<margin top="0" left="0" bottom="0" right="0"/> | ||
<constraints> | ||
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/> | ||
</constraints> | ||
<properties/> | ||
<border type="none"/> | ||
<children> | ||
<component id="e7465" class="javax.swing.JButton" binding="buttonOK"> | ||
<constraints> | ||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/> | ||
</constraints> | ||
<properties> | ||
<text value="OK"/> | ||
</properties> | ||
</component> | ||
<component id="5723f" class="javax.swing.JButton" binding="buttonCancel"> | ||
<constraints> | ||
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/> | ||
</constraints> | ||
<properties> | ||
<text value="Cancel"/> | ||
</properties> | ||
</component> | ||
</children> | ||
</grid> | ||
</children> | ||
</grid> | ||
<grid id="e3588" layout-manager="GridLayoutManager" row-count="3" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1"> | ||
<margin top="0" left="0" bottom="0" right="0"/> | ||
<constraints> | ||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/> | ||
</constraints> | ||
<properties/> | ||
<border type="none"/> | ||
<children> | ||
<component id="49622" class="javax.swing.JButton" binding="referenceButton" default-binding="true"> | ||
<constraints> | ||
<grid row="0" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/> | ||
</constraints> | ||
<properties> | ||
<text value="Select Reference"/> | ||
<toolTipText value="Select your reference sequence in FASTA format here. You do not need to create indices, these will be created if required by the pipeline itself."/> | ||
</properties> | ||
</component> | ||
<component id="cfc90" class="javax.swing.JLabel"> | ||
<constraints> | ||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/> | ||
</constraints> | ||
<properties> | ||
<text value="Name of mitochondrial chromosome"/> | ||
</properties> | ||
</component> | ||
<component id="18bd9" class="javax.swing.JTextField" binding="mtcapture_jtextfield"> | ||
<constraints> | ||
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false"> | ||
<preferred-size width="150" height="-1"/> | ||
</grid> | ||
</constraints> | ||
<properties> | ||
<toolTipText value="Enter the ID of the MT chromosome here."/> | ||
</properties> | ||
</component> | ||
<component id="a9522" class="javax.swing.JTextPane" binding="pleaseInputTheNameTextPane" default-binding="true"> | ||
<constraints> | ||
<grid row="1" column="0" row-span="1" col-span="2" vsize-policy="7" hsize-policy="6" anchor="0" fill="3" indent="0" use-parent-layout="false"> | ||
<preferred-size width="150" height="40"/> | ||
</grid> | ||
</constraints> | ||
<properties> | ||
<text value="Please input the name of the mitochondrial chromosome. This is used in calculating coverage statistics and for MT capture experiments. Remember to use chrMT for HG19 and MT for hs37d5"/> | ||
</properties> | ||
</component> | ||
</children> | ||
</grid> | ||
</children> | ||
</grid> | ||
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
package IO; | ||
|
||
import javax.swing.*; | ||
import java.awt.*; | ||
import java.awt.event.*; | ||
|
||
public class ReferenceDialog extends JDialog { | ||
private JPanel contentPane; | ||
private JButton buttonOK; | ||
private JButton buttonCancel; | ||
private JButton referenceButton; | ||
private JTextField mtcapture_jtextfield; | ||
private JTextPane pleaseInputTheNameTextPane; | ||
private Communicator communicator; | ||
private JButton runButton; | ||
|
||
public ReferenceDialog(final Communicator communicator, JButton runButton) { | ||
setContentPane(contentPane); | ||
setModal(true); | ||
getRootPane().setDefaultButton(buttonOK); | ||
mtcapture_jtextfield.setText(communicator.getFilter_for_mt()); | ||
this.communicator = communicator; | ||
this.runButton = runButton; | ||
|
||
buttonOK.addActionListener(new ActionListener() { | ||
public void actionPerformed(ActionEvent e) { | ||
onOK(); | ||
} | ||
}); | ||
|
||
buttonCancel.addActionListener(new ActionListener() { | ||
public void actionPerformed(ActionEvent e) { | ||
onCancel(); | ||
} | ||
}); | ||
|
||
referenceButton.addActionListener(new ActionListener() { | ||
@Override | ||
public void actionPerformed(ActionEvent actionEvent) { | ||
ReferenceFastAChooser rffqc = new ReferenceFastAChooser(communicator); | ||
referenceButton.setForeground(Color.green); | ||
|
||
if (checkIfInputWasSelected()) { | ||
runButton.setEnabled(true); | ||
buttonOK.setEnabled(true); | ||
} else { | ||
runButton.setEnabled(false); | ||
buttonCancel.setEnabled(false); | ||
} | ||
} | ||
}); | ||
|
||
// call onCancel() when cross is clicked | ||
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); | ||
addWindowListener(new WindowAdapter() { | ||
public void windowClosing(WindowEvent e) { | ||
onCancel(); | ||
} | ||
}); | ||
|
||
// call onCancel() on ESCAPE | ||
contentPane.registerKeyboardAction(new ActionListener() { | ||
public void actionPerformed(ActionEvent e) { | ||
onCancel(); | ||
} | ||
}, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); | ||
} | ||
|
||
private void onOK() { | ||
// add your code here | ||
this.communicator.setFilter_for_mt(this.mtcapture_jtextfield.getText()); | ||
dispose(); | ||
} | ||
|
||
private void onCancel() { | ||
// add your code here if necessary | ||
dispose(); | ||
} | ||
|
||
private boolean checkIfInputWasSelected() { | ||
boolean tmp = false; | ||
if (communicator.getGUI_inputfiles() != null && communicator.getGUI_reference() != null && communicator.getGUI_resultspath() != null) { | ||
if(communicator.getGUI_inputfiles().size() != 0){ | ||
tmp = true; | ||
} | ||
} | ||
return tmp; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters