Exemplo n.º 1
0
        private List <MSDeconvNode> GetConnectedComponenet(MSDeconvNode node, Dictionary <MSDeconvNode, List <MSDeconvNode> > edges, Dictionary <MSDeconvNode, int> connectedNodes)
        {
            var connectedComp = new List <MSDeconvNode>();
            var toVisit       = new List <MSDeconvNode>();

            toVisit.Add(node);
            while (toVisit.Count != 0)
            {
                var current = toVisit[0];
                toVisit.Remove(current);
                if (!connectedComp.Contains(current))
                {
                    connectedComp.Add(current);
                    if (connectedNodes.ContainsKey(current))
                    {
                        break;
                    }
                    connectedNodes.Add(current, 0);
                    if (!edges.ContainsKey(current))
                    {
                        break;
                    }
                    foreach (var n in edges[current])
                    {
                        toVisit.Add(n);
                    }
                }
            }
            return(connectedComp);
        }
Exemplo n.º 2
0
        private Tuple <int, int> GetIndexRange(List <MSDeconvNode> nodeList, double elutionInterval, MSDeconvNode node)
        {
            var startIndex = -1;
            var endIndex   = -1;
            var setStart   = false;

            for (int i = nodeList.IndexOf(node); i < nodeList.Count - 1; i++)
            {
                if (nodeList[i].ScanNumber == node.ScanNumber && !setStart)
                {
                    setStart   = true;
                    startIndex = i + 1;
                }

                var deltaElution = _run.GetElutionTime(nodeList[i + 1].ScanNumber) - _run.GetElutionTime(node.ScanNumber);
                if (deltaElution > elutionInterval)
                {
                    endIndex = i + 1;
                    break;
                }
            }

            return(new Tuple <int, int>(startIndex, endIndex));
        }
Exemplo n.º 3
0
        private Tuple<int, int> GetIndexRange(List<MSDeconvNode> nodeList, double elutionInterval, MSDeconvNode node)
        {

            var startIndex = -1;
            var endIndex = -1;
            var setStart = false;
            for (int i = nodeList.IndexOf(node); i < nodeList.Count-1; i++)
            {
                if(nodeList[i]. ScanNumber == node.ScanNumber && !setStart)
                {
                    setStart = true;
                    startIndex = i + 1;
                }

                var deltaElution = _run.GetElutionTime(nodeList[i+1].ScanNumber) - _run.GetElutionTime(node.ScanNumber);
                if (deltaElution > elutionInterval)
                {
                    endIndex = i + 1;
                    break;
                }
            }
            
            return new Tuple<int, int>(startIndex,endIndex);
        }
Exemplo n.º 4
0
 private List<MSDeconvNode> GetConnectedComponenet(MSDeconvNode node, Dictionary<MSDeconvNode, List<MSDeconvNode>> edges, Dictionary<MSDeconvNode,int> connectedNodes)
 {
     var connectedComp = new List<MSDeconvNode>();
     var toVisit = new List<MSDeconvNode>();
     toVisit.Add(node);
     while (toVisit.Count != 0)
     {
         var current = toVisit[0];
         toVisit.Remove(current);
         if (!connectedComp.Contains(current))
         {
             connectedComp.Add(current);
             if (connectedNodes.ContainsKey(current)) break;
             connectedNodes.Add(current,0);
             if (!edges.ContainsKey(current)) break;
             foreach (var n in edges[current])
             {
                 toVisit.Add(n);
             }
         }
     }
     return connectedComp;
 }