use of uk.ac.babraham.SeqMonk.Dialogs.Renderers.TypeColourRenderer in project SeqMonk by s-andrews.
the class ContigProbeGenerator method getOptionsPanel.
/* (non-Javadoc)
* @see uk.ac.babraham.SeqMonk.ProbeGenerators.ProbeGenerator#getOptionsPanel(uk.ac.babraham.SeqMonk.SeqMonkApplication)
*/
public JPanel getOptionsPanel() {
if (optionPanel != null) {
// We've done this already
return optionPanel;
}
optionPanel = new JPanel();
optionPanel.setLayout(new GridBagLayout());
GridBagConstraints gbc = new GridBagConstraints();
gbc.gridx = 1;
gbc.gridy = 1;
gbc.weightx = 0.5;
gbc.weighty = 0.1;
gbc.fill = GridBagConstraints.BOTH;
optionPanel.add(new JLabel("Stores to use"), gbc);
gbc.gridy++;
gbc.weighty = 0.9;
DataStore[] stores = collection.getAllDataStores();
storesList = new JList(stores);
storesList.getSelectionModel().addListSelectionListener(this);
storesList.setCellRenderer(new TypeColourRenderer());
optionPanel.add(new JScrollPane(storesList), gbc);
gbc.gridy++;
JPanel bottomPanel = new JPanel();
bottomPanel.setLayout(new GridBagLayout());
GridBagConstraints bgbc = new GridBagConstraints();
bgbc.gridx = 0;
bgbc.gridy = 0;
bgbc.weightx = 0.5;
bgbc.weighty = 0.5;
bgbc.fill = GridBagConstraints.HORIZONTAL;
bottomPanel.add(new JLabel("Use reads on strand "), bgbc);
readStrandTypeBox = new JComboBox(ReadStrandType.getTypeOptions());
bgbc.gridx = 1;
bottomPanel.add(readStrandTypeBox, bgbc);
bgbc.gridy++;
bgbc.gridx = 0;
bottomPanel.add(new JLabel("Build peaks for strands seprately "), bgbc);
bgbc.gridx = 1;
separateStrands = new JCheckBox();
bottomPanel.add(separateStrands, bgbc);
bgbc.gridy++;
bgbc.gridx = 0;
bottomPanel.add(new JLabel("Ignore duplicate reads "), bgbc);
bgbc.gridx = 1;
ignoreDuplicates = new JCheckBox();
bottomPanel.add(ignoreDuplicates, bgbc);
bgbc.gridx = 0;
bgbc.gridy++;
bottomPanel.add(new JLabel("Merge contigs closer than (bp)"), bgbc);
bgbc.gridx = 1;
distField = new JTextField("0", 4);
distField.addKeyListener(this);
bottomPanel.add(distField, bgbc);
optionPanel.add(bottomPanel, gbc);
bgbc.gridx = 0;
bgbc.gridy++;
bottomPanel.add(new JLabel("Min Contig Size (bp) "), bgbc);
bgbc.gridx = 1;
minSizeField = new JTextField("0", 4);
minSizeField.addKeyListener(this);
bottomPanel.add(minSizeField, bgbc);
bgbc.gridx = 0;
bgbc.gridy++;
bottomPanel.add(new JLabel("Depth Cutoff "), bgbc);
bgbc.gridx = 1;
// TODO: Work out the effective fold change for the current cutoff
JPanel depthPanel = new JPanel();
minDepthField = new JTextField("0", 4);
minDepthField.addKeyListener(this);
depthPanel.add(minDepthField);
depthPanel.add(new JLabel("fold "));
depthIntLabel = new JLabel("(" + depthCutoff);
depthPanel.add(depthIntLabel);
depthPanel.add(new JLabel(" reads)"));
bottomPanel.add(depthPanel, bgbc);
optionPanel.add(bottomPanel, gbc);
return optionPanel;
}
use of uk.ac.babraham.SeqMonk.Dialogs.Renderers.TypeColourRenderer in project SeqMonk by s-andrews.
the class EvenCoverageProbeGenerator method getOptionsPanel.
/* (non-Javadoc)
* @see uk.ac.babraham.SeqMonk.ProbeGenerators.ProbeGenerator#getOptionsPanel(uk.ac.babraham.SeqMonk.SeqMonkApplication)
*/
public JPanel getOptionsPanel() {
if (optionPanel != null) {
// We've done this already
return optionPanel;
}
optionPanel = new JPanel();
optionPanel.setLayout(new GridBagLayout());
GridBagConstraints gbc = new GridBagConstraints();
gbc.gridx = 1;
gbc.gridy = 1;
gbc.weightx = 0.5;
gbc.weighty = 0.1;
gbc.fill = GridBagConstraints.BOTH;
optionPanel.add(new JLabel("Stores to use"), gbc);
gbc.gridy++;
gbc.weighty = 0.9;
DataStore[] stores = collection.getAllDataStores();
storesList = new JList(stores);
storesList.getSelectionModel().addListSelectionListener(this);
storesList.setCellRenderer(new TypeColourRenderer());
optionPanel.add(new JScrollPane(storesList), gbc);
gbc.gridy++;
JPanel bottomPanel = new JPanel();
bottomPanel.setLayout(new GridBagLayout());
GridBagConstraints bgbc = new GridBagConstraints();
bgbc.gridx = 0;
bgbc.gridy = 0;
bgbc.weightx = 0.5;
bgbc.weighty = 0.5;
bgbc.fill = GridBagConstraints.HORIZONTAL;
bottomPanel.add(new JLabel("Use reads on strand "), bgbc);
readStrandTypeBox = new JComboBox(ReadStrandType.getTypeOptions());
bgbc.gridx = 1;
bottomPanel.add(readStrandTypeBox, bgbc);
bgbc.gridy++;
bgbc.gridx = 0;
bottomPanel.add(new JLabel("Ignore duplicate reads "), bgbc);
bgbc.gridx = 1;
ignoreDuplicates = new JCheckBox();
bottomPanel.add(ignoreDuplicates, bgbc);
bgbc.gridx = 0;
bgbc.gridy++;
bottomPanel.add(new JLabel("Target read count"), bgbc);
bgbc.gridx = 1;
targetReadCountField = new JTextField("10000", 5);
targetReadCountField.addKeyListener(this);
bottomPanel.add(targetReadCountField, bgbc);
optionPanel.add(bottomPanel, gbc);
bgbc.gridx = 0;
bgbc.gridy++;
bottomPanel.add(new JLabel("Max Probe Size (bp) "), bgbc);
bgbc.gridx = 1;
maxSizeField = new JTextField("0", 5);
maxSizeField.addKeyListener(this);
bottomPanel.add(maxSizeField, bgbc);
optionPanel.add(bottomPanel, gbc);
return optionPanel;
}
use of uk.ac.babraham.SeqMonk.Dialogs.Renderers.TypeColourRenderer in project SeqMonk by s-andrews.
the class MatchDistributionsQuantitation method getOptionsPanel.
/* (non-Javadoc)
* @see uk.ac.babraham.SeqMonk.Quantitation.Quantitation#getOptionsPanel(uk.ac.babraham.SeqMonk.SeqMonkApplication)
*/
public JPanel getOptionsPanel() {
if (optionsPanel == null) {
optionsPanel = new JPanel();
optionsPanel.setLayout(new BorderLayout());
optionsPanel.add(new JLabel("Data Stores to Normalise", JLabel.CENTER), BorderLayout.NORTH);
DataStore[] stores = application.dataCollection().getAllDataStores();
Vector<DataStore> usableStores = new Vector<DataStore>();
for (int i = 0; i < stores.length; i++) {
if (stores[i] instanceof ReplicateSet)
continue;
if (!stores[i].isQuantitated())
continue;
usableStores.add(stores[i]);
}
usedStoresList = new JList(usableStores.toArray(new DataStore[0]));
usedStoresList.getSelectionModel().addListSelectionListener(this);
usedStoresList.setCellRenderer(new TypeColourRenderer());
int[] selectedIndices = new int[usableStores.size()];
for (int i = 0; i < selectedIndices.length; i++) selectedIndices[i] = i;
usedStoresList.setSelectedIndices(selectedIndices);
optionsPanel.add(new JScrollPane(usedStoresList), BorderLayout.CENTER);
}
return optionsPanel;
}
use of uk.ac.babraham.SeqMonk.Dialogs.Renderers.TypeColourRenderer in project SeqMonk by s-andrews.
the class RelativeQuantitation method getOptionsPanel.
/* (non-Javadoc)
* @see uk.ac.babraham.SeqMonk.Quantitation.Quantitation#getOptionsPanel(uk.ac.babraham.SeqMonk.SeqMonkApplication)
*/
public JPanel getOptionsPanel() {
if (optionPanel != null) {
// We've done this already
return optionPanel;
}
optionPanel = new JPanel();
optionPanel.setLayout(new GridBagLayout());
GridBagConstraints gbc = new GridBagConstraints();
gbc.gridx = 1;
gbc.gridy = 1;
gbc.weightx = 0.5;
gbc.weighty = 0.01;
gbc.fill = GridBagConstraints.HORIZONTAL;
gbc.insets = new Insets(2, 2, 2, 2);
optionPanel.add(new JLabel("Reference"), gbc);
gbc.gridx = 2;
optionPanel.add(new JLabel("Data Stores"), gbc);
gbc.gridy++;
gbc.gridx = 1;
gbc.weighty = 0.99;
gbc.fill = GridBagConstraints.BOTH;
DefaultListModel dataModel = new DefaultListModel();
DataStore[] stores = application.dataCollection().getAllDataStores();
Vector<DataStore> quantitatedStores = new Vector<DataStore>();
for (int i = 0; i < stores.length; i++) {
if (stores[i].isQuantitated()) {
dataModel.addElement(stores[i]);
if (!(stores[i] instanceof ReplicateSet)) {
quantitatedStores.add(stores[i]);
}
}
}
data = quantitatedStores.toArray(new DataStore[0]);
referenceList = new JList(dataModel);
// only allow one to be selected
referenceList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
referenceList.setCellRenderer(new TypeColourRenderer());
referenceList.addListSelectionListener(this);
optionPanel.add(new JScrollPane(referenceList), gbc);
gbc.gridx = 2;
tableModel = new ReferencePairingTableModel();
JTable refTable = new JTable(tableModel);
optionPanel.add(new JScrollPane(refTable), gbc);
gbc.gridx = 1;
gbc.gridy++;
gbc.weighty = 0.01;
gbc.fill = GridBagConstraints.NONE;
JButton applyToSelectionButton = new JButton("Apply to Selected");
applyToSelectionButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Object value = referenceList.getSelectedValue();
// if (value == null) return;
tableModel.setReference((DataStore) value);
}
});
optionPanel.add(applyToSelectionButton, gbc);
gbc.gridx = 2;
JButton selectAllButton = new JButton("Apply to All");
selectAllButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
tableModel.selectAll();
Object value = referenceList.getSelectedValue();
tableModel.setReference((DataStore) value);
}
});
// applyToSelectionButton.addActionListener(this);
optionPanel.add(selectAllButton, gbc);
// define relative quantitation method
gbc.gridx = 1;
gbc.gridy++;
gbc.fill = GridBagConstraints.HORIZONTAL;
optionPanel.add(new JLabel("Reference method"), gbc);
gbc.gridx = 2;
diffTypeBox = new JComboBox(new String[] { "Minus", "Log Divide", "Divide" });
// default : divide
diffTypeBox.setSelectedIndex(2);
optionPanel.add(diffTypeBox, gbc);
return optionPanel;
}
use of uk.ac.babraham.SeqMonk.Dialogs.Renderers.TypeColourRenderer in project SeqMonk by s-andrews.
the class MacsPeakCaller method getOptionsPanel.
public JPanel getOptionsPanel() {
if (optionPanel != null) {
// We've done this already
return optionPanel;
}
optionPanel = new JPanel();
optionPanel.setLayout(new GridBagLayout());
GridBagConstraints gbc = new GridBagConstraints();
gbc.gridx = 1;
gbc.gridy = 1;
gbc.weightx = 0.5;
gbc.weighty = 0.1;
gbc.fill = GridBagConstraints.BOTH;
optionPanel.add(new JLabel("ChIP Stores to use"), gbc);
gbc.gridy++;
gbc.weighty = 0.5;
DataStore[] stores = collection.getAllDataStores();
chipStoresList = new JList(stores);
chipStoresList.getSelectionModel().addListSelectionListener(this);
chipStoresList.setCellRenderer(new TypeColourRenderer());
optionPanel.add(new JScrollPane(chipStoresList), gbc);
gbc.gridy++;
gbc.weighty = 0.1;
optionPanel.add(new JLabel("Input Stores to use"), gbc);
gbc.gridy++;
gbc.weighty = 0.5;
inputStoresList = new JList(stores);
inputStoresList.getSelectionModel().addListSelectionListener(this);
inputStoresList.setCellRenderer(new TypeColourRenderer());
optionPanel.add(new JScrollPane(inputStoresList), gbc);
gbc.gridy++;
JPanel bottomPanel = new JPanel();
bottomPanel.setLayout(new GridBagLayout());
GridBagConstraints bgbc = new GridBagConstraints();
bgbc.gridx = 0;
bgbc.gridy = 0;
bgbc.weightx = 0.5;
bgbc.weighty = 0.5;
bgbc.fill = GridBagConstraints.HORIZONTAL;
bottomPanel.add(new JLabel("P-value cutoff "), bgbc);
pValueField = new JTextField("" + pValue);
pValueField.addKeyListener(new NumberKeyListener(true, false, 1));
bgbc.gridx = 1;
bottomPanel.add(pValueField, bgbc);
bgbc.gridx = 0;
bgbc.gridy++;
bottomPanel.add(new JLabel("Sonicated fragment size "), bgbc);
fragmentSizeField = new JTextField("300");
fragmentSizeField.addKeyListener(new NumberKeyListener(false, false));
bgbc.gridx = 1;
bottomPanel.add(fragmentSizeField, bgbc);
bgbc.gridx = 0;
bgbc.gridy++;
bottomPanel.add(new JLabel("Skip deduplication step "), bgbc);
skipDeduplicationBox = new JCheckBox();
bgbc.gridx = 1;
bottomPanel.add(skipDeduplicationBox, bgbc);
optionPanel.add(bottomPanel, gbc);
return optionPanel;
}
Aggregations