コード例 #1
0
 protected MacrocycleAnalysis(List <Atom> atoms, IEnumerable <Bond> bonds)
 {
     Atoms = atoms;
     Bonds = bonds;
     _guid = Guid.NewGuid();
     //set special atoms
     _cachedNeighbors = AtomUtil.BuildNeighborCache(Atoms, Bonds);
     Alpha            = Atoms.Where(IsAlpha).ToList();
     Beta             = Atoms.Where(s => Neighbors(s).Count == 2 && Neighbors(s).Count(IsAlpha) == 1).ToList();
     N4Cavity         = Atoms.Where(s => Neighbors(s).Where(IsAlpha).Count(n => DFSUtil.BackTrack(n, s, Neighbors, 5).Count == 5) == 2)
                        .ToList();
     Meso = Atoms.Except(Alpha).Except(Beta).Except(N4Cavity).ToList();
 }