private static LookupCollection RawFilesinFrame(binFrame frame, out int nRawfiles)
        {
            //Need the Rawfile names
            LookupCollection rawFilesColl = new LookupCollection();

            string rawFileName;

            nRawfiles = 0;
            for (int i = frame.scan.GetLowerBound(0); i <= frame.scan.GetUpperBound(0); i++)
            {
                if (frame.scan[i].rawFileName != null)
                {
                    rawFileName = frame.scan[i].rawFileName.Trim();
                    if (!rawFilesColl.Contains(rawFileName))
                    {
                        int initScansNum = 1;
                        rawFilesColl.Add(rawFileName, initScansNum);
                    }
                    else
                    {
                        int oneMore = (int)rawFilesColl[rawFileName] + 1;
                        rawFilesColl[rawFileName] = oneMore;
                    }
                }
            }

            nRawfiles = rawFilesColl.Count;

            return(rawFilesColl);
        }
        /* public static LookupCollection countRawFiles(string fileXml,out int nRawfiles)
         * {
         *
         *  //Initialize necessary objets for XML reading
         *  XmlTextReader reader = new XmlTextReader(fileXml);
         *  XmlNodeType nType = reader.NodeType;
         *  XmlDocument xmldoc = new XmlDocument();
         *  xmldoc.Load(reader);
         *
         *  //Initialize the AminoacidList[] tAaList
         *  XmlNodeList xmlnodeMatch = xmldoc.GetElementsByTagName("peptide_match");
         *
         *  //Need the Rawfile names
         *  LookupCollection rawFilesColl = new LookupCollection();
         *
         *  string rawFileName;
         *  nRawfiles = 0;
         *  foreach (XmlNode node in xmlnodeMatch)
         *  {
         *      foreach (XmlNode chNode in node.ChildNodes)
         *      {
         *          if (chNode.Name == "RAWFileName")
         *          {
         *              rawFileName = chNode.InnerText.ToString().Trim();
         *
         *              if (!rawFilesColl.Contains(rawFileName))
         *              {
         *                  int initScansNum = 1;
         *                  rawFilesColl.Add(rawFileName, initScansNum);
         *              }
         *              else
         *              {
         *                  int oneMore = (int)rawFilesColl[rawFileName] + 1;
         *                  rawFilesColl[rawFileName] = oneMore;
         *              }
         *
         *          }
         *      }
         *  }
         *  nRawfiles = rawFilesColl.Count;
         *
         *  return rawFilesColl;
         *
         * }
         */

        public static LookupCollection countRawFiles(DataView _quiXMLv, out int nRawfiles)
        {
            //Need the Rawfile names
            LookupCollection rawFilesColl = new LookupCollection();


            string rawFileName;

            nRawfiles = 0;
            for (int i = 0; i < _quiXMLv.Count; i++)
            {
                rawFileName = _quiXMLv[i]["RAWFileName"].ToString().Trim();

                if (!rawFilesColl.Contains(rawFileName))
                {
                    int initScansNum = 1;
                    rawFilesColl.Add(rawFileName, initScansNum);
                }
                else
                {
                    int oneMore = (int)rawFilesColl[rawFileName] + 1;
                    rawFilesColl[rawFileName] = oneMore;
                }
            }

            nRawfiles = rawFilesColl.Count;

            return(rawFilesColl);
        }
        public static LookupCollection countRawFiles(string fileXml, out int nRawfiles)
        {
            //Initialize necessary objets for XML reading
            XmlTextReader reader = new XmlTextReader(fileXml);
            XmlNodeType   nType  = reader.NodeType;
            XmlDocument   xmldoc = new XmlDocument();

            xmldoc.Load(reader);

            //Initialize the AminoacidList[] tAaList
            XmlNodeList xmlnodeMatch = xmldoc.GetElementsByTagName("peptide_match");

            //Need the Rawfile names
            LookupCollection rawFilesColl = new LookupCollection();

            string rawFileName;

            nRawfiles = 0;
            foreach (XmlNode node in xmlnodeMatch)
            {
                foreach (XmlNode chNode in node.ChildNodes)
                {
                    if (chNode.Name == "RAWFileName")
                    {
                        rawFileName = chNode.InnerText.ToString().Trim();

                        if (!rawFilesColl.Contains(rawFileName))
                        {
                            int initScansNum = 1;
                            rawFilesColl.Add(rawFileName, initScansNum);
                        }
                        else
                        {
                            int oneMore = (int)rawFilesColl[rawFileName] + 1;
                            rawFilesColl[rawFileName] = oneMore;
                        }
                    }
                }
            }
            nRawfiles = rawFilesColl.Count;

            return(rawFilesColl);
        }