Example #1
0
 public void CreateNewWindow(classAlignmentData alignment)
 {
     AlignmentView window = new AlignmentView()
     {
         DataContext = new AlignmentViewModel(alignment)
     };
     window.Show();
 }
 /// <summary>
 ///     Arguments that hold alignment information when a dataset is aligned.
 /// </summary>
 public FeaturesAlignedEventArgs(DatasetInformation datasetInfo,
     IEnumerable<UMCLight> baselineFeatures,
     IEnumerable<UMCLight> aligneeFeatures,
     classAlignmentData alignmentData)
 {
     m_datasetInformation = datasetInfo;
     BaselineFeatures = baselineFeatures;
     AligneeFeatures = aligneeFeatures;
     AlignmentData = alignmentData;
 }
Example #3
0
        public AlignmentViewModel(classAlignmentData alignment)
        {
            this.WindowTitle = String.Format("{0} Alignment Data",alignment.aligneeDataset);
            var residuals = alignment.ResidualData;

            var heatmap = HeatmapFactory.CreateAlignedHeatmap(alignment.heatScores);
            var netResidual = ScatterPlotFactory.CreateResidualPlot(residuals.Scan, residuals.LinearCustomNet,
                residuals.LinearNet, "NET Residuals", "Scans", "NET");
            var massHistogram = HistogramFactory.CreateHistogram(alignment.netErrorHistogram, "Mass Error", "Mass Error (ppm)");
            var netHistogram = HistogramFactory.CreateHistogram(alignment.netErrorHistogram, "NET Error", "NET Error");
            var massMzResidual = ScatterPlotFactory.CreateResidualPlot(residuals.Mz, residuals.MzMassError,
                residuals.MzMassErrorCorrected, "Mass Residuals", "m/z", "Mass Errors");
            var massScanResidual = ScatterPlotFactory.CreateResidualPlot(residuals.Scan, residuals.MzMassError,
                residuals.MzMassErrorCorrected, "Mass Residuals", "Scan", "Mass Errors");

            this.HeatmapImage = ImageConverter.ConvertImage(PlotImageUtility.CreateImage(heatmap));
            this.NetScanImage = ImageConverter.ConvertImage(PlotImageUtility.CreateImage(netResidual));
            this.MassHistogram = ImageConverter.ConvertImage(PlotImageUtility.CreateImage(massHistogram));
            this.NetHistogram = ImageConverter.ConvertImage(PlotImageUtility.CreateImage(netHistogram));
            this.MassMzImage = ImageConverter.ConvertImage(PlotImageUtility.CreateImage(massMzResidual));
            this.MassScanImage = ImageConverter.ConvertImage(PlotImageUtility.CreateImage(massScanResidual));
        }
        private void ExportAlignmentData(classAlignmentData data,
            DatasetInformation baselineDatasetInformation,
            DatasetInformation alignDatasetInformation,
            IEnumerable<UMCLight> baselineFeatures,
            IEnumerable<UMCLight> aligneeFeatures)
        {
            var netValues = new List<double>();
            var massValues = new List<double>();

            var anchorPoints = data.Matches;
            foreach (var match in anchorPoints)
            {
                netValues.Add(match.AnchorPointX.Net - match.AnchorPointY.Net);
                massValues.Add(match.AnchorPointX.Mass - match.AnchorPointY.Mass);
            }

            var netHist =
                MatchCountHistogramBuilder.CreateResidualHistogram(-.05, .05, .01, netValues);

            var netHistogram = new Dictionary<double, int>();

            Console.WriteLine();
            for (var i = 0; i < netHist.Bins.Count; i++)
            {
                netHistogram.Add(netHist.Bins[i], Convert.ToInt32(netHist.Data[i]));
                Console.WriteLine("{0}\t{1}", netHist.Bins[i], netHist.Data[i]);
            }
        }