Search in sources :

Example 1 with HierarchicalClusterSet

use of uk.ac.babraham.SeqMonk.DataTypes.Cluster.HierarchicalClusterSet in project SeqMonk by s-andrews.

the class HeatmapProbeListWindow method progressComplete.

public void progressComplete(String command, Object result) {
    if (command.equals("heatmap")) {
        if (matrix.interactions().length == 0) {
            JOptionPane.showMessageDialog(SeqMonkApplication.getInstance(), "No interactions were found", "Interaction Result", JOptionPane.INFORMATION_MESSAGE);
            dispose();
            return;
        }
        heatmapPanel = new HeatmapProbeListPanelCollection(data, probeLists, matrix, genome);
        getContentPane().setLayout(new BorderLayout());
        getContentPane().add(heatmapPanel, BorderLayout.CENTER);
        filterOptions = new HeatmapFilterOptions(matrix);
        getContentPane().add(filterOptions, BorderLayout.WEST);
        JPanel buttonPanel = new JPanel();
        JButton closeButton = new JButton("Close");
        closeButton.setActionCommand("close");
        closeButton.addActionListener(this);
        buttonPanel.add(closeButton);
        JButton saveImageButton = new JButton("Save Image");
        saveImageButton.setActionCommand("save_image");
        saveImageButton.addActionListener(this);
        buttonPanel.add(saveImageButton);
        JButton saveProbesButton = new JButton("Save Probe List");
        saveProbesButton.setActionCommand("save_probes");
        saveProbesButton.addActionListener(this);
        buttonPanel.add(saveProbesButton);
        JButton makeReportButton = new JButton("Make Report");
        makeReportButton.setActionCommand("make_report");
        makeReportButton.addActionListener(this);
        buttonPanel.add(makeReportButton);
        clusterButton = new JButton("Cluster Interactions");
        clusterButton.setActionCommand("cluster");
        clusterButton.addActionListener(this);
        buttonPanel.add(clusterButton);
        saveClustersButton = new JButton("Save current clusters");
        saveClustersButton.setActionCommand("save_clusters");
        saveClustersButton.addActionListener(this);
        saveClustersButton.setEnabled(false);
        buttonPanel.add(saveClustersButton);
        getContentPane().add(buttonPanel, BorderLayout.SOUTH);
        setSize(800, 500);
        setLocationRelativeTo(SeqMonkApplication.getInstance());
        setVisible(true);
    } else if (command.equals("interaction_cluster_matrix")) {
        // We can start the actual clustering
        HierarchicalClusterSet clusterSet = new HierarchicalClusterSet((InteractionClusterMatrix) result);
        clusterSet.addListener(new ProgressDialog(this, "HiC Interaction Clustering", clusterSet));
        clusterSet.addListener(this);
        clusterSet.startClustering();
    } else if (command.equals("interaction_cluster")) {
        matrix.setCluster((ClusterPair) result);
        clusterButton.setText("Remove clustering");
        clusterButton.setEnabled(true);
        saveClustersButton.setEnabled(true);
    }
}
Also used : JPanel(javax.swing.JPanel) BorderLayout(java.awt.BorderLayout) InteractionClusterMatrix(uk.ac.babraham.SeqMonk.DataTypes.Interaction.InteractionClusterMatrix) JButton(javax.swing.JButton) ProgressDialog(uk.ac.babraham.SeqMonk.Dialogs.ProgressDialog.ProgressDialog) HierarchicalClusterSet(uk.ac.babraham.SeqMonk.DataTypes.Cluster.HierarchicalClusterSet)

Example 2 with HierarchicalClusterSet

use of uk.ac.babraham.SeqMonk.DataTypes.Cluster.HierarchicalClusterSet in project SeqMonk by s-andrews.

the class HeatmapGenomeWindow method progressComplete.

public void progressComplete(String command, Object result) {
    if (command.equals("heatmap")) {
        if (matrix.interactions().length == 0) {
            JOptionPane.showMessageDialog(SeqMonkApplication.getInstance(), "No interactions were found", "Interaction Result", JOptionPane.INFORMATION_MESSAGE);
            dispose();
            return;
        }
        heatmapPanel = new HeatmapGenomePanelCollection(data, probes, matrix, genome);
        heatmapPanel.genomePanel().addPositionListener(this);
        getContentPane().setLayout(new BorderLayout());
        getContentPane().add(heatmapPanel, BorderLayout.CENTER);
        filterOptions = new HeatmapFilterOptions(matrix);
        getContentPane().add(filterOptions, BorderLayout.WEST);
        JPanel buttonPanel = new JPanel();
        JButton closeButton = new JButton("Close");
        closeButton.setActionCommand("close");
        closeButton.addActionListener(this);
        buttonPanel.add(closeButton);
        JButton matchButton = new JButton("Match Chr View");
        matchButton.setActionCommand("match");
        matchButton.addActionListener(this);
        buttonPanel.add(matchButton);
        sendXButton = new JButton("Send X");
        sendXButton.setActionCommand("send_x");
        sendXButton.addActionListener(this);
        sendXButton.setEnabled(false);
        buttonPanel.add(sendXButton);
        sendYButton = new JButton("Send Y");
        sendYButton.setActionCommand("send_y");
        sendYButton.addActionListener(this);
        sendYButton.setEnabled(false);
        buttonPanel.add(sendYButton);
        JButton saveImageButton = new JButton("Save Image");
        saveImageButton.setActionCommand("save_image");
        saveImageButton.addActionListener(this);
        buttonPanel.add(saveImageButton);
        JButton saveProbesButton = new JButton("Save Probe List");
        saveProbesButton.setActionCommand("save_probes");
        saveProbesButton.addActionListener(this);
        buttonPanel.add(saveProbesButton);
        JButton makeReportButton = new JButton("Make Report");
        makeReportButton.setActionCommand("make_report");
        makeReportButton.addActionListener(this);
        buttonPanel.add(makeReportButton);
        clusterButton = new JButton("Cluster Interactions");
        clusterButton.setActionCommand("cluster");
        clusterButton.addActionListener(this);
        buttonPanel.add(clusterButton);
        saveClustersButton = new JButton("Save current clusters");
        saveClustersButton.setActionCommand("save_clusters");
        saveClustersButton.addActionListener(this);
        saveClustersButton.setEnabled(false);
        buttonPanel.add(saveClustersButton);
        getContentPane().add(buttonPanel, BorderLayout.SOUTH);
        setSize(800, 500);
        setLocationRelativeTo(SeqMonkApplication.getInstance());
        setVisible(true);
    } else if (command.equals("interaction_cluster_matrix")) {
        // We can start the actual clustering
        HierarchicalClusterSet clusterSet = new HierarchicalClusterSet((InteractionClusterMatrix) result);
        clusterSet.addListener(new ProgressDialog(this, "HiC Interaction Clustering", clusterSet));
        clusterSet.addListener(this);
        clusterSet.startClustering();
    } else if (command.equals("interaction_cluster")) {
        matrix.setCluster((ClusterPair) result);
        clusterButton.setText("Remove clustering");
        clusterButton.setEnabled(true);
        saveClustersButton.setEnabled(true);
    }
}
Also used : JPanel(javax.swing.JPanel) BorderLayout(java.awt.BorderLayout) InteractionClusterMatrix(uk.ac.babraham.SeqMonk.DataTypes.Interaction.InteractionClusterMatrix) JButton(javax.swing.JButton) ProgressDialog(uk.ac.babraham.SeqMonk.Dialogs.ProgressDialog.ProgressDialog) HierarchicalClusterSet(uk.ac.babraham.SeqMonk.DataTypes.Cluster.HierarchicalClusterSet)

Aggregations

BorderLayout (java.awt.BorderLayout)2 JButton (javax.swing.JButton)2 JPanel (javax.swing.JPanel)2 HierarchicalClusterSet (uk.ac.babraham.SeqMonk.DataTypes.Cluster.HierarchicalClusterSet)2 InteractionClusterMatrix (uk.ac.babraham.SeqMonk.DataTypes.Interaction.InteractionClusterMatrix)2 ProgressDialog (uk.ac.babraham.SeqMonk.Dialogs.ProgressDialog.ProgressDialog)2