Beispiel #1
0
        public void TestLargeExample()
        {
            var filename = "NCDK.FaulonSignatures.Data.large_example.sdf";

            foreach (var molecule in MoleculeReader.ReadSDFFile(filename))
            {
                MoleculeSignature signature = new MoleculeSignature(molecule);
                Console.Out.WriteLine(signature.GetGraphSignature());
            }
        }
Beispiel #2
0
        public void TestSDF()
        {
            var filename = "NCDK.FaulonSignatures.Data.test.sdf";
            int molNr    = 0;

            foreach (var molecule in MoleculeReader.ReadSDFFile(filename))
            {
                Console.Out.WriteLine(++molNr);
                MoleculeSignature signature = new MoleculeSignature(molecule);
                Console.Out.WriteLine(signature.GetGraphSignature());
                //Console.Out.WriteLine(signature.GetVertexSignature(0));
            }
        }
Beispiel #3
0
        public void TestCanonicalLabelling()
        {
            var filename = "NCDK.FaulonSignatures.Data.multCycle.sdf";

            foreach (var molecule in MoleculeReader.ReadSDFFile(filename))
            {
                MoleculeSignature signature = new MoleculeSignature(molecule);
                Console.Out.WriteLine(molecule.GetAtomCount());
                Assert.AreEqual(false, signature.IsCanonicallyLabelled());
            }

            string filenameCanLabel = "NCDK.FaulonSignatures.Data.multCycleCanLabel.sdf";

            foreach (var molecule in MoleculeReader.ReadSDFFile(filenameCanLabel))
            {
                MoleculeSignature signatureCanLabel = new MoleculeSignature(molecule);
                Assert.AreEqual(true, signatureCanLabel.IsCanonicallyLabelled());
            }
        }
Beispiel #4
0
        public static void Main(string[] args)
        {
            if (args.Length < 1)
            {
                Console.Out.WriteLine("Usage : SDFToSignatures <filename>");
            }
            string filename = args[0];
            int    molCount = 0;

            foreach (var molecule in MoleculeReader.ReadSDFFile(filename))
            {
                try
                {
                    molCount++;
                    Console.Out.WriteLine("Current molecule: " + molCount);
                    MoleculeSignature signature = new MoleculeSignature(molecule);
                    // get graph signature
                    Console.Out.WriteLine(signature.GetGraphSignature());
                }
                catch (Exception) { }
            }
        }