本文整理汇总了C#中IAtomContainer.getConnectedAtomsList方法的典型用法代码示例。如果您正苦于以下问题:C# IAtomContainer.getConnectedAtomsList方法的具体用法?C# IAtomContainer.getConnectedAtomsList怎么用?C# IAtomContainer.getConnectedAtomsList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IAtomContainer
的用法示例。
在下文中一共展示了IAtomContainer.getConnectedAtomsList方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PostProcess
/**
* Post process a fragment. --> find neutral possible neutral losses read in
* from the file
*
* @param original
* the original
*
* @return the i atom container set
*
* @throws CDKException
* the CDK exception
* @throws CloneNotSupportedException
* the clone not supported exception
*/
public List<IAtomContainer> PostProcess(IAtomContainer original, double neutralLossMass)
{
// Render.Draw(original, "Original Main");
var ret = new List<IAtomContainer>();
allRings = new RingSet();
if (allRingsOrig.getAtomContainerCount() > 0)
{
// get the rings which are not broken up yet
var bondMap = new Dictionary<IBond, int>();
var count = 0;
foreach (var bondOrig in original.bonds().ToWindowsEnumerable<IBond>())
{
bondMap[bondOrig] = count;
count++;
}
// check for rings which are not broken up!
IRingSet validRings = new RingSet();
for (var i = 0; i < allRingsOrig.getAtomContainerCount(); i++)
{
var bondcount = 0;
foreach (var bondRing in allRingsOrig.getAtomContainer(i).bonds().ToWindowsEnumerable<IBond>())
{
if (bondMap.ContainsKey(bondRing))
{
bondcount++;
}
}
if (bondcount == allRingsOrig.getAtomContainer(i).getBondCount())
{
validRings.addAtomContainer(allRingsOrig.getAtomContainer(i));
}
}
// rings which are not split up
allRings = validRings;
}
IAtomContainer temp = new AtomContainer();
var doneAtoms = new List<IAtom>();
var doneBonds = new List<IBond>();
// now find out the important atoms of the neutral loss
var atomToStart = neutralLoss[neutralLossMass].AtomToStart;
foreach (var bond in original.bonds().ToWindowsEnumerable<IBond>())
{
if (doneBonds.Contains(bond))
{
continue;
}
else
{
doneBonds.Add(bond);
}
// check if this was checked b4
foreach (var atom in bond.atoms().ToWindowsEnumerable<IAtom>())
{
if (doneAtoms.Contains(atom))
{
continue;
}
else
{
doneAtoms.Add(atom);
}
// a possible hit
if (atom.getSymbol().Equals(atomToStart) && !allRings.contains(atom))
{
// Render.Draw(original, "BEFORE");
// check if it is a terminal bond...and not in between!
var atomList = original.getConnectedAtomsList(atom);
var atomCount = 0;
foreach (var iAtom in atomList.ToWindowsEnumerable<IAtom>())
{
// dont check
if (iAtom.getSymbol().Equals("H"))
{
continue;
}
//.........这里部分代码省略.........