/// <summary> /// Find entry by atom entry summary /// </summary> /// <param name="title"></param> /// <returns></returns> public T FindInlineEntryBySummary(string title) { T entry = AtomUtil.FindInlineEntryBySummary(this, title); if (entry == null) { return(default(T)); } return(entry); }
/// <summary> /// Find entry by atom entry title /// </summary> /// <typeparam name="R">Feed Type passed here</typeparam> /// <param name="title"></param> /// <returns></returns> public R GetEntry <R>(string title) where R : Executable { string repositoryUri = AtomUtil.FindEntryHref(this, title); R obj = Client.Get <R>(repositoryUri, null); if (obj == null) { return(default(R)); } return(obj); }
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(); }
public List <Atom> Neighbors(Atom a) => _cachedNeighbors != null ? _cachedNeighbors[a] : AtomUtil.Neighbors(a, Bonds).ToList();