public IndigoInchi(Indigo indigo) { String dllpath = indigo.getDllPath(); string libraryName; IndigoDllLoader dll_loader = IndigoDllLoader.Instance; switch (Environment.OSVersion.Platform) { case PlatformID.Win32NT: libraryName = "indigo-inchi.dll"; dll_loader.loadLibrary(dllpath, libraryName, "com.ggasoftware.indigo.Properties.ResourcesWin", false); break; case PlatformID.Unix: if (IndigoDllLoader.isMac()) { libraryName = "libindigo-inchi.dylib"; dll_loader.loadLibrary(dllpath, libraryName, "com.ggasoftware.indigo.Properties.ResourcesMac", false); } else { libraryName = "libindigo-inchi.so"; dll_loader.loadLibrary(dllpath, libraryName, "com.ggasoftware.indigo.Properties.ResourcesLinux", false); } break; default: throw new PlatformNotSupportedException(String.Format("Unsupported platform: {0}", Environment.OSVersion.Platform)); } _inchi_lib = dll_loader.getInterface <IndigoInchiLib> (libraryName); _indigo = indigo; }
internal BingoObject(int id, Indigo indigo, BingoLib bingo_lib) { this._id = id; this._indigo = indigo; this._bingoLib = bingo_lib; this._dllLoader = IndigoDllLoader.Instance; }
private Bingo(Indigo indigo, int id, BingoLib lib) { _indigo = indigo; _lib = lib; _id = id; _dllLoader = IndigoDllLoader.Instance; }
public IndigoObject(Indigo dispatcher, object parent, int id) { this.dispatcher = dispatcher; this.self = id; this.parent = parent; _indigo_lib = dispatcher._indigo_lib; }
public IndigoRenderer(Indigo indigo) { String dllpath = indigo.getDllPath (); string libraryName; IndigoDllLoader dll_loader = IndigoDllLoader.Instance; switch (Environment.OSVersion.Platform) { case PlatformID.Win32NT: libraryName = "indigo-renderer.dll"; dll_loader.loadLibrary (dllpath, libraryName, "com.ggasoftware.indigo.Properties.ResourcesWin", false); break; case PlatformID.Unix: if (IndigoDllLoader.isMac()) { libraryName = "libindigo-renderer.dylib"; dll_loader.loadLibrary (dllpath, libraryName, "com.ggasoftware.indigo.Properties.ResourcesMac", false); } else { libraryName = "libindigo-renderer.so"; dll_loader.loadLibrary (dllpath, libraryName, "com.ggasoftware.indigo.Properties.ResourcesLinux", false); } break; default: throw new PlatformNotSupportedException (String.Format ("Unsupported platform: {0}", Environment.OSVersion.Platform)); } _renderer_lib = dll_loader.getInterface<IndigoRendererLib> (libraryName); _indigo = indigo; }
public IndigoObject(Indigo dispatcher, int id, object parent) { this.dispatcher = dispatcher; this.self = id; this.parent = parent; _indigo_lib = dispatcher._indigo_lib; dll_loader = IndigoDllLoader.Instance; }
internal static string checkResult(Indigo indigo, string result) { if (result == null) { throw new BingoException(new String(indigo._indigo_lib.indigoGetLastError())); } return result; }
internal static float checkResult(Indigo indigo, float result) { if (result < 0.0) { throw new BingoException(new String(indigo._indigo_lib.indigoGetLastError())); } return result; }
internal static float checkResult(Indigo indigo, float result) { if (result < 0.0) { throw new BingoException(new String(indigo._indigo_lib.indigoGetLastError())); } return(result); }
internal static string checkResult(Indigo indigo, string result) { if (result == null) { throw new BingoException(new String(indigo._indigo_lib.indigoGetLastError())); } return(result); }
public IndigoRenderer(Indigo indigo) { String dllpath = indigo.getDllPath(); IndigoDllLoader dll_loader = IndigoDllLoader.Instance; dll_loader.loadLibrary(dllpath, "indigo-renderer.dll", "com.ggasoftware.indigo.Properties.Resources", false); _renderer_lib = dll_loader.getInterface<IndigoRendererLib>("indigo-renderer.dll"); _indigo = indigo; }
public IndigoInchi(Indigo indigo) { String dllpath = indigo.getDllPath(); IndigoDllLoader dll_loader = IndigoDllLoader.Instance; dll_loader.loadLibrary(dllpath, "indigo-inchi.dll", "com.ggasoftware.indigo.Properties.Resources", false); _inchi_lib = dll_loader.getInterface <IndigoInchiLib>("indigo-inchi.dll"); _indigo = indigo; }
/// <summary> /// Creates a chemical storage of a specifed type in a specified location /// </summary> /// <param name="indigo">Indigo instance</param> /// <param name="location">Directory with the files location</param> /// <param name="type">"molecule" or "reaction"</param> /// <param name="options">Additional options separated with a semicolon. See the Bingo documentation for more details.</param> /// <returns>Bingo database instance</returns> public static Bingo createDatabaseFile(Indigo indigo, string location, string type, string options) { indigo.setSessionID(); if (options == null) { options = ""; } BingoLib lib = Bingo.getLib(indigo); int databaseID = Bingo.checkResult(indigo, lib.bingoCreateDatabaseFile(location, type, options)); return(new Bingo(indigo, databaseID, lib)); }
public void removeAtoms(ICollection vertices) { removeAtoms(Indigo.toIntArray(vertices)); }
public IndigoChemistryDepiction(Indigo _indigo) { indigo = _indigo; renderer = new IndigoRenderer(indigo); }
private static void _handleError(sbyte* message, Indigo self) { throw new IndigoException(new String(message)); }
/// <summary> /// Creates a chemical storage of a specifed type in a specified location /// </summary> /// <param name="indigo">Indigo instance</param> /// <param name="location">Directory with the files location</param> /// <param name="type">"molecule" or "reaction"</param> /// <returns>Bingo database instance</returns> public static Bingo createDatabaseFile(Indigo indigo, string location, string type) { return createDatabaseFile(indigo, location, type, null); }
/// <summary> /// Loads a chemical storage of a specifed type from a specified location /// </summary> /// <param name="indigo">Indigo instance</param> /// <param name="location">Directory with the files location</param> /// <param name="options">Additional options separated with a semicolon. See the Bingo documentation for more details.</param> /// <returns>Bingo database instance</returns> public static Bingo loadDatabaseFile(Indigo indigo, string location, string options) { if (options == null) { options = ""; } BingoLib lib = Bingo.getLib(indigo); indigo.setSessionID(); int databaseID = Bingo.checkResult(indigo, lib.bingoLoadDatabaseFile(location, options)); return new Bingo(indigo, databaseID, lib); }
/// <summary> /// Loads a chemical storage of a specifed type from a specified location /// </summary> /// <param name="indigo">Indigo instance</param> /// <param name="location">Directory with the files location</param> /// <returns>Bingo database instance</returns> public static Bingo loadDatabaseFile(Indigo indigo, string location) { return loadDatabaseFile(indigo, location, null); }
/// <summary> /// Loads a chemical storage of a specifed type from a specified location /// </summary> /// <param name="indigo">Indigo instance</param> /// <param name="location">Directory with the files location</param> /// <returns>Bingo database instance</returns> public static Bingo loadDatabaseFile(Indigo indigo, string location) { return(loadDatabaseFile(indigo, location, null)); }
/// <summary> /// Creates a chemical storage of a specifed type in a specified location /// </summary> /// <param name="indigo">Indigo instance</param> /// <param name="location">Directory with the files location</param> /// <param name="type">"molecule" or "reaction"</param> /// <returns>Bingo database instance</returns> public static Bingo createDatabaseFile(Indigo indigo, string location, string type) { return(createDatabaseFile(indigo, location, type, null)); }
public IndigoObject addDataSGroup(ICollection atoms, ICollection bonds, String description, String data) { return(addDataSGroup(Indigo.toIntArray(atoms), Indigo.toIntArray(bonds), description, data)); }
public IndigoObject addSuperatom(ICollection atoms, String name) { return(addSuperatom(Indigo.toIntArray(atoms), name)); }
public IndigoObject(Indigo dispatcher, int id) : this(dispatcher, id, null) { dll_loader = IndigoDllLoader.Instance; }
private static void _handleError(sbyte *message, Indigo self) { throw new IndigoException(new String(message)); }
public ChemHasseFingerprint(Indigo _indigo, BitArray _fp) { indigo = _indigo; fp = _fp; base.bitCount = base.CountBits(); }
static void Main(string[] args) { Indigo indigo = new Indigo(); // By default Bingo loads a database and stores all the data in RAM for faster operations // But if the application is limited in the memory usage Bingo can work // in a file mode with loading only minor parts of data into the memory Bingo database = Bingo.createDatabaseFile(indigo, "db1", "molecule", "storage:file"); // Insert structures from the file using (IndigoObject input = indigo.iterateSmilesFile("input.smi")) foreach (IndigoObject obj in input) { Console.WriteLine(" Object: {0}", obj.name()); // When loading from SMILES the only information that we have is an object name // that is stored on the same line with the SMILES in the file int id = int.Parse(obj.name()); // Insert loaded object into the database database.insert(obj, id); // Dispose native Indigo object as .NET object is much smaller than native object // and GC can postpone disposing of this object resulting in a large memory // consumption obj.Dispose(); } // Bingo can also assign structure ID automatically int autoId1 = database.insert(indigo.loadMolecule("OC1C(C(=O)O)=CC=CC1O")); Console.WriteLine("Automatic id = {0}", autoId1); int autoId2 = database.insert(indigo.loadMolecule("OC1C(C(=O)O)=CC=CC1O")); Console.WriteLine("Automatic id = {0}", autoId2); // Search over the database Console.WriteLine("Search Benzene:"); IndigoObject query = indigo.loadQueryMolecule("C1=CC=CC=C1"); BingoObject search = database.searchSub(query); while (search.next()) Console.WriteLine(" Found id = {0}", search.getCurrentId()); // You can close and reopen database at any moment database.close(); // Load Bingo in a RAM mode with caching all data into the memory // Search operations works faster in this mode database = Bingo.loadDatabaseFile(indigo, "db1", "molecule", "storage:ram"); // Search the same query but in the aromatic form // Results are the same Console.WriteLine("Search Benzene in the aromatic form:"); query = indigo.loadQueryMolecule("c1ccccc1"); search = database.searchSub(query); while (search.next()) Console.WriteLine(" Found id = {0}", search.getCurrentId()); Console.WriteLine("Search C=O"); query = indigo.loadQueryMolecule("C=O"); // Using block will automatically call search.Dispose() that calls search.close() // to terminate further search using (search = database.searchSub(query)) { int count = 0; while (search.next()) { Console.WriteLine(" Found id = {0}", search.getCurrentId()); count++; if (count == 4) break; } } // Similarity search Console.WriteLine("Similarity search:"); query = indigo.loadMolecule("NC1C=CC=C(C1O)C(O)=O"); search = database.searchSim(query, 0.7f, 1.0f); while (search.next()) Console.WriteLine(" Found id = {0}", search.getCurrentId()); // Database will be closed automatically in the object destructor // but we can close it manually to dispose memory database.close(); }
public IndigoObject getSubmolecule(ICollection vertices) { return(getSubmolecule(Indigo.toIntArray(vertices))); }
public ChemHasseFingerprint(Indigo _indigo) { indigo = _indigo; }
public IndigoObject(Indigo dispatcher, int id) : this(dispatcher, null, id) { }
public float alignAtoms(ICollection atom_ids, ICollection desired_xyz) { return(alignAtoms(Indigo.toIntArray(atom_ids), Indigo.toFloatArray(desired_xyz))); }