Beispiel #1
0
        private void LoadPeaks(ZedGraphControl zgcScan, List <ZedGraphSmallMoleculeFilePeak> zgcPeaks, string[] fileNames, Color color)
        {
            var sigPeaks           = from p in significantPeaks select p.Peak;
            List <FileData2> datas = FileData2.ReadFiles(fileNames, sigPeaks);

            SmallMoleculeZedGraphUtils.LoadPeaks(zgcScan, zgcPeaks, datas, color);

            zgcScan.MasterPane.SetLayout(zgcScan.CreateGraphics(), PaneLayout.SquareRowPreferred);

            zgcScan.AxisChange();
        }
        public override IEnumerable <string> Process(string fileName)
        {
            var result = new List <string>();

            var peakNames = GetPeakInfos(fileName);
            var peaks     = from p in peakNames
                            select p.Substring(1);

            string[] positiveSampleFiles     = GetFiles(dir1);
            string[] positiveReferencesFiles = GetFiles(dir2);

            List <FileData2> sampleDatas     = FileData2.ReadFiles(positiveSampleFiles, peaks);
            List <FileData2> referencesDatas = FileData2.ReadFiles(positiveReferencesFiles, peaks);

            foreach (var peakName in peakNames)
            {
                var file = targetDir + "\\" + peakName + ".png";
                if (File.Exists(file))
                {
                    continue;
                }

                Console.WriteLine(file);

                var peak         = peakName.Substring(1);
                var maxIntensity = (from m in sampleDatas
                                    from p in m[peak]
                                    select p.Intensity).Union(from m in referencesDatas
                                                              from p in m[peak]
                                                              select p.Intensity).Max();

                SmallMoleculeSignificantPeakImageBuilder2 builder2 = new SmallMoleculeSignificantPeakImageBuilder2(peak, sampleDatas, referencesDatas, Color.Red, Color.Blue);
                result.AddRange(builder2.Process(file));
            }

            sampleDatas.Clear();
            referencesDatas.Clear();
            GC.Collect();
            GC.WaitForFullGCComplete();

            return(result);
        }