Search in sources :

Example 1 with TypeColourRenderer

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;
}
Also used : JScrollPane(javax.swing.JScrollPane) JCheckBox(javax.swing.JCheckBox) JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) GridBagLayout(java.awt.GridBagLayout) JComboBox(javax.swing.JComboBox) DataStore(uk.ac.babraham.SeqMonk.DataTypes.DataStore) JLabel(javax.swing.JLabel) JTextField(javax.swing.JTextField) JList(javax.swing.JList) TypeColourRenderer(uk.ac.babraham.SeqMonk.Dialogs.Renderers.TypeColourRenderer)

Example 2 with TypeColourRenderer

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;
}
Also used : JScrollPane(javax.swing.JScrollPane) JCheckBox(javax.swing.JCheckBox) JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) GridBagLayout(java.awt.GridBagLayout) JComboBox(javax.swing.JComboBox) DataStore(uk.ac.babraham.SeqMonk.DataTypes.DataStore) JLabel(javax.swing.JLabel) JTextField(javax.swing.JTextField) JList(javax.swing.JList) TypeColourRenderer(uk.ac.babraham.SeqMonk.Dialogs.Renderers.TypeColourRenderer)

Example 3 with TypeColourRenderer

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;
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) ReplicateSet(uk.ac.babraham.SeqMonk.DataTypes.ReplicateSet) JLabel(javax.swing.JLabel) TypeColourRenderer(uk.ac.babraham.SeqMonk.Dialogs.Renderers.TypeColourRenderer) BorderLayout(java.awt.BorderLayout) DataStore(uk.ac.babraham.SeqMonk.DataTypes.DataStore) Vector(java.util.Vector) JList(javax.swing.JList)

Example 4 with TypeColourRenderer

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;
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) JComboBox(javax.swing.JComboBox) ActionEvent(java.awt.event.ActionEvent) ReplicateSet(uk.ac.babraham.SeqMonk.DataTypes.ReplicateSet) JButton(javax.swing.JButton) JLabel(javax.swing.JLabel) DefaultListModel(javax.swing.DefaultListModel) TypeColourRenderer(uk.ac.babraham.SeqMonk.Dialogs.Renderers.TypeColourRenderer) ActionListener(java.awt.event.ActionListener) DataStore(uk.ac.babraham.SeqMonk.DataTypes.DataStore) JTable(javax.swing.JTable) Vector(java.util.Vector) JList(javax.swing.JList)

Example 5 with TypeColourRenderer

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;
}
Also used : JScrollPane(javax.swing.JScrollPane) JCheckBox(javax.swing.JCheckBox) JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) GridBagLayout(java.awt.GridBagLayout) DataStore(uk.ac.babraham.SeqMonk.DataTypes.DataStore) JLabel(javax.swing.JLabel) JTextField(javax.swing.JTextField) NumberKeyListener(uk.ac.babraham.SeqMonk.Utilities.NumberKeyListener) JList(javax.swing.JList) TypeColourRenderer(uk.ac.babraham.SeqMonk.Dialogs.Renderers.TypeColourRenderer)

Aggregations

JLabel (javax.swing.JLabel)6 JList (javax.swing.JList)6 JPanel (javax.swing.JPanel)6 JScrollPane (javax.swing.JScrollPane)6 DataStore (uk.ac.babraham.SeqMonk.DataTypes.DataStore)6 TypeColourRenderer (uk.ac.babraham.SeqMonk.Dialogs.Renderers.TypeColourRenderer)6 GridBagConstraints (java.awt.GridBagConstraints)5 GridBagLayout (java.awt.GridBagLayout)5 JCheckBox (javax.swing.JCheckBox)4 JComboBox (javax.swing.JComboBox)4 JTextField (javax.swing.JTextField)4 BorderLayout (java.awt.BorderLayout)2 ActionEvent (java.awt.event.ActionEvent)2 ActionListener (java.awt.event.ActionListener)2 Vector (java.util.Vector)2 ReplicateSet (uk.ac.babraham.SeqMonk.DataTypes.ReplicateSet)2 NumberKeyListener (uk.ac.babraham.SeqMonk.Utilities.NumberKeyListener)2 Insets (java.awt.Insets)1 DefaultListModel (javax.swing.DefaultListModel)1 JButton (javax.swing.JButton)1