Search in sources :

Example 46 with ProbeList

use of uk.ac.babraham.SeqMonk.DataTypes.Probes.ProbeList in project SeqMonk by s-andrews.

the class SimilarProbeListsDialog method mouseClicked.

public void mouseClicked(MouseEvent me) {
    // We're only interested in double clicks
    if (me.getClickCount() != 2)
        return;
    // If the table hasn't been drawn yet then bail out
    if (table == null)
        return;
    // Get the selected row
    int selectedRow = table.getSelectedRow();
    if (selectedRow < 0)
        return;
    ProbeList newActiveList = (ProbeList) table.getModel().getValueAt(selectedRow, 0);
    try {
        collection.probeSet().setActiveList(newActiveList);
    } catch (SeqMonkException e) {
        throw new IllegalStateException(e);
    }
}
Also used : ProbeList(uk.ac.babraham.SeqMonk.DataTypes.Probes.ProbeList) SeqMonkException(uk.ac.babraham.SeqMonk.SeqMonkException)

Example 47 with ProbeList

use of uk.ac.babraham.SeqMonk.DataTypes.Probes.ProbeList in project SeqMonk by s-andrews.

the class DataViewer method mousePressed.

/* (non-Javadoc)
	 * @see java.awt.event.MouseListener#mousePressed(java.awt.event.MouseEvent)
	 */
public void mousePressed(MouseEvent me) {
    JTree tree = (JTree) me.getSource();
    tree.setSelectionRow(tree.getRowForLocation(me.getX(), me.getY()));
    // Check if they right-clicked
    if ((me.getModifiers() & InputEvent.BUTTON3_MASK) == InputEvent.BUTTON3_MASK) {
        // I'm not sure if this is a timing issue, but we can get the selection path being null
        if (tree.getSelectionPath() == null)
            return;
        Object clickedItem = tree.getSelectionPath().getLastPathComponent();
        if (clickedItem instanceof DataSet) {
            new DataPopupMenu((DataSet) clickedItem).show(dataTree, me.getX(), me.getY());
        } else if (clickedItem instanceof DataGroup) {
            new GroupPopupMenu((DataGroup) clickedItem).show(dataTree, me.getX(), me.getY());
        } else if (clickedItem instanceof ReplicateSet) {
            new ReplicatePopupMenu((ReplicateSet) clickedItem).show(dataTree, me.getX(), me.getY());
        } else if (clickedItem instanceof ProbeList) {
            new ProbePopupMenu((ProbeList) clickedItem).show(probeSetTree, me.getX(), me.getY());
        } else if (clickedItem instanceof AnnotationSet) {
            new AnnotationPopupMenu((AnnotationSet) clickedItem).show(dataTree, me.getX(), me.getY());
        }
    } else // Check if they double clicked
    if (me.getClickCount() == 2) {
        // I'm not sure if this is a timing issue, but we can get the selection path being null
        if (tree.getSelectionPath() == null)
            return;
        Object clickedItem = tree.getSelectionPath().getLastPathComponent();
        if (clickedItem instanceof DataSet) {
            new DataPopupMenu((DataSet) clickedItem).actionPerformed(new ActionEvent(this, 0, "properties"));
        } else if (clickedItem instanceof DataGroup) {
            new GroupPopupMenu((DataGroup) clickedItem).actionPerformed(new ActionEvent(this, 0, "properties"));
        } else if (clickedItem instanceof ReplicateSet) {
            new ReplicatePopupMenu((ReplicateSet) clickedItem).actionPerformed(new ActionEvent(this, 0, "properties"));
        } else if (clickedItem instanceof ProbeList) {
            new ProbePopupMenu((ProbeList) clickedItem).actionPerformed(new ActionEvent(this, 0, "view"));
        } else if (clickedItem instanceof AnnotationSet) {
            new AnnotationPopupMenu((AnnotationSet) clickedItem).actionPerformed(new ActionEvent(this, 0, "properties"));
        }
    }
}
Also used : DataGroup(uk.ac.babraham.SeqMonk.DataTypes.DataGroup) ProbeList(uk.ac.babraham.SeqMonk.DataTypes.Probes.ProbeList) DataSet(uk.ac.babraham.SeqMonk.DataTypes.DataSet) ActionEvent(java.awt.event.ActionEvent) ReplicateSet(uk.ac.babraham.SeqMonk.DataTypes.ReplicateSet) AnnotationSet(uk.ac.babraham.SeqMonk.DataTypes.Genome.AnnotationSet) CoreAnnotationSet(uk.ac.babraham.SeqMonk.DataTypes.Genome.CoreAnnotationSet) JTree(javax.swing.JTree)

Example 48 with ProbeList

use of uk.ac.babraham.SeqMonk.DataTypes.Probes.ProbeList in project SeqMonk by s-andrews.

the class CisTransScatterPlotPanel method getFilteredProbes.

/**
 * Gets the filtered probes.
 *
 * @param probeset the probeset
 * @return the filtered probes
 */
public ProbeList getFilteredProbes(ProbeSet probeset) {
    double minDiff = Math.min(diffStart, diffEnd);
    double maxDiff = Math.max(diffStart, diffEnd);
    ProbeList list = new ProbeList(probeList, "Difference between " + df.format(minDiff) + " and " + df.format(maxDiff), "Cis/Trans difference in " + store.name() + " between " + df.format(minDiff) + " and " + df.format(maxDiff), null);
    if (madeSelection) {
        Probe[] probes = probeList.getAllProbes();
        Arrays.sort(probes);
        for (int p = 0; p < probes.length; p++) {
            double diff = xData[p] - yData[p];
            if (diff < minDiff)
                continue;
            if (diff > maxDiff)
                continue;
            list.addProbe(probes[p], null);
        }
    }
    return list;
}
Also used : ProbeList(uk.ac.babraham.SeqMonk.DataTypes.Probes.ProbeList) Probe(uk.ac.babraham.SeqMonk.DataTypes.Probes.Probe)

Example 49 with ProbeList

use of uk.ac.babraham.SeqMonk.DataTypes.Probes.ProbeList in project SeqMonk by s-andrews.

the class ProbeSetTreeModel method probeSetReplaced.

/* (non-Javadoc)
	 * @see uk.ac.babraham.SeqMonk.DataTypes.DataChangeListener#probeSetReplaced(uk.ac.babraham.SeqMonk.DataTypes.Probes.ProbeSet)
	 */
public void probeSetReplaced(ProbeSet probes) {
    if (this.probes != null) {
        this.probes.removeProbeSetChangeListener(this);
    }
    this.probes = probes;
    if (probes != null) {
        probes.addProbeSetChangeListener(this);
    }
    Enumeration<TreeModelListener> e = listeners.elements();
    while (e.hasMoreElements()) {
        e.nextElement().treeStructureChanged(new TreeModelEvent(rootNode, new ProbeList[] { probes }));
    }
}
Also used : TreeModelEvent(javax.swing.event.TreeModelEvent) ProbeList(uk.ac.babraham.SeqMonk.DataTypes.Probes.ProbeList) TreeModelListener(javax.swing.event.TreeModelListener)

Example 50 with ProbeList

use of uk.ac.babraham.SeqMonk.DataTypes.Probes.ProbeList in project SeqMonk by s-andrews.

the class ProbeSetTreeModel method probeListRemoved.

/* (non-Javadoc)
	 * @see uk.ac.babraham.SeqMonk.DataTypes.Probes.ProbeSetChangeListener#probeListRemoved(uk.ac.babraham.SeqMonk.DataTypes.Probes.ProbeList)
	 */
public void probeListRemoved(ProbeList l) {
    TreeModelEvent me;
    if (l instanceof ProbeSet) {
        me = new TreeModelEvent(l, getPathToRoot(l.parent()), new int[] { 0 }, new ProbeList[] { l });
    } else {
        me = new TreeModelEvent(l, getPathToRoot(l.parent()), new int[] { getIndexOfChild(l.parent(), l) }, new ProbeList[] { l });
    }
    Enumeration<TreeModelListener> e = listeners.elements();
    while (e.hasMoreElements()) {
        e.nextElement().treeNodesRemoved(me);
    }
}
Also used : ProbeSet(uk.ac.babraham.SeqMonk.DataTypes.Probes.ProbeSet) TreeModelEvent(javax.swing.event.TreeModelEvent) ProbeList(uk.ac.babraham.SeqMonk.DataTypes.Probes.ProbeList) TreeModelListener(javax.swing.event.TreeModelListener)

Aggregations

ProbeList (uk.ac.babraham.SeqMonk.DataTypes.Probes.ProbeList)79 Probe (uk.ac.babraham.SeqMonk.DataTypes.Probes.Probe)54 SeqMonkException (uk.ac.babraham.SeqMonk.SeqMonkException)32 Vector (java.util.Vector)16 DataStore (uk.ac.babraham.SeqMonk.DataTypes.DataStore)15 Chromosome (uk.ac.babraham.SeqMonk.DataTypes.Genome.Chromosome)12 HashSet (java.util.HashSet)10 JLabel (javax.swing.JLabel)8 ProbeTTestValue (uk.ac.babraham.SeqMonk.Analysis.Statistics.ProbeTTestValue)8 GridBagConstraints (java.awt.GridBagConstraints)7 GridBagLayout (java.awt.GridBagLayout)7 File (java.io.File)7 JComboBox (javax.swing.JComboBox)7 JPanel (javax.swing.JPanel)7 BufferedReader (java.io.BufferedReader)6 FileReader (java.io.FileReader)6 PrintWriter (java.io.PrintWriter)6 JCheckBox (javax.swing.JCheckBox)6 ProgressRecordDialog (uk.ac.babraham.SeqMonk.Dialogs.ProgressRecordDialog)6 RProgressListener (uk.ac.babraham.SeqMonk.R.RProgressListener)6