コード例 #1
0
        private bool UnMappedAtomsEqualsIndexI(int setNumA, int setNumB, IList <int> iBondSetA,
                                               IList <int> iBondSetB, int atomIndex, int counter, IList <int> newMapping, int indexI,
                                               int indexJ, int order)
        {
            bool normalBond = true;

            for (int c = 0; c < newNeighborNumA; c++)
            {
                if (newMapping[c * 2 + 0].Equals(indexI))
                {
                    SetBondNeighbors(indexI, indexJ, order);
                    if (string.Equals(cTab1Copy[atomIndex * 4 + 2], "X", StringComparison.OrdinalIgnoreCase))
                    {
                        Step3(atomIndex, counter);
                        McGregorChecks.ChangeCharBonds(indexJ, signs[counter], setNumA, iBondSetA, cTab1Copy);
                        int corAtom = McGregorChecks.SearchCorrespondingAtom(newNeighborNumA, indexJ, 1, newMapping);
                        McGregorChecks.ChangeCharBonds(corAtom, signs[counter], setNumB, iBondSetB, cTab2Copy);
                        counter++;
                    }
                    else
                    {
                        Step4(atomIndex);
                    }

                    normalBond = false;
                    neighborBondNumA++;
                }
            }
            return(normalBond);
        }
コード例 #2
0
ファイル: TargetProcessor.cs プロジェクト: ch-hristov/NCDK
        private bool UnMappedAtomsEqualsIndexJ(IAtomContainer target, int mappingSize, int atomIndex, int counter,
                                               IList <int> mappedAtoms, int indexI, int indexJ, int order)
        {
            bool normalBond = true;

            for (int c = 0; c < mappingSize; c++)
            {
                if (mappedAtoms[c * 2 + 1].Equals(indexI))
                {
                    SetBondNeighbors(indexI, indexJ, order);
                    if (string.Equals(cTab2Copy[atomIndex * 4 + 2], "X", StringComparison.OrdinalIgnoreCase))
                    {
                        Step3(atomIndex, counter);
                        McGregorChecks
                        .ChangeCharBonds(indexI, signArray[counter], target.Bonds.Count, target, cTab2Copy);
                        int corAtom = McGregorChecks.SearchCorrespondingAtom(mappingSize, indexI, 2, mappedAtoms);
                        McGregorChecks.ChangeCharBonds(corAtom, signArray[counter], newNeighborNumA, newINeighborsA,
                                                       newCNeighborsA);
                        //                                ChangeCharBonds(corAtom, signArray[counter], query.Bonds.Count, query, cTab1Copy);
                        counter++;
                    }
                    else
                    {
                        Step4(atomIndex);
                    }
                    normalBond = false;
                    neighborBondNumB++;
                }
            }

            return(normalBond);
        }