Changeset 4645
- Timestamp:
- 10/25/10 15:07:05 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Analysis/3.3/AlleleFrequencyAnalyzer.cs
r4641 r4645 123 123 124 124 // calculate dummy allele frequencies of alleles of best known solution which did not occur 125 var bestKnownFrequencies = bestKnownAlleles.Select(x => new AlleleFrequency(x.Id, 0, x.Impact, 0, true, false)).Except(frequencies, new AlleleFrequencyIdEqualityComparer()); 125 if (bestKnownAlleles != null) { 126 var bestKnownFrequencies = bestKnownAlleles.Select(x => new AlleleFrequency(x.Id, 0, x.Impact, 0, true, false)).Except(frequencies, new AlleleFrequencyIdEqualityComparer()); 127 frequencies = frequencies.Concat(bestKnownFrequencies); 128 } 126 129 127 130 // fetch results collection … … 135 138 136 139 // store allele frequencies 137 AlleleFrequencyCollection frequenciesCollection = new AlleleFrequencyCollection( bestKnownFrequencies.Concat(frequencies));140 AlleleFrequencyCollection frequenciesCollection = new AlleleFrequencyCollection(frequencies); 138 141 if (!results.ContainsKey("Allele Frequencies")) 139 142 results.Add(new Result("Allele Frequencies", frequenciesCollection)); … … 158 161 results.Add(new Result("Alleles", allelesTable)); 159 162 allelesTable.Rows.Add(new DataRow("Unique Alleles")); 163 DataRowVisualProperties visualProperties = new DataRowVisualProperties(); 164 visualProperties.ChartType = DataRowVisualProperties.DataRowChartType.Line; 165 visualProperties.SecondYAxis = true; 166 allelesTable.Rows.Add(new DataRow("Unique Alleles of Best Known Solution", null, visualProperties)); 167 allelesTable.Rows.Add(new DataRow("Fixed Alleles", null, visualProperties)); 168 allelesTable.Rows.Add(new DataRow("Fixed Alleles of Best Known Solution", null, visualProperties)); 169 allelesTable.Rows.Add(new DataRow("Lost Alleles of Best Known Solution", null, visualProperties)); 160 170 } else { 161 171 allelesTable = (DataTable)results["Alleles"].Value; 162 172 } 173 174 int fixedAllelesCount = frequenciesCollection.Where(x => x.Frequency == 1).Count(); 175 var relevantAlleles = frequenciesCollection.Where(x => x.ContainedInBestKnownSolution); 176 int relevantAllelesCount = relevantAlleles.Count(); 177 int fixedRelevantAllelesCount = relevantAlleles.Where(x => x.Frequency == 1).Count(); 178 int lostRelevantAllelesCount = relevantAlleles.Where(x => x.Frequency == 0).Count(); 179 int uniqueRelevantAllelesCount = relevantAllelesCount - lostRelevantAllelesCount; 163 180 allelesTable.Rows["Unique Alleles"].Values.Add(frequenciesCollection.Count); 181 allelesTable.Rows["Unique Alleles of Best Known Solution"].Values.Add(uniqueRelevantAllelesCount); 182 allelesTable.Rows["Fixed Alleles"].Values.Add(fixedAllelesCount); 183 allelesTable.Rows["Fixed Alleles of Best Known Solution"].Values.Add(fixedRelevantAllelesCount); 184 allelesTable.Rows["Lost Alleles of Best Known Solution"].Values.Add(lostRelevantAllelesCount); 164 185 } 165 186 return base.Apply();
Note: See TracChangeset
for help on using the changeset viewer.