private Bingo(Indigo indigo, int id, BingoLib lib) { _indigo = indigo; _lib = lib; _id = id; _dllLoader = IndigoDllLoader.Instance; }
internal BingoObject(int id, Indigo indigo, BingoLib bingo_lib) { this._id = id; this._indigo = indigo; this._bingoLib = bingo_lib; this._dllLoader = IndigoDllLoader.Instance; }
/// <summary> /// Perform search by molecular formula /// </summary> /// <param name="query">string with formula to search. For example, 'C22 H23 N3 O2'.</param> /// <param name="options">search options</param> /// <returns>Bingo search object instance</returns> public BingoObject searchMolFormula(string query, string options) { if (options == null) { options = ""; } _indigo.setSessionID(); return(new BingoObject(Bingo.checkResult(BingoLib.bingoSearchMolFormula(_id, query, options)), _indigo)); }
/// <summary> /// Perform exact search operation /// </summary> /// <param name="query">indigo object (molecule or reaction)</param> /// <param name="options">exact search options</param> /// <returns>Bingo search object instance</returns> public BingoObject searchExact(IndigoObject query, string options) { if (options == null) { options = ""; } _indigo.setSessionID(); return(new BingoObject(Bingo.checkResult(BingoLib.bingoSearchExact(_id, query.self, options)), _indigo)); }
/// <summary> /// </summary> public void Dispose() { if (_id >= 0 && _indigo != null) { _indigo.setSessionID(); Bingo.checkResult(BingoLib.bingoEndSearch(_id)); _id = -1; } }
/// <summary> /// Execute similarity search for most similar structures with external fingerprint /// </summary> /// <param name="query"> indigo object (molecule or reaction)</param> /// <param name="limit"> Number of structures</param> /// <param name="minSim"> Minimum similarity value</param> /// <param name="metric"> Default value is "tanimoto"</param> /// <param name="extFp"> Indigo object with a external similarity fingerprint (molecule or reaction)</param> /// <returns> Bingo search object instance</returns> public BingoObject searchSimTopNWithExtFP(IndigoObject query, int limit, float minSim, IndigoObject extFp, string metric) { if (metric == null) { metric = "tanimoto"; } _indigo.setSessionID(); return(new BingoObject(Bingo.checkResult(BingoLib.bingoSearchSimTopNWithExtFP(_id, query.self, limit, minSim, extFp.self, metric)), _indigo)); }
/// <summary> /// Dispose method that closes the database /// </summary> public void Dispose() { if (_id >= 0) { _indigo.setSessionID(); Bingo.checkResult(BingoLib.bingoCloseDatabase(_id)); _id = -1; } }
/// <summary> /// Execute similarity search operation /// </summary> /// <param name="query">indigo object (molecule or reaction)</param> /// <param name="min">Minimum similarity value</param> /// <param name="max">Maximum similairy value</param> /// <param name="ext_fp">Indigo object with a external similarity fingerprint</param> /// <param name="metric">Default value is "tanimoto"</param> /// <returns>Bingo search object instance</returns> public BingoObject searchSimWithExtFP(IndigoObject query, float min, float max, IndigoObject ext_fp, string metric) { if (metric == null) { metric = "tanimoto"; } _indigo.setSessionID(); return(new BingoObject(Bingo.checkResult(BingoLib.bingoSearchSimWithExtFP(_id, query.self, min, max, ext_fp.self, metric)), _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 = ""; } int databaseID = checkResult(BingoLib.bingoCreateDatabaseFile(location, type, options)); return(new Bingo(indigo, databaseID)); }
/// <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> /// Returns Bingo version /// </summary> /// <returns>Bingo version</returns> public string version() { _indigo.setSessionID(); return(checkResult(BingoLib.bingoVersion())); }
/// <summary> /// Returns an IndigoObject for the record with the specified id /// </summary> /// <param name="id">record id</param> /// <returns>Indigo object</returns> public IndigoObject getRecordById(int id) { _indigo.setSessionID(); return(new IndigoObject(_indigo, checkResult(BingoLib.bingoGetRecordObj(_id, id)))); }
/// <summary> /// Post-process index optimization /// </summary> public void optimize() { _indigo.setSessionID(); checkResult(BingoLib.bingoOptimize(_id)); }
/// <summary> /// Inserts a structure under a specified id /// </summary> /// <param name="record">Indigo object with a chemical structure (molecule or reaction)</param> /// <param name="id">record id</param> /// <returns> inserted record id</returns> public int insert(IndigoObject record, int id) { _indigo.setSessionID(); return(checkResult(BingoLib.bingoInsertRecordObjWithId(_id, record.self, id))); }
/// <summary> /// Execute enumerate id operation /// </summary> /// <returns>Bingo enumerate id object instance</returns> public BingoObject enumerateId() { _indigo.setSessionID(); return(new BingoObject(Bingo.checkResult(BingoLib.bingoEnumerateId(_id)), _indigo)); }
/// <summary> /// Delete a record by id /// </summary> /// <param name="id">Record id</param> public void delete(int id) { _indigo.setSessionID(); checkResult(BingoLib.bingoDeleteRecord(_id, id)); }
/// <summary> /// Inserts a structure under a specified id /// </summary> /// <param name="record">Indigo object with a chemical structure (molecule or reaction)</param> /// <param name="ext_fp">Indigo object with a external similarity fingerprint</param> /// <param name="id">record id</param> /// <returns> inserted record id</returns> public int insertWithExtFP(IndigoObject record, IndigoObject ext_fp, int id) { _indigo.setSessionID(); return(checkResult(BingoLib.bingoInsertRecordObjWithIdAndExtFP(_id, record.self, id, ext_fp.self))); }