Created
December 15, 2008 10:21
-
-
Save mesprague/35921 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using OpenBabel; | |
namespace OBDotNetExamples | |
{ | |
class Program1 | |
{ | |
static void Main(string[] args) | |
{ | |
OBConversion obc = new OBConversion(); | |
//set the input format to sdf | |
obc.SetInFormat("sdf"); | |
//set the output format to smiles | |
obc.SetOutFormat("smi"); | |
OBMol mol = new OBMol(); | |
//try to read the first mol | |
//this initalizes the OBConversion | |
obc.ReadFile(mol,"someMols.mol"); | |
//try to read the rest of the structures | |
//and print the smiles string and source file name | |
while (obc.Read(mol)) | |
{ | |
Console.WriteLine(obc.WriteString(mol)); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment