Ejemplo n.º 1
0
        /// <summary>
        /// Calculates the topological polar surface area and expresses it as a ratio to molecule size.
        /// </summary>
        /// <returns>Descriptor(s) retaining to polar surface area</returns>
        public Result Calculate(IAtomContainer container)
        {
            container = (IAtomContainer)container.Clone();

            // type & assign implicit hydrogens
            var matcher = CDK.AtomTypeMatcher;

            foreach (var atom in container.Atoms)
            {
                var type = matcher.FindMatchingAtomType(container, atom);
                AtomTypeManipulator.Configure(atom, type);
            }
            var adder = CDK.HydrogenAdder;

            adder.AddImplicitHydrogens(container);

            double polar  = 0;
            double weight = 0;

            // polar surface area: chain it off the TPSADescriptor
            var tpsa  = new TPSADescriptor();
            var value = tpsa.Calculate(container);

            polar = value.Value;

            //  molecular weight
            foreach (var atom in container.Atoms)
            {
                weight += CDK.IsotopeFactory.GetMajorIsotope(atom.Symbol).ExactMass.Value;
                weight += (atom.ImplicitHydrogenCount ?? 0) * 1.00782504;
            }

            return(new Result(weight == 0 ? 0 : polar / weight));
        }
        public StabilizationPlusChargeDescriptor(IAtomContainer container)
        {
            this.clonedContainer = (IAtomContainer)container.Clone();
            AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(this.clonedContainer);

            this.container = container;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// This method calculate the ATS Autocorrelation descriptor.
        /// </summary>
        public Result Calculate(IAtomContainer container, int count = DefaultSize)
        {
            container = (IAtomContainer)container.Clone();
            container = AtomContainerManipulator.RemoveHydrogens(container);

            var w              = ListConvertion(container);
            var natom          = container.Atoms.Count;
            var distancematrix = TopologicalMatrix.GetMatrix(container);
            var masSum         = new double[count];

            for (int k = 0; k < count; k++)
            {
                for (int i = 0; i < natom; i++)
                {
                    for (int j = 0; j < natom; j++)
                    {
                        if (distancematrix[i][j] == k)
                        {
                            masSum[k] += w[i] * w[j];
                        }
                        else
                        {
                            masSum[k] += 0;
                        }
                    }
                }
                if (k > 0)
                {
                    masSum[k] = masSum[k] / 2;
                }
            }

            return(new Result(masSum));
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Calculates the FMF descriptor value for the given <see cref="IAtomContainer"/>.
        /// </summary>
        /// <returns>An object of <see cref="Result"/> that contains the
        /// calculated FMF descriptor value as well as specification details</returns>
        public Result Calculate(IAtomContainer container)
        {
            container = (IAtomContainer)container.Clone();

            var fragmenter = new MurckoFragmenter(true, 3);

            fragmenter.GenerateFragments(container);
            var framework   = fragmenter.GetFrameworksAsContainers().ToReadOnlyList();
            var ringSystems = fragmenter.GetRingSystemsAsContainers().ToReadOnlyList();
            {
                double result;

                if (framework.Count == 1)
                {
                    result = framework[0].Atoms.Count / (double)container.Atoms.Count;
                }
                else if (framework.Count == 0 && ringSystems.Count == 1)
                {
                    result = ringSystems[0].Atoms.Count / (double)container.Atoms.Count;
                }
                else
                {
                    result = 0;
                }

                return(new Result(result));
            }
        }
        /// <summary>
        /// Calculate the complexity in the supplied <see cref="IAtomContainer"/>.
        /// </summary>
        /// <returns>the complexity</returns>
        public Result Calculate(IAtomContainer container)
        {
            container = (IAtomContainer)container.Clone();

            int    a = 0;
            double h = 0;

            foreach (var atom in container.Atoms)
            {
                switch (atom.AtomicNumber)
                {
                default:
                    h++;
                    goto case AtomicNumbers.C;

                case AtomicNumbers.C:
                    a++;
                    goto case AtomicNumbers.H;

                case AtomicNumbers.H:
                    break;
                }
            }
            var b = container.Bonds.Count + AtomContainerManipulator.GetImplicitHydrogenCount(container);
            var c = Math.Abs(b * b - a * a + a) + (h / 100);

            return(new Result(c));
        }
Ejemplo n.º 6
0
        /// <param name="maxIterations">Number of maximum iterations</param>
        /// <param name="checkLonePairElectron">Checking lone pair electrons. Default <see langword="true"/></param>
        /// <param name="maxResonanceStructures">Number of maximum resonance structures to be searched</param>
        public PartialPiChargeDescriptor(IAtomContainer container,
                                         int maxIterations          = int.MaxValue,
                                         bool checkLonePairElectron = true,
                                         int maxResonanceStructures = int.MaxValue)
        {
            clonedContainer = (IAtomContainer)container.Clone();
            AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(clonedContainer);

            var pepe = new GasteigerPEPEPartialCharges();

            if (checkLonePairElectron)
            {
                CDK.LonePairElectronChecker.Saturate(clonedContainer);
            }
            if (maxIterations != int.MaxValue)
            {
                pepe.MaxGasteigerIterations = maxIterations;
            }
            if (maxResonanceStructures != int.MaxValue)
            {
                pepe.MaxResonanceStructures = maxResonanceStructures;
            }

            foreach (var catom in clonedContainer.Atoms)
            {
                catom.Charge = 0;
            }
            pepe.AssignGasteigerPiPartialCharges(clonedContainer, true);

            this.container = container;
        }
        /// <summary>
        /// Calculate sp3/sp2 hybridization ratio in the supplied <see cref="IAtomContainer"/>.
        /// </summary>
        /// <returns>The ratio of sp3 to sp2 carbons</returns>
        public Result Calculate(IAtomContainer container)
        {
            container = (IAtomContainer)container.Clone();
            AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(container);

            int nsp2 = 0;
            int nsp3 = 0;

            foreach (var atom in container.Atoms)
            {
                if (!atom.AtomicNumber.Equals(AtomicNumbers.C))
                {
                    continue;
                }
                switch (atom.Hybridization)
                {
                case Hybridization.SP2:
                    nsp2++;
                    break;

                case Hybridization.SP3:
                    nsp3++;
                    break;
                }
            }
            double ratio = nsp3 / (double)(nsp2 + nsp3);

            return(new Result(ratio));
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Returns deep copy of the molecule
        /// </summary>
        /// <param name="container"></param>
        /// <returns>deep copy of the mol</returns>
        public static IAtomContainer MakeDeepCopy(IAtomContainer container)
        {
            var newAtomContainer = (IAtomContainer)container.Clone();

            newAtomContainer.NotifyChanged();
            return(newAtomContainer);
        }
Ejemplo n.º 9
0
        public override void TestClone()
        {
            IAtomContainer molecule = (IAtomContainer)NewChemObject();
            object         clone    = molecule.Clone();

            Assert.IsTrue(clone is IAtomContainer);
            Assert.AreNotSame(molecule, clone);
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Singleton template instance, mainly useful for aligning molecules.
        /// </summary>
        /// <remarks>
        /// If the template does not have coordinates an error is thrown.
        /// For safety we clone the molecule.
        /// </remarks>
        /// <param name="template">the molecule</param>
        /// <returns>new template handler</returns>
        public static TemplateHandler CreateSingleton(IAtomContainer template)
        {
            var handler = new TemplateHandler();
            var copy    = (IAtomContainer)template.Clone();

            handler.AddMolecule(copy);
            return(handler);
        }
Ejemplo n.º 11
0
        private bool ShowIt(IAtomContainer molecule, string name)
        {
            StructureDiagramGenerator sdg = new StructureDiagramGenerator {
                Molecule = (IAtomContainer)molecule.Clone()
            };

            sdg.GenerateCoordinates(new Vector2(0, 1));
            return(true);
        }
Ejemplo n.º 12
0
        public Result Calculate(IAtomContainer container,
                                Func <IAtomContainer, double> calcLogP             = null,
                                Func <IAtomContainer, int> calcHBondAcceptorCount  = null,
                                Func <IAtomContainer, int> calcHBondDonorCount     = null,
                                Func <IAtomContainer, double> calcWeight           = null,
                                Func <IAtomContainer, int> calcRotatableBondsCount = null)
        {
            // do aromaticity detection
            if (checkAromaticity)
            {
                container = (IAtomContainer)container.Clone(); // don't mod original

                AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(container);
                Aromaticity.CDKLegacy.Apply(container);
            }

            calcLogP = calcLogP ?? (mol => new XLogPDescriptor().Calculate(mol, correctSalicylFactor: true).Value);
            calcHBondAcceptorCount  = calcHBondAcceptorCount ?? (mol => new HBondAcceptorCountDescriptor().Calculate(mol).Value);
            calcHBondDonorCount     = calcHBondDonorCount ?? (mol => new HBondDonorCountDescriptor().Calculate(mol).Value);
            calcWeight              = calcWeight ?? (mol => new WeightDescriptor().Calculate(mol).Value);
            calcRotatableBondsCount = calcRotatableBondsCount ?? (mol => new RotatableBondsCountDescriptor().Calculate(mol, includeTerminals: false, excludeAmides: true).Value);

            int lipinskifailures = 0;

            var xlogPvalue = calcLogP(container);
            var acceptors  = calcHBondAcceptorCount(container);
            var donors     = calcHBondDonorCount(container);
            var mwvalue    = calcWeight(container);

            // exclude (heavy atom) terminal bonds
            // exclude amide C-N bonds because of their high rotational barrier
            // see Veber, D.F. et al., 2002, 45(12), pp.2615–23.
            var rotatablebonds = calcRotatableBondsCount(container);

            if (xlogPvalue > 5.0)
            {
                lipinskifailures += 1;
            }
            if (acceptors > 10)
            {
                lipinskifailures += 1;
            }
            if (donors > 5)
            {
                lipinskifailures += 1;
            }
            if (mwvalue > 500.0)
            {
                lipinskifailures += 1;
            }
            if (rotatablebonds > 10.0)
            {
                lipinskifailures += 1;
            }

            return(new Result(lipinskifailures));
        }
Ejemplo n.º 13
0
        public IPAtomicHOSEDescriptor(IAtomContainer container)
        {
            this.container = container;

            container = (IAtomContainer)container.Clone();
            AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(container);
            CDK.LonePairElectronChecker.Saturate(container);
            this.clonedContainer = container;
        }
Ejemplo n.º 14
0
        public static IAtomContainer CreateAnyAtomAtomContainer(IAtomContainer atomContainer)
        {
            var query = (IAtomContainer)atomContainer.Clone();

            for (int i = 0; i < query.Atoms.Count; i++)
            {
                query.Atoms[i].Symbol = "C";
            }
            return(query);
        }
Ejemplo n.º 15
0
        /// <summary>
        /// Given a structure in the correct configuration (explicit H and aromatised) it will return the logP as a Double
        /// or if it is out of domain (encounters an unknown atomtype) it will return <see cref="Double.NaN"/>.
        /// </summary>
        /// <param name="container">the structure to calculate which have explicit H and be aromatised.</param>
        /// <returns>The calculated logP</returns>
        public Result Calculate(IAtomContainer container)
        {
            container = (IAtomContainer)container.Clone();
            AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(container);
            var hAdder = CDK.HydrogenAdder;

            hAdder.AddImplicitHydrogens(container);
            AtomContainerManipulator.ConvertImplicitToExplicitHydrogens(container);
            Aromaticity.CDKLegacy.Apply(container);
            return(new JPlogPCalculator(container, coeffs).Calculate());
        }
Ejemplo n.º 16
0
        public ProtonTotalPartialChargeDescriptor(IAtomContainer container)
        {
            clonedContainer = (IAtomContainer)container.Clone();
            var peoe = new GasteigerMarsiliPartialCharges {
                MaxGasteigerIterations = 6
            };

            peoe.AssignGasteigerMarsiliSigmaPartialCharges(this.clonedContainer, true);

            this.container = container;
        }
Ejemplo n.º 17
0
        public IsProtonInAromaticSystemDescriptor(IAtomContainer container, bool checkAromaticity = false)
        {
            clonedAtomContainer = (IAtomContainer)container.Clone();
            if (checkAromaticity)
            {
                AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(clonedAtomContainer);
                Aromaticity.CDKLegacy.Apply(clonedAtomContainer);
            }

            this.container = container;
        }
Ejemplo n.º 18
0
        /// <param name="maxIterations">Number of maximum iterations</param>
        public SigmaElectronegativityDescriptor(IAtomContainer container, int maxIterations = int.MaxValue)
        {
            this.clonedContainer = (IAtomContainer)container.Clone();
            AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(this.clonedContainer);
            electronegativity = new Electronegativity();
            if (maxIterations != int.MaxValue)
            {
                electronegativity.MaxIterations = maxIterations;
            }

            this.container = container;
        }
Ejemplo n.º 19
0
        /// <summary>
        /// Calculates the descriptor value using the <see cref="VABCVolume"/> class.
        /// </summary>
        /// <returns>A double containing the volume</returns>
        public Result Calculate(IAtomContainer container)
        {
            container = (IAtomContainer)container.Clone(); // don't mod original

            try
            {
                return(new Result(VABCVolume.Calculate(container)));
            }
            catch (CDKException e)
            {
                return(new Result(e));
            }
        }
Ejemplo n.º 20
0
        /// <param name="maxIterations">Number of maximum iterations</param>
        public PartialSigmaChargeDescriptor(IAtomContainer container, int maxIterations = int.MaxValue)
        {
            clonedContainer = (IAtomContainer)container.Clone();
            var peoe = new GasteigerMarsiliPartialCharges();

            if (maxIterations != int.MaxValue)
            {
                peoe.MaxGasteigerIterations = maxIterations;
            }
            peoe.AssignGasteigerMarsiliSigmaPartialCharges(clonedContainer, true);

            this.container = container;
        }
Ejemplo n.º 21
0
        public PiContactDetectionDescriptor(IAtomContainer container, bool checkAromaticity = false)
        {
            clonedContainer = (IAtomContainer)container.Clone();
            mol             = clonedContainer.Builder.NewAtomContainer(clonedContainer);
            if (checkAromaticity)
            {
                AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(mol);
                Aromaticity.CDKLegacy.Apply(mol);
            }
            acSet = ConjugatedPiSystemsDetector.Detect(mol);

            this.container = container;
        }
Ejemplo n.º 22
0
        /// <summary>
        /// Calculate the count of aromatic atoms in the supplied <see cref="IAtomContainer"/>.
        /// </summary>
        /// <remarks>
        /// The method take a boolean checkAromaticity: if the boolean is <see langword="true"/>, it means that
        /// aromaticity has to be checked.
        /// </remarks>
        /// <returns>the number of aromatic bonds</returns>
        public Result Calculate(IAtomContainer container)
        {
            if (checkAromaticity)
            {
                container = (IAtomContainer)container.Clone();
                AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(container);
                Aromaticity.CDKLegacy.Apply(container);
            }

            var count = container.Bonds.Count(bond => bond.IsAromatic);

            return(new Result(count));
        }
Ejemplo n.º 23
0
        /// <summary>
        /// Returns IAtomContainer without Hydrogen. If an AtomContainer has atom single atom which
        /// is atom Hydrogen then its not removed.
        /// </summary>
        /// <param name="atomContainer"></param>
        /// <returns>IAtomContainer without Hydrogen. If an AtomContainer has atom single atom which is atom Hydrogen then its not removed.</returns>
        public static IAtomContainer RemoveHydrogensExceptSingleAndPreserveAtomID(IAtomContainer atomContainer)
        {
            var map = new CDKObjectMap(); // maps original object to clones.

            if (atomContainer.Bonds.Count > 0)
            {
                var          mol    = (IAtomContainer)atomContainer.Clone(map);
                List <IAtom> remove = new List <IAtom>(); // lists removed Hs.
                foreach (var atom in atomContainer.Atoms)
                {
                    if (atom.AtomicNumber.Equals(AtomicNumbers.H))
                    {
                        remove.Add(atom);
                    }
                }
                foreach (var a in remove)
                {
                    mol.RemoveAtomAndConnectedElectronContainers(map.Get(a));
                }
                foreach (var atom in mol.Atoms.Where(n => !n.ImplicitHydrogenCount.HasValue))
                {
                    atom.ImplicitHydrogenCount = 0;
                }
                //            Recompute hydrogen counts of neighbours of removed Hydrogens.
                mol = RecomputeHydrogens(mol, atomContainer, remove, map);
                return(mol);
            }
            else
            {
                var mol = (IAtomContainer)atomContainer.Clone(map);
                if (string.Equals(atomContainer.Atoms[0].Symbol, "H", StringComparison.OrdinalIgnoreCase))
                {
                    Console.Error.WriteLine("WARNING: single hydrogen atom removal not supported!");
                }
                return(mol);
            }
        }
Ejemplo n.º 24
0
        /// <summary>
        /// This method calculate the ATS Autocorrelation descriptor.
        /// </summary>
        public Result Calculate(IAtomContainer container)
        {
            container = (IAtomContainer)container.Clone();

            AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(container);
            var hAdder = CDK.HydrogenAdder;

            hAdder.AddImplicitHydrogens(container);
            AtomContainerManipulator.ConvertImplicitToExplicitHydrogens(container);
            Aromaticity.CDKLegacy.Apply(container);

            // get the distance matrix for pol calcs as well as for later on
            var distancematrix = PathTools.ComputeFloydAPSP(AdjacencyMatrix.GetMatrix(container));

            var w                 = Listpolarizability(container, distancematrix);
            var natom             = container.Atoms.Count;
            var polarizabilitySum = new double[5];

            for (int k = 0; k < 5; k++)
            {
                for (int i = 0; i < natom; i++)
                {
                    if (container.Atoms[i].AtomicNumber.Equals(AtomicNumbers.H))
                    {
                        continue;
                    }
                    for (int j = 0; j < natom; j++)
                    {
                        if (container.Atoms[j].AtomicNumber.Equals(AtomicNumbers.H))
                        {
                            continue;
                        }
                        if (distancematrix[i][j] == k)
                        {
                            polarizabilitySum[k] += w[i] * w[j];
                        }
                        else
                        {
                            polarizabilitySum[k] += 0.0;
                        }
                    }
                }
                if (k > 0)
                {
                    polarizabilitySum[k] = polarizabilitySum[k] / 2;
                }
            }
            return(new Result(polarizabilitySum));
        }
Ejemplo n.º 25
0
        /// <summary>
        /// Returns IAtomContainer without Hydrogen. If an AtomContainer has atom single atom which
        /// is atom Hydrogen then its not removed.
        /// </summary>
        /// <param name="atomContainer"></param>
        /// <returns>IAtomContainer without Hydrogen. If an AtomContainer has atom single atom which is atom Hydrogen then its not removed.</returns>
        public static IAtomContainer ConvertExplicitToImplicitHydrogens(IAtomContainer atomContainer)
        {
            IAtomContainer mol = (IAtomContainer)atomContainer.Clone();

            ConvertImplicitToExplicitHydrogens(mol);
            if (mol.Atoms.Count > 1)
            {
                mol = RemoveHydrogens(mol);
            }
            else if (string.Equals(mol.Atoms.First().Symbol, "H", StringComparison.OrdinalIgnoreCase))
            {
                Console.Error.WriteLine("WARNING: single hydrogen atom removal not supported!");
            }
            return(mol);
        }
Ejemplo n.º 26
0
        public Result Calculate(IAtomContainer container)
        {
            container = (IAtomContainer)container.Clone(); // don't mod original

            // do aromaticity detection
            if (checkAromaticity)
            {
                AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(container);
                Aromaticity.CDKLegacy.Apply(container);
            }

            var count = tools.Select(n => n.MatchAll(container).Count()).Sum();

            return(new Result(count));
        }
Ejemplo n.º 27
0
        /// <summary>
        /// Determine the number of amino acids groups the supplied <see cref="IAtomContainer"/>.
        /// </summary>
        /// <returns>the number of aromatic atoms of this AtomContainer</returns>
        public Result Calculate(IAtomContainer container)
        {
            container = (IAtomContainer)container.Clone();
            var results = new List <int>(substructureSet.Count);

            var universalIsomorphismTester = new UniversalIsomorphismTester();

            foreach (var substructure in substructureSet)
            {
                var maps = universalIsomorphismTester.GetSubgraphMaps(container, substructure);
                results.Add(maps.Count());
            }

            return(new Result(results));
        }
Ejemplo n.º 28
0
        public void TestClone()
        {
            IAtomContainer molecule  = TestMoleculeFactory.MakeAlphaPinene();
            IAtomContainer clonedMol = (IAtomContainer)molecule.Clone();

            Assert.IsTrue(molecule.Atoms.Count == clonedMol.Atoms.Count);
            for (int f = 0; f < molecule.Atoms.Count; f++)
            {
                for (int g = 0; g < clonedMol.Atoms.Count; g++)
                {
                    Assert.IsNotNull(molecule.Atoms[f]);
                    Assert.IsNotNull(clonedMol.Atoms[g]);
                    Assert.IsTrue(molecule.Atoms[f] != clonedMol.Atoms[g]);
                }
            }
        }
Ejemplo n.º 29
0
        public void TestFingerPrint()
        {
            IFingerprinter printer = new GraphOnlyFingerprinter();

            IAtomContainer mol1 = CreateMolecule(molecule_test_2);
            IAtomContainer mol2 = CreateMolecule(ethanolamine);

            Assert.IsTrue(new UniversalIsomorphismTester().IsSubgraph(mol1, mol2), "SubGraph does NOT match");

            BitArray bs1 = printer.GetBitFingerprint((IAtomContainer)mol1.Clone()).AsBitSet();
            BitArray bs2 = printer.GetBitFingerprint((IAtomContainer)mol2.Clone()).AsBitSet();

            Assert.IsTrue(FingerprinterTool.IsSubset(bs1, bs2), "Subset (with fingerprint) does NOT match");

            // Match OK
            Debug.WriteLine("Subset (with fingerprint) does match");
        }
Ejemplo n.º 30
0
        public Result Calculate(IAtomContainer container)
        {
            container = (IAtomContainer)container.Clone();

            int nSpiro = 0;

            Cycles.MarkRingAtomsAndBonds(container);
            foreach (var atom in container.Atoms)
            {
                if (GetSpiroDegree(container, atom) != 0)
                {
                    nSpiro++;
                }
            }

            return(new Result(nSpiro));
        }
Ejemplo n.º 31
0
 /// <summary>  Returns a ringset containing all rings in the given AtomContainer
 /// 
 /// </summary>
 /// <param name="atomContainer">    The AtomContainer to be searched for rings
 /// </param>
 /// <returns>                   A RingSet with all rings in the AtomContainer
 /// </returns>
 /// <exception cref="CDKException"> An exception thrown if something goes wrong or if the timeout limit is reached
 /// </exception>
 public virtual IRingSet findAllRings(IAtomContainer atomContainer)
 {
     startTime = (System.DateTime.Now.Ticks - 621355968000000000) / 10000;
     SpanningTree spanningTree;
     try
     {
         spanningTree = new SpanningTree((IAtomContainer)atomContainer.Clone());
     }
     //UPGRADE_NOTE: Exception 'java.lang.CloneNotSupportedException' was converted to 'System.Exception' which has different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1100'"
     catch (System.Exception e)
     {
         throw new CDKException("Could not clone IAtomContainer!", e);
     }
     spanningTree.identifyBonds();
     if (spanningTree.BondsCyclicCount < 37)
     {
         findAllRings(atomContainer, false);
     }
     return findAllRings(atomContainer, true);
 }
Ejemplo n.º 32
0
 private static void getLargestAtomContainer(IAtomContainer firstAC, IAtomContainer secondAC)
 {
     if (firstAC.AtomCount < secondAC.AtomCount)
     {
         IAtomContainer tmp;
         try
         {
             tmp = (IAtomContainer)firstAC.Clone();
             firstAC = (IAtomContainer)secondAC.Clone();
             secondAC = (IAtomContainer)tmp.Clone();
         }
         //UPGRADE_NOTE: Exception 'java.lang.CloneNotSupportedException' was converted to 'System.Exception' which has different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1100'"
         catch (System.Exception e)
         {
             // TODO Auto-generated catch block
             SupportClass.WriteStackTrace(e, Console.Error);
         }
     }
 }