public List <IsosResult> getIsosResults(string isosInputFile, Globals.MSFileType fileType)
        {
            var isoUtil = new IsosResultUtilities();

            isoUtil.LoadResults(isosInputFile, fileType);
            return(isoUtil.Results);
        }
        public List <IsosResult> getIsosResults(string isosInputFile, Globals.MSFileType fileType, int minScan, int maxScan)
        {
            var isoUtil = new IsosResultUtilities();

            isoUtil.LoadResults(isosInputFile, fileType);
            return(isoUtil.Results.Where(p => p.ScanSet.PrimaryScanNumber >= minScan && p.ScanSet.PrimaryScanNumber <= maxScan).ToList());
        }
        public List <IsosResult> getIMFResults(string imfInputDirectory, int minFrame, int maxFrame)
        {
            var returnedResults = new List <IsosResult>();

            var imfDirectory = new DirectoryInfo(imfInputDirectory);
            var files        = imfDirectory.GetFiles("*_isos.csv");

            foreach (var file in files)
            {
                var currentFrame = getFrameFromFilename(file.Name);
                if (currentFrame >= minFrame && currentFrame <= maxFrame)
                {
                    var isoUtil = new IsosResultUtilities();

                    var isosFileName = file.FullName;
                    //string isosFileName = Path.Combine(Path.GetDirectoryName(file.FullName), Path.GetFileNameWithoutExtension(file.FullName) + "_isos.csv");
                    isoUtil.LoadResults(isosFileName, Globals.MSFileType.PNNL_IMS);

                    var isosResultsForFrame = convertIMFResultsToUIMFResults(currentFrame, isoUtil.Results);

                    returnedResults.AddRange(isosResultsForFrame);
                }
            }

            return(returnedResults);
        }
        public List <IsosResult> getIsosResults(string isosInputFile, DeconTools.Backend.Globals.MSFileType filetype)
        {
            var isoutil = new IsosResultUtilities();

            isoutil.LoadResults(isosInputFile, filetype);
            return(isoutil.Results);
        }
        public string buildStatsForSingleIsosResultSet(List <IsosResult> resultList)
        {
            var sb = new StringBuilder();

            var allResults = new IsosResultStats(resultList);

            var cs1results            = new IsosResultStats(IsosResultUtilities.getIsosResultsByChargeState(resultList, 1, IsosResultUtilities.enumLinqOperator.EqualTo));
            var cs2results            = new IsosResultStats(IsosResultUtilities.getIsosResultsByChargeState(resultList, 2, IsosResultUtilities.enumLinqOperator.EqualTo));
            var cs3results            = new IsosResultStats(IsosResultUtilities.getIsosResultsByChargeState(resultList, 3, IsosResultUtilities.enumLinqOperator.EqualTo));
            var cs4results            = new IsosResultStats(IsosResultUtilities.getIsosResultsByChargeState(resultList, 4, IsosResultUtilities.enumLinqOperator.EqualTo));
            var greaterThanCS4results = new IsosResultStats(IsosResultUtilities.getIsosResultsByChargeState(resultList, 4, IsosResultUtilities.enumLinqOperator.greaterThan));

            var stats = new List <IsosResultStats>();

            stats.Add(allResults);
            stats.Add(cs1results);
            stats.Add(cs2results);
            stats.Add(cs3results);
            stats.Add(cs4results);
            stats.Add(greaterThanCS4results);


            allResults.Description            = "all";
            cs1results.Description            = "1";
            cs2results.Description            = "2";
            cs3results.Description            = "3";
            cs4results.Description            = "4";
            greaterThanCS4results.Description = ">4";

            //build header
            sb.Append("Z");
            sb.Append("\t");
            sb.Append("NumIsos");
            sb.Append("\t");
            sb.Append("AvgFit");
            sb.Append("\t");
            sb.Append("StdDevFit");
            sb.Append(Environment.NewLine);

            foreach (var statItem in stats)
            {
                statItem.FitAverage = IsosResultUtilities.getAverageScore(statItem.Results);
                statItem.FitStdDev  = IsosResultUtilities.getStdDevScore(statItem.Results);
                statItem.Count      = IsosResultUtilities.getCount(statItem.Results);

                sb.Append(statItem.Description);
                sb.Append("\t");
                sb.Append(statItem.Count);
                sb.Append("\t");
                sb.Append(statItem.FitAverage.ToString("0.000"));
                sb.Append("\t");
                sb.Append(statItem.FitStdDev.ToString("0.000"));
                sb.Append(Environment.NewLine);
            }

            return(sb.ToString());
        }
        public List <IsosResult> getUIMFResults(string uimfInputFile, int minFrame, int maxFrame)
        {
            var uimfIsoUtil = new IsosResultUtilities();

            uimfIsoUtil.LoadResults(uimfInputFile, Globals.MSFileType.PNNL_UIMF, minFrame, maxFrame);

            // List<IsosResult> filteredIsos = new List<IsosResult>();

            //foreach (IsosResult result in uimfIsoUtil.Results)
            //{
            //    UIMFIsosResult uimfResult = (UIMFIsosResult)result;
            //    if (uimfResult.FrameSet.PrimaryFrame >= minFrame && uimfResult.FrameSet.PrimaryFrame <= maxFrame)
            //    {
            //        filteredIsos.Add(result);
            //    }
            //}
            return(uimfIsoUtil.Results);
        }