public GlycanStructure(Glycan argGlycan, MSPoint argPeak) { _tree = new GlycanTreeNode(argGlycan.GlycanType, _nextID); _nextID++; _y1 = argPeak; _IUPAC = _tree.GetIUPACString(); }
public GlycanStructure(Glycan argGlycan, float argY1) { _tree = new GlycanTreeNode(argGlycan.GlycanType, _nextID); _nextID++; _y1 = new MSPoint(argY1, 0.0f); _IUPAC = _tree.GetIUPACString(); }
public void AddGlycanToStructure(GlycanTreeNode argAddTree, int argParentID) { GlycanTreeNode Parent = GetGlycanTreeByID(argParentID); if (Parent != null) { foreach (GlycanTreeNode GT in argAddTree.FetchAllGlycanNode()) { GT.NodeID = _nextID; _nextID++; } argAddTree.Parent = Parent; Parent.AddGlycanSubTree(argAddTree); // Parent.UpdateGlycans(); Parent.SortSubTree(); _IUPAC = _tree.GetIUPACString(); } }
public void RemoveSubtree(GlycanTreeNode argTree, GlycanTreeNode argRemoveTree) { int TargetLevel = argRemoveTree.DistanceRoot; GlycanTreeNode CurrentTree = argTree; Queue ChildQuene = new Queue(); do { if (CurrentTree.DistanceRoot < TargetLevel) { if (CurrentTree.GetChildren() == null) //Other Branch { CurrentTree = (GlycanTreeNode)ChildQuene.Dequeue(); } else { if (CurrentTree.GetChildren().Count > 1) { for (int i = 1; i < CurrentTree.GetChildren().Count; i++) { ChildQuene.Enqueue(CurrentTree.GetChildren()[i]); } } CurrentTree = CurrentTree.GetChildren()[0]; } } else { if (CurrentTree.GetIUPACString() == argRemoveTree.GetIUPACString()) { CurrentTree = CurrentTree.Parent; CurrentTree.GetChildren().Remove(argRemoveTree); } } } while (true); }
public GlycanStructure(GlycanTreeNode argGlycan) { _tree = argGlycan; _nextID = argGlycan.NoOfTotalGlycan + 1; _IUPAC = _tree.GetIUPACString(); }