2 |
26 Feb 07 |
jari |
1 |
/* |
2 |
26 Feb 07 |
jari |
* CompareExperiments.java |
2 |
26 Feb 07 |
jari |
3 |
* |
2 |
26 Feb 07 |
jari |
* Created on November 22, 2003, 4:05 AM |
2 |
26 Feb 07 |
jari |
5 |
*/ |
2 |
26 Feb 07 |
jari |
6 |
|
2 |
26 Feb 07 |
jari |
7 |
package org.tigr.microarray.mev.cgh.CGHAlgorithms.AlterationsComparator; |
2 |
26 Feb 07 |
jari |
8 |
|
2 |
26 Feb 07 |
jari |
9 |
import java.util.Vector; |
2 |
26 Feb 07 |
jari |
10 |
import java.util.ArrayList; |
2 |
26 Feb 07 |
jari |
11 |
import javax.swing.JOptionPane; |
2 |
26 Feb 07 |
jari |
12 |
import javax.swing.tree.DefaultMutableTreeNode; |
2 |
26 Feb 07 |
jari |
13 |
|
2 |
26 Feb 07 |
jari |
14 |
import org.tigr.microarray.mev.ISlideData; |
2 |
26 Feb 07 |
jari |
15 |
import org.tigr.microarray.mev.cgh.CGHAlgorithms.NumberOfAlterations.NumberOfAlterationsCalculator; |
2 |
26 Feb 07 |
jari |
16 |
import org.tigr.microarray.mev.cgh.CGHDataGenerator.ComparisonFlankingRegionCalculator; |
2 |
26 Feb 07 |
jari |
17 |
import org.tigr.microarray.mev.cgh.CGHDataObj.ICGHDataRegion; |
2 |
26 Feb 07 |
jari |
18 |
import org.tigr.microarray.mev.cgh.CGHGuiObj.AlgorithmResultsViewers.NumberOfAlterationsViewers.AlterationParametersViewer; |
2 |
26 Feb 07 |
jari |
19 |
import org.tigr.microarray.mev.cgh.CGHGuiObj.AlgorithmResultsViewers.NumberOfAlterationsViewers.DataRegionsDataModel; |
2 |
26 Feb 07 |
jari |
20 |
import org.tigr.microarray.mev.cgh.CGHGuiObj.AlgorithmResultsViewers.NumberOfAlterationsViewers.NumberOfAlterationsViewer; |
2 |
26 Feb 07 |
jari |
21 |
import org.tigr.microarray.mev.cgh.CGHGuiObj.GuiUtil.GroupExperimentsPanel; |
2 |
26 Feb 07 |
jari |
22 |
import org.tigr.microarray.mev.cluster.algorithm.AbortException; |
2 |
26 Feb 07 |
jari |
23 |
import org.tigr.microarray.mev.cluster.algorithm.AlgorithmException; |
2 |
26 Feb 07 |
jari |
24 |
import org.tigr.microarray.mev.cluster.gui.ICGHCloneValueMenu; |
2 |
26 Feb 07 |
jari |
25 |
import org.tigr.microarray.mev.cluster.gui.IData; |
2 |
26 Feb 07 |
jari |
26 |
import org.tigr.microarray.mev.cluster.gui.IFramework; |
2 |
26 Feb 07 |
jari |
27 |
import org.tigr.microarray.mev.cluster.gui.IViewer; |
2 |
26 Feb 07 |
jari |
28 |
import org.tigr.microarray.mev.cluster.gui.LeafInfo; |
2 |
26 Feb 07 |
jari |
29 |
|
2 |
26 Feb 07 |
jari |
30 |
/** |
2 |
26 Feb 07 |
jari |
31 |
* |
2 |
26 Feb 07 |
jari |
* @author Adam Margolin |
2 |
26 Feb 07 |
jari |
* @author Raktim Sinha |
2 |
26 Feb 07 |
jari |
34 |
*/ |
2 |
26 Feb 07 |
jari |
35 |
public class CompareExperiments extends NumberOfAlterationsCalculator { |
2 |
26 Feb 07 |
jari |
//MultipleArrayData data; |
2 |
26 Feb 07 |
jari |
37 |
IData data; |
2 |
26 Feb 07 |
jari |
38 |
int[] deletionsAOnly, deletionsBOnly, deletionsAandB, amplificationsAOnly, amplificationsBOnly, amplificationsAandB; |
2 |
26 Feb 07 |
jari |
39 |
String exprA; |
2 |
26 Feb 07 |
jari |
40 |
String exprB; |
2 |
26 Feb 07 |
jari |
41 |
|
2 |
26 Feb 07 |
jari |
/** Creates a new instance of CompareExperiments */ |
2 |
26 Feb 07 |
jari |
43 |
public CompareExperiments() { |
2 |
26 Feb 07 |
jari |
44 |
} |
2 |
26 Feb 07 |
jari |
45 |
|
2 |
26 Feb 07 |
jari |
/** This method should return a tree with calculation results or |
2 |
26 Feb 07 |
jari |
* null, if analysis start was canceled. |
2 |
26 Feb 07 |
jari |
48 |
* |
2 |
26 Feb 07 |
jari |
* @param framework the reference to <code>IFramework</code> implementation, |
2 |
26 Feb 07 |
jari |
* which is used to obtain an initial analysis data and parameters. |
2 |
26 Feb 07 |
jari |
* @throws AlgorithmException if calculation was failed. |
2 |
26 Feb 07 |
jari |
* @throws AbortException if calculation was canceled. |
2 |
26 Feb 07 |
jari |
* @see IFramework |
2 |
26 Feb 07 |
jari |
54 |
*/ |
2 |
26 Feb 07 |
jari |
55 |
public DefaultMutableTreeNode execute(IFramework framework) throws AlgorithmException { |
2 |
26 Feb 07 |
jari |
56 |
ComparisonFlankingRegionCalculator frCalc = new ComparisonFlankingRegionCalculator(); |
2 |
26 Feb 07 |
jari |
57 |
this.framework = framework; |
2 |
26 Feb 07 |
jari |
58 |
this.data = framework.getData(); |
2 |
26 Feb 07 |
jari |
59 |
|
2 |
26 Feb 07 |
jari |
60 |
ExperimentsComparatorInitDlg initDlg = new ExperimentsComparatorInitDlg(framework.getFrame(), data.getFeaturesList()); |
2 |
26 Feb 07 |
jari |
61 |
if(initDlg.showModal() != JOptionPane.OK_OPTION){ |
2 |
26 Feb 07 |
jari |
62 |
return null; |
2 |
26 Feb 07 |
jari |
63 |
} |
2 |
26 Feb 07 |
jari |
64 |
|
2 |
26 Feb 07 |
jari |
65 |
GroupExperimentsPanel gPanel = initDlg.getGroupExperimentsPanel(); |
2 |
26 Feb 07 |
jari |
66 |
int[] groupAssignments = gPanel.getGroupAssignments(); |
2 |
26 Feb 07 |
jari |
67 |
|
2 |
26 Feb 07 |
jari |
//this.nodeName = data.getSampleName(groupAssignments[0]) + " vs. " + data.getSampleName(groupAssignments[1]); |
2 |
26 Feb 07 |
jari |
69 |
this.nodeName = "CompareExperiments"; |
2 |
26 Feb 07 |
jari |
70 |
this.exprA = data.getSampleName(groupAssignments[0]); |
2 |
26 Feb 07 |
jari |
71 |
this.exprB = data.getSampleName(groupAssignments[1]); |
2 |
26 Feb 07 |
jari |
72 |
|
2 |
26 Feb 07 |
jari |
73 |
DefaultMutableTreeNode root = new DefaultMutableTreeNode(nodeName); |
2 |
26 Feb 07 |
jari |
74 |
|
2 |
26 Feb 07 |
jari |
75 |
TwoExperimentAlterationComparator comparator = new TwoExperimentAlterationComparator(); |
2 |
26 Feb 07 |
jari |
76 |
comparator.compareExperiments(this.data, groupAssignments[0], groupAssignments[1], TwoExperimentAlterationComparator.DELETION); |
2 |
26 Feb 07 |
jari |
77 |
|
2 |
26 Feb 07 |
jari |
78 |
DefaultMutableTreeNode deletionsNode = new DefaultMutableTreeNode("Deletions"); |
2 |
26 Feb 07 |
jari |
79 |
|
2 |
26 Feb 07 |
jari |
80 |
DefaultMutableTreeNode cloneDeletionsNode = new DefaultMutableTreeNode("Clone Deletions"); |
2 |
26 Feb 07 |
jari |
81 |
deletionsAOnly = comparator.getAOnly(); |
2 |
26 Feb 07 |
jari |
82 |
cloneDeletionsNode.add(new DefaultMutableTreeNode(new LeafInfo("A Only", createComparisonViewer(deletionsAOnly)))); |
2 |
26 Feb 07 |
jari |
83 |
deletionsBOnly = comparator.getBOnly(); |
2 |
26 Feb 07 |
jari |
84 |
cloneDeletionsNode.add(new DefaultMutableTreeNode(new LeafInfo("B Only", createComparisonViewer(deletionsBOnly)))); |
2 |
26 Feb 07 |
jari |
85 |
deletionsAandB = comparator.getAAndB(); |
2 |
26 Feb 07 |
jari |
86 |
cloneDeletionsNode.add(new DefaultMutableTreeNode(new LeafInfo("A and B", createComparisonViewer(deletionsAandB)))); |
2 |
26 Feb 07 |
jari |
87 |
|
2 |
26 Feb 07 |
jari |
88 |
DefaultMutableTreeNode regionDeletionsNode = new DefaultMutableTreeNode("Region Amplifications"); |
2 |
26 Feb 07 |
jari |
89 |
regionDeletionsNode.add(new DefaultMutableTreeNode(new LeafInfo("A Only", createComparisonViewer(frCalc.calculateFlankingRegions(this.data, comparator.getAOnly(), comparator.getBOnly(), groupAssignments[0]))))); |
2 |
26 Feb 07 |
jari |
90 |
regionDeletionsNode.add(new DefaultMutableTreeNode(new LeafInfo("B Only", createComparisonViewer(frCalc.calculateFlankingRegions(this.data, comparator.getBOnly(), comparator.getAOnly(), groupAssignments[1]))))); |
2 |
26 Feb 07 |
jari |
91 |
regionDeletionsNode.add(new DefaultMutableTreeNode(new LeafInfo("A and B", createComparisonViewer(frCalc.calculateFlankingRegions(this.data, comparator.getAAndB(), null, groupAssignments))))); |
2 |
26 Feb 07 |
jari |
92 |
|
2 |
26 Feb 07 |
jari |
93 |
deletionsNode.add(cloneDeletionsNode); |
2 |
26 Feb 07 |
jari |
94 |
deletionsNode.add(regionDeletionsNode); |
2 |
26 Feb 07 |
jari |
95 |
|
2 |
26 Feb 07 |
jari |
96 |
root.add(deletionsNode); |
2 |
26 Feb 07 |
jari |
97 |
|
2 |
26 Feb 07 |
jari |
98 |
comparator.compareExperiments(this.data, groupAssignments[0], groupAssignments[1], TwoExperimentAlterationComparator.AMPLIFICATION); |
2 |
26 Feb 07 |
jari |
99 |
|
2 |
26 Feb 07 |
jari |
100 |
DefaultMutableTreeNode amplificationsNode = new DefaultMutableTreeNode("Amplifications"); |
2 |
26 Feb 07 |
jari |
101 |
|
2 |
26 Feb 07 |
jari |
102 |
DefaultMutableTreeNode cloneAmplificationsNode = new DefaultMutableTreeNode("Clone Amplifications"); |
2 |
26 Feb 07 |
jari |
103 |
amplificationsAOnly = comparator.getAOnly(); |
2 |
26 Feb 07 |
jari |
104 |
cloneAmplificationsNode.add(new DefaultMutableTreeNode(new LeafInfo("A Only", createComparisonViewer(amplificationsAOnly)))); |
2 |
26 Feb 07 |
jari |
105 |
amplificationsBOnly = comparator.getBOnly(); |
2 |
26 Feb 07 |
jari |
106 |
cloneAmplificationsNode.add(new DefaultMutableTreeNode(new LeafInfo("B Only", createComparisonViewer(amplificationsBOnly)))); |
2 |
26 Feb 07 |
jari |
107 |
amplificationsAandB = comparator.getAAndB(); |
2 |
26 Feb 07 |
jari |
108 |
cloneAmplificationsNode.add(new DefaultMutableTreeNode(new LeafInfo("A and B", createComparisonViewer(amplificationsAandB)))); |
2 |
26 Feb 07 |
jari |
109 |
|
2 |
26 Feb 07 |
jari |
110 |
DefaultMutableTreeNode regionAmplificationsNode = new DefaultMutableTreeNode("Region Amplifications"); |
2 |
26 Feb 07 |
jari |
111 |
regionAmplificationsNode.add(new DefaultMutableTreeNode(new LeafInfo("A Only", createComparisonViewer(frCalc.calculateFlankingRegions(this.data, comparator.getAOnly(), comparator.getBOnly(), groupAssignments[0]))))); |
2 |
26 Feb 07 |
jari |
112 |
regionAmplificationsNode.add(new DefaultMutableTreeNode(new LeafInfo("B Only", createComparisonViewer(frCalc.calculateFlankingRegions(this.data, comparator.getBOnly(), comparator.getAOnly(), groupAssignments[1]))))); |
2 |
26 Feb 07 |
jari |
113 |
regionAmplificationsNode.add(new DefaultMutableTreeNode(new LeafInfo("A and B", createComparisonViewer(frCalc.calculateFlankingRegions(this.data, comparator.getAAndB(), null, groupAssignments))))); |
2 |
26 Feb 07 |
jari |
114 |
|
2 |
26 Feb 07 |
jari |
115 |
amplificationsNode.add(cloneAmplificationsNode); |
2 |
26 Feb 07 |
jari |
116 |
amplificationsNode.add(regionAmplificationsNode); |
2 |
26 Feb 07 |
jari |
117 |
|
2 |
26 Feb 07 |
jari |
118 |
root.add(amplificationsNode); |
2 |
26 Feb 07 |
jari |
119 |
|
2 |
26 Feb 07 |
jari |
120 |
addGeneralInfo(root); |
2 |
26 Feb 07 |
jari |
121 |
return root; |
2 |
26 Feb 07 |
jari |
122 |
} |
2 |
26 Feb 07 |
jari |
123 |
|
2 |
26 Feb 07 |
jari |
124 |
/** |
2 |
26 Feb 07 |
jari |
* Raktim 4/27 |
2 |
26 Feb 07 |
jari |
* Added for State Saving |
2 |
26 Feb 07 |
jari |
* @param framework |
2 |
26 Feb 07 |
jari |
* @param groupAssignments |
2 |
26 Feb 07 |
jari |
* @return |
2 |
26 Feb 07 |
jari |
* @throws AlgorithmException |
2 |
26 Feb 07 |
jari |
131 |
*/ |
2 |
26 Feb 07 |
jari |
132 |
public DefaultMutableTreeNode execute(IFramework framework, int[] groupAssignments) throws AlgorithmException { |
2 |
26 Feb 07 |
jari |
133 |
ComparisonFlankingRegionCalculator frCalc = new ComparisonFlankingRegionCalculator(); |
2 |
26 Feb 07 |
jari |
134 |
this.framework = framework; |
2 |
26 Feb 07 |
jari |
135 |
this.data = framework.getData(); |
2 |
26 Feb 07 |
jari |
136 |
|
2 |
26 Feb 07 |
jari |
//this.nodeName = data.getSampleName(groupAssignments[0]) + " vs. " + data.getSampleName(groupAssignments[1]); |
2 |
26 Feb 07 |
jari |
138 |
this.nodeName = "CompareExperiments"; |
2 |
26 Feb 07 |
jari |
139 |
this.exprA = data.getSampleName(groupAssignments[0]); |
2 |
26 Feb 07 |
jari |
140 |
this.exprB = data.getSampleName(groupAssignments[1]); |
2 |
26 Feb 07 |
jari |
141 |
|
2 |
26 Feb 07 |
jari |
142 |
DefaultMutableTreeNode root = new DefaultMutableTreeNode(nodeName); |
2 |
26 Feb 07 |
jari |
143 |
|
2 |
26 Feb 07 |
jari |
144 |
TwoExperimentAlterationComparator comparator = new TwoExperimentAlterationComparator(); |
2 |
26 Feb 07 |
jari |
145 |
comparator.compareExperiments(this.data, groupAssignments[0], groupAssignments[1], TwoExperimentAlterationComparator.DELETION); |
2 |
26 Feb 07 |
jari |
146 |
|
2 |
26 Feb 07 |
jari |
147 |
DefaultMutableTreeNode deletionsNode = new DefaultMutableTreeNode("Deletions"); |
2 |
26 Feb 07 |
jari |
148 |
|
2 |
26 Feb 07 |
jari |
149 |
DefaultMutableTreeNode cloneDeletionsNode = new DefaultMutableTreeNode("Clone Deletions"); |
2 |
26 Feb 07 |
jari |
150 |
deletionsAOnly = comparator.getAOnly(); |
2 |
26 Feb 07 |
jari |
151 |
cloneDeletionsNode.add(new DefaultMutableTreeNode(new LeafInfo("A Only", createComparisonViewer(deletionsAOnly)))); |
2 |
26 Feb 07 |
jari |
152 |
deletionsBOnly = comparator.getBOnly(); |
2 |
26 Feb 07 |
jari |
153 |
cloneDeletionsNode.add(new DefaultMutableTreeNode(new LeafInfo("B Only", createComparisonViewer(deletionsBOnly)))); |
2 |
26 Feb 07 |
jari |
154 |
deletionsAandB = comparator.getAAndB(); |
2 |
26 Feb 07 |
jari |
155 |
cloneDeletionsNode.add(new DefaultMutableTreeNode(new LeafInfo("A and B", createComparisonViewer(deletionsAandB)))); |
2 |
26 Feb 07 |
jari |
156 |
|
2 |
26 Feb 07 |
jari |
157 |
DefaultMutableTreeNode regionDeletionsNode = new DefaultMutableTreeNode("Region Amplifications"); |
2 |
26 Feb 07 |
jari |
158 |
regionDeletionsNode.add(new DefaultMutableTreeNode(new LeafInfo("A Only", createComparisonViewer(frCalc.calculateFlankingRegions(this.data, comparator.getAOnly(), comparator.getBOnly(), groupAssignments[0]))))); |
2 |
26 Feb 07 |
jari |
159 |
regionDeletionsNode.add(new DefaultMutableTreeNode(new LeafInfo("B Only", createComparisonViewer(frCalc.calculateFlankingRegions(this.data, comparator.getBOnly(), comparator.getAOnly(), groupAssignments[1]))))); |
2 |
26 Feb 07 |
jari |
160 |
regionDeletionsNode.add(new DefaultMutableTreeNode(new LeafInfo("A and B", createComparisonViewer(frCalc.calculateFlankingRegions(this.data, comparator.getAAndB(), null, groupAssignments))))); |
2 |
26 Feb 07 |
jari |
161 |
|
2 |
26 Feb 07 |
jari |
162 |
deletionsNode.add(cloneDeletionsNode); |
2 |
26 Feb 07 |
jari |
163 |
deletionsNode.add(regionDeletionsNode); |
2 |
26 Feb 07 |
jari |
164 |
|
2 |
26 Feb 07 |
jari |
165 |
root.add(deletionsNode); |
2 |
26 Feb 07 |
jari |
166 |
|
2 |
26 Feb 07 |
jari |
167 |
comparator.compareExperiments(this.data, groupAssignments[0], groupAssignments[1], TwoExperimentAlterationComparator.AMPLIFICATION); |
2 |
26 Feb 07 |
jari |
168 |
|
2 |
26 Feb 07 |
jari |
169 |
DefaultMutableTreeNode amplificationsNode = new DefaultMutableTreeNode("Amplifications"); |
2 |
26 Feb 07 |
jari |
170 |
|
2 |
26 Feb 07 |
jari |
171 |
DefaultMutableTreeNode cloneAmplificationsNode = new DefaultMutableTreeNode("Clone Amplifications"); |
2 |
26 Feb 07 |
jari |
172 |
amplificationsAOnly = comparator.getAOnly(); |
2 |
26 Feb 07 |
jari |
173 |
cloneAmplificationsNode.add(new DefaultMutableTreeNode(new LeafInfo("A Only", createComparisonViewer(amplificationsAOnly)))); |
2 |
26 Feb 07 |
jari |
174 |
amplificationsBOnly = comparator.getBOnly(); |
2 |
26 Feb 07 |
jari |
175 |
cloneAmplificationsNode.add(new DefaultMutableTreeNode(new LeafInfo("B Only", createComparisonViewer(amplificationsBOnly)))); |
2 |
26 Feb 07 |
jari |
176 |
amplificationsAandB = comparator.getAAndB(); |
2 |
26 Feb 07 |
jari |
177 |
cloneAmplificationsNode.add(new DefaultMutableTreeNode(new LeafInfo("A and B", createComparisonViewer(amplificationsAandB)))); |
2 |
26 Feb 07 |
jari |
178 |
|
2 |
26 Feb 07 |
jari |
179 |
DefaultMutableTreeNode regionAmplificationsNode = new DefaultMutableTreeNode("Region Amplifications"); |
2 |
26 Feb 07 |
jari |
180 |
regionAmplificationsNode.add(new DefaultMutableTreeNode(new LeafInfo("A Only", createComparisonViewer(frCalc.calculateFlankingRegions(this.data, comparator.getAOnly(), comparator.getBOnly(), groupAssignments[0]))))); |
2 |
26 Feb 07 |
jari |
181 |
regionAmplificationsNode.add(new DefaultMutableTreeNode(new LeafInfo("B Only", createComparisonViewer(frCalc.calculateFlankingRegions(this.data, comparator.getBOnly(), comparator.getAOnly(), groupAssignments[1]))))); |
2 |
26 Feb 07 |
jari |
182 |
regionAmplificationsNode.add(new DefaultMutableTreeNode(new LeafInfo("A and B", createComparisonViewer(frCalc.calculateFlankingRegions(this.data, comparator.getAAndB(), null, groupAssignments))))); |
2 |
26 Feb 07 |
jari |
183 |
|
2 |
26 Feb 07 |
jari |
184 |
amplificationsNode.add(cloneAmplificationsNode); |
2 |
26 Feb 07 |
jari |
185 |
amplificationsNode.add(regionAmplificationsNode); |
2 |
26 Feb 07 |
jari |
186 |
|
2 |
26 Feb 07 |
jari |
187 |
root.add(amplificationsNode); |
2 |
26 Feb 07 |
jari |
188 |
|
2 |
26 Feb 07 |
jari |
189 |
addGeneralInfo(root); |
2 |
26 Feb 07 |
jari |
190 |
return root; |
2 |
26 Feb 07 |
jari |
191 |
} |
2 |
26 Feb 07 |
jari |
192 |
|
2 |
26 Feb 07 |
jari |
193 |
|
2 |
26 Feb 07 |
jari |
194 |
/** |
2 |
26 Feb 07 |
jari |
* Old UNUSED |
2 |
26 Feb 07 |
jari |
196 |
*/ |
2 |
26 Feb 07 |
jari |
197 |
public DefaultMutableTreeNode execute2(IFramework framework) throws AlgorithmException { |
2 |
26 Feb 07 |
jari |
198 |
ComparisonFlankingRegionCalculator frCalc = new ComparisonFlankingRegionCalculator(); |
2 |
26 Feb 07 |
jari |
199 |
this.framework = framework; |
2 |
26 Feb 07 |
jari |
200 |
this.data = framework.getData(); |
2 |
26 Feb 07 |
jari |
201 |
|
2 |
26 Feb 07 |
jari |
202 |
ExperimentsComparatorInitDlg initDlg = new ExperimentsComparatorInitDlg(framework.getFrame(), data.getFeaturesList()); |
2 |
26 Feb 07 |
jari |
203 |
if(initDlg.showModal() != JOptionPane.OK_OPTION){ |
2 |
26 Feb 07 |
jari |
204 |
return null; |
2 |
26 Feb 07 |
jari |
205 |
} |
2 |
26 Feb 07 |
jari |
206 |
|
2 |
26 Feb 07 |
jari |
207 |
GroupExperimentsPanel gPanel = initDlg.getGroupExperimentsPanel(); |
2 |
26 Feb 07 |
jari |
208 |
int[] groupAssignments = gPanel.getGroupAssignments(); |
2 |
26 Feb 07 |
jari |
209 |
|
2 |
26 Feb 07 |
jari |
210 |
this.nodeName = data.getSampleName(groupAssignments[0]) + " vs. " + data.getSampleName(groupAssignments[1]); |
2 |
26 Feb 07 |
jari |
211 |
|
2 |
26 Feb 07 |
jari |
212 |
DefaultMutableTreeNode root = new DefaultMutableTreeNode(nodeName); |
2 |
26 Feb 07 |
jari |
213 |
root.add(new DefaultMutableTreeNode(new LeafInfo("Parameters", createParametersViewer()))); |
2 |
26 Feb 07 |
jari |
214 |
|
2 |
26 Feb 07 |
jari |
215 |
TwoExperimentAlterationComparator comparator = new TwoExperimentAlterationComparator(); |
2 |
26 Feb 07 |
jari |
216 |
comparator.compareExperiments(this.data, groupAssignments[0], groupAssignments[1], TwoExperimentAlterationComparator.DELETION); |
2 |
26 Feb 07 |
jari |
217 |
|
2 |
26 Feb 07 |
jari |
218 |
DefaultMutableTreeNode deletionsNode = new DefaultMutableTreeNode("Deletions"); |
2 |
26 Feb 07 |
jari |
219 |
|
2 |
26 Feb 07 |
jari |
220 |
DefaultMutableTreeNode cloneDeletionsNode = new DefaultMutableTreeNode("Clone Deletions"); |
2 |
26 Feb 07 |
jari |
221 |
deletionsAOnly = comparator.getAOnly(); |
2 |
26 Feb 07 |
jari |
222 |
cloneDeletionsNode.add(new DefaultMutableTreeNode(new LeafInfo("A Only", createComparisonViewer(deletionsAOnly)))); |
2 |
26 Feb 07 |
jari |
223 |
deletionsBOnly = comparator.getBOnly(); |
2 |
26 Feb 07 |
jari |
224 |
cloneDeletionsNode.add(new DefaultMutableTreeNode(new LeafInfo("B Only", createComparisonViewer(deletionsBOnly)))); |
2 |
26 Feb 07 |
jari |
225 |
deletionsAandB = comparator.getAAndB(); |
2 |
26 Feb 07 |
jari |
226 |
cloneDeletionsNode.add(new DefaultMutableTreeNode(new LeafInfo("A and B", createComparisonViewer(deletionsAandB)))); |
2 |
26 Feb 07 |
jari |
227 |
|
2 |
26 Feb 07 |
jari |
228 |
DefaultMutableTreeNode regionDeletionsNode = new DefaultMutableTreeNode("Region Amplifications"); |
2 |
26 Feb 07 |
jari |
229 |
regionDeletionsNode.add(new DefaultMutableTreeNode(new LeafInfo("A Only", createComparisonViewer(frCalc.calculateFlankingRegions(this.data, comparator.getAOnly(), comparator.getBOnly(), groupAssignments[0]))))); |
2 |
26 Feb 07 |
jari |
230 |
regionDeletionsNode.add(new DefaultMutableTreeNode(new LeafInfo("B Only", createComparisonViewer(frCalc.calculateFlankingRegions(this.data, comparator.getBOnly(), comparator.getAOnly(), groupAssignments[1]))))); |
2 |
26 Feb 07 |
jari |
231 |
regionDeletionsNode.add(new DefaultMutableTreeNode(new LeafInfo("A and B", createComparisonViewer(frCalc.calculateFlankingRegions(this.data, comparator.getAAndB(), null, groupAssignments))))); |
2 |
26 Feb 07 |
jari |
232 |
|
2 |
26 Feb 07 |
jari |
233 |
deletionsNode.add(cloneDeletionsNode); |
2 |
26 Feb 07 |
jari |
234 |
deletionsNode.add(regionDeletionsNode); |
2 |
26 Feb 07 |
jari |
235 |
|
2 |
26 Feb 07 |
jari |
236 |
root.add(deletionsNode); |
2 |
26 Feb 07 |
jari |
237 |
|
2 |
26 Feb 07 |
jari |
238 |
comparator.compareExperiments(this.data, groupAssignments[0], groupAssignments[1], TwoExperimentAlterationComparator.AMPLIFICATION); |
2 |
26 Feb 07 |
jari |
239 |
|
2 |
26 Feb 07 |
jari |
240 |
DefaultMutableTreeNode amplificationsNode = new DefaultMutableTreeNode("Amplifications"); |
2 |
26 Feb 07 |
jari |
241 |
|
2 |
26 Feb 07 |
jari |
242 |
DefaultMutableTreeNode cloneAmplificationsNode = new DefaultMutableTreeNode("Clone Amplifications"); |
2 |
26 Feb 07 |
jari |
243 |
amplificationsAOnly = comparator.getAOnly(); |
2 |
26 Feb 07 |
jari |
244 |
cloneAmplificationsNode.add(new DefaultMutableTreeNode(new LeafInfo("A Only", createComparisonViewer(amplificationsAOnly)))); |
2 |
26 Feb 07 |
jari |
245 |
amplificationsBOnly = comparator.getBOnly(); |
2 |
26 Feb 07 |
jari |
246 |
cloneAmplificationsNode.add(new DefaultMutableTreeNode(new LeafInfo("B Only", createComparisonViewer(amplificationsBOnly)))); |
2 |
26 Feb 07 |
jari |
247 |
amplificationsAandB = comparator.getAAndB(); |
2 |
26 Feb 07 |
jari |
248 |
cloneAmplificationsNode.add(new DefaultMutableTreeNode(new LeafInfo("A and B", createComparisonViewer(amplificationsAandB)))); |
2 |
26 Feb 07 |
jari |
249 |
|
2 |
26 Feb 07 |
jari |
250 |
DefaultMutableTreeNode regionAmplificationsNode = new DefaultMutableTreeNode("Region Amplifications"); |
2 |
26 Feb 07 |
jari |
251 |
regionAmplificationsNode.add(new DefaultMutableTreeNode(new LeafInfo("A Only", createComparisonViewer(frCalc.calculateFlankingRegions(this.data, comparator.getAOnly(), comparator.getBOnly(), groupAssignments[0]))))); |
2 |
26 Feb 07 |
jari |
252 |
regionAmplificationsNode.add(new DefaultMutableTreeNode(new LeafInfo("B Only", createComparisonViewer(frCalc.calculateFlankingRegions(this.data, comparator.getBOnly(), comparator.getAOnly(), groupAssignments[1]))))); |
2 |
26 Feb 07 |
jari |
253 |
regionAmplificationsNode.add(new DefaultMutableTreeNode(new LeafInfo("A and B", createComparisonViewer(frCalc.calculateFlankingRegions(this.data, comparator.getAAndB(), null, groupAssignments))))); |
2 |
26 Feb 07 |
jari |
254 |
|
2 |
26 Feb 07 |
jari |
255 |
amplificationsNode.add(cloneAmplificationsNode); |
2 |
26 Feb 07 |
jari |
256 |
amplificationsNode.add(regionAmplificationsNode); |
2 |
26 Feb 07 |
jari |
257 |
|
2 |
26 Feb 07 |
jari |
258 |
root.add(amplificationsNode); |
2 |
26 Feb 07 |
jari |
259 |
|
2 |
26 Feb 07 |
jari |
260 |
root.add(new DefaultMutableTreeNode(new LeafInfo("Summary", createSummaryViewer()))); |
2 |
26 Feb 07 |
jari |
261 |
return root; |
2 |
26 Feb 07 |
jari |
262 |
} |
2 |
26 Feb 07 |
jari |
263 |
|
2 |
26 Feb 07 |
jari |
264 |
private IViewer createComparisonViewer(Vector dataRegions){ |
2 |
26 Feb 07 |
jari |
265 |
ICGHDataRegion[] alterationRegions = (ICGHDataRegion[])dataRegions.toArray(new ICGHDataRegion[0]); |
2 |
26 Feb 07 |
jari |
266 |
DataRegionsDataModel dataModel = new DataRegionsDataModel(alterationRegions); |
2 |
26 Feb 07 |
jari |
267 |
|
2 |
26 Feb 07 |
jari |
268 |
NumberOfAlterationsViewer viewer = new NumberOfAlterationsViewer(); |
2 |
26 Feb 07 |
jari |
269 |
viewer.setData(data); |
2 |
26 Feb 07 |
jari |
270 |
viewer.setDataModel(dataModel); |
2 |
26 Feb 07 |
jari |
271 |
|
2 |
26 Feb 07 |
jari |
272 |
return viewer; |
2 |
26 Feb 07 |
jari |
273 |
|
2 |
26 Feb 07 |
jari |
274 |
} |
2 |
26 Feb 07 |
jari |
275 |
|
2 |
26 Feb 07 |
jari |
276 |
private IViewer createComparisonViewer(int[] cloneIndices){ |
2 |
26 Feb 07 |
jari |
277 |
|
2 |
26 Feb 07 |
jari |
278 |
ICGHDataRegion[] alterationRegions = new ICGHDataRegion[cloneIndices.length]; |
2 |
26 Feb 07 |
jari |
279 |
|
2 |
26 Feb 07 |
jari |
280 |
for(int i = 0; i < cloneIndices.length; i++){ |
2 |
26 Feb 07 |
jari |
281 |
alterationRegions[i] = data.getCloneAt(cloneIndices[i]); |
2 |
26 Feb 07 |
jari |
282 |
} |
2 |
26 Feb 07 |
jari |
283 |
|
2 |
26 Feb 07 |
jari |
284 |
DataRegionsDataModel dataModel = new DataRegionsDataModel(alterationRegions); |
2 |
26 Feb 07 |
jari |
285 |
|
2 |
26 Feb 07 |
jari |
286 |
NumberOfAlterationsViewer viewer = new NumberOfAlterationsViewer(); |
2 |
26 Feb 07 |
jari |
287 |
viewer.setData(data); |
2 |
26 Feb 07 |
jari |
288 |
viewer.setDataModel(dataModel); |
2 |
26 Feb 07 |
jari |
289 |
|
2 |
26 Feb 07 |
jari |
290 |
return viewer; |
2 |
26 Feb 07 |
jari |
291 |
} |
2 |
26 Feb 07 |
jari |
292 |
|
2 |
26 Feb 07 |
jari |
293 |
private IViewer createSummaryViewer(){ |
2 |
26 Feb 07 |
jari |
294 |
StringBuffer sb = new StringBuffer(); |
2 |
26 Feb 07 |
jari |
295 |
sb.append("Deletions A Only " + deletionsAOnly.length + "\n"); |
2 |
26 Feb 07 |
jari |
296 |
sb.append("Deletions B Only " + deletionsBOnly.length + "\n"); |
2 |
26 Feb 07 |
jari |
297 |
sb.append("Deletions A and B " + deletionsAandB.length + "\n\n"); |
2 |
26 Feb 07 |
jari |
298 |
|
2 |
26 Feb 07 |
jari |
299 |
sb.append("Amplifications A Only " + amplificationsAOnly.length + "\n"); |
2 |
26 Feb 07 |
jari |
300 |
sb.append("Amplifications B Only " + amplificationsBOnly.length + "\n"); |
2 |
26 Feb 07 |
jari |
301 |
sb.append("Amplifications A and B " + amplificationsAandB.length + "\n\n"); |
2 |
26 Feb 07 |
jari |
302 |
|
2 |
26 Feb 07 |
jari |
303 |
return new AlterationParametersViewer(sb.toString()); |
2 |
26 Feb 07 |
jari |
304 |
} |
2 |
26 Feb 07 |
jari |
305 |
|
2 |
26 Feb 07 |
jari |
306 |
/** |
2 |
26 Feb 07 |
jari |
* Adds node with general iformation. |
2 |
26 Feb 07 |
jari |
308 |
*/ |
2 |
26 Feb 07 |
jari |
309 |
private void addGeneralInfo(DefaultMutableTreeNode root) { |
2 |
26 Feb 07 |
jari |
310 |
ICGHCloneValueMenu menu = framework.getCghCloneValueMenu(); |
2 |
26 Feb 07 |
jari |
311 |
DefaultMutableTreeNode node = new DefaultMutableTreeNode("General Information"); |
2 |
26 Feb 07 |
jari |
312 |
node.add(new DefaultMutableTreeNode("Amplification Threshold: " + menu.getAmpThresh())); |
2 |
26 Feb 07 |
jari |
313 |
node.add(new DefaultMutableTreeNode("Deletion Threshold: " + menu.getDelThresh())); |
2 |
26 Feb 07 |
jari |
314 |
node.add(new DefaultMutableTreeNode("Amplification 2 Copy Threshold: " + menu.getAmpThresh2Copy())); |
2 |
26 Feb 07 |
jari |
315 |
node.add(new DefaultMutableTreeNode("Deletion 2 Copy Threshold: " + menu.getDelThresh2Copy())); |
2 |
26 Feb 07 |
jari |
316 |
|
2 |
26 Feb 07 |
jari |
317 |
node.add(new DefaultMutableTreeNode("Experiment A: " + this.exprA)); |
2 |
26 Feb 07 |
jari |
318 |
node.add(new DefaultMutableTreeNode("Experiment B: " + this.exprB)); |
2 |
26 Feb 07 |
jari |
319 |
node.add(new DefaultMutableTreeNode("Deletions A Only: " + deletionsAOnly.length)); |
2 |
26 Feb 07 |
jari |
320 |
node.add(new DefaultMutableTreeNode("Deletions B Only: " + deletionsBOnly.length)); |
2 |
26 Feb 07 |
jari |
321 |
node.add(new DefaultMutableTreeNode("Deletions A and B: " + deletionsAandB.length)); |
2 |
26 Feb 07 |
jari |
322 |
|
2 |
26 Feb 07 |
jari |
323 |
node.add(new DefaultMutableTreeNode("Amplifications A Only: " + amplificationsAOnly.length)); |
2 |
26 Feb 07 |
jari |
324 |
node.add(new DefaultMutableTreeNode("Amplifications B Only: " + amplificationsBOnly.length)); |
2 |
26 Feb 07 |
jari |
325 |
node.add(new DefaultMutableTreeNode("Amplifications A and B: " + amplificationsAandB.length)); |
2 |
26 Feb 07 |
jari |
326 |
root.add(node); |
2 |
26 Feb 07 |
jari |
327 |
} |
2 |
26 Feb 07 |
jari |
328 |
|
2 |
26 Feb 07 |
jari |
329 |
} |