static INativeMolMx GetCdkMolInstance() { if (i == null) // get instance if not done yet i = CdkMolFactory.NewCdkMol(); return i; }
/// <summary> /// Set substructure search query molecule /// </summary> /// <param name="cs"></param> public void SetSSSQueryMolecule( MoleculeMx cs) { QueryMol = cs.Clone(); SSSQueryMol = CdkMolFactory.NewCdkMol(cs); CdkMolUtil.SetSSSQueryMolecule(SSSQueryMol); return; }
/// <summary> /// Do a SSS using the predefined query molecule and supplied target molecule /// </summary> /// <returns></returns> public bool IsSSSMatch(MoleculeMx cs) { if (QueryMol == null || cs.IsBiopolymerFormat) // fix later { return(false); } TargetMol = cs; SSSTargetMol = CdkMolFactory.NewCdkMol(cs); bool b = CdkMolUtil.IsSSSMatch(SSSTargetMol); return(b); }
/// <summary> /// Set full structure search query molecule /// </summary> /// <param name="cs"></param> public void SetFSSQueryMolecule( MoleculeMx cs) { if (cs.IsBiopolymerFormat) // fix later { QueryMol = cs; return; } QueryMol = cs.Clone(); FSSQueryMol = CdkMolFactory.NewCdkMol(cs); CdkMolUtil.SetFSSQueryMolecule(FSSQueryMol); return; }
/// <summary> /// Perform a substructure search /// </summary> /// <param name="query"></param> /// <param name="target"></param> /// <returns></returns> public bool IsSSSMatch( MoleculeMx query, MoleculeMx target) { if (query.IsBiopolymerFormat || target.IsBiopolymerFormat) // fix later { return(false); } QueryMol = query; SSSQueryMol = CdkMolFactory.NewCdkMol(query); SSSTargetMol = CdkMolFactory.NewCdkMol(target); bool b = CdkMolUtil.IsSSSMatch(SSSQueryMol, SSSTargetMol); return(b); }
/// <summary> /// Do a SSS using the predefined query molecule and supplied target molecule /// </summary> /// <returns></returns> public bool IsFSSMatch(MoleculeMx cs) { if (MoleculeMx.IsUndefined(QueryMol) || MoleculeMx.IsUndefined(cs)) { return(false); } if (cs.IsBiopolymerFormat) { return(IsFSSMatch(QueryMol, cs)); } TargetMol = cs; FSSTargetMol = CdkMolFactory.NewCdkMol(cs); bool b = CdkMolUtil.IsFSSMatch(FSSTargetMol); return(b); }
/// <summary> /// Do a similarity match /// </summary> /// <param name="query"></param> /// <param name="target"></param> /// <returns></returns> public bool FullStructureMatch( MoleculeMx query, MoleculeMx target, string switches) { bool newQuery = (QueryMol == null || QueryMol.PrimaryValue != query.PrimaryValue); if (newQuery) { QueryMol = query.Clone(); SSSQueryMol = CdkMolFactory.NewCdkMol(query); } SSSTargetMol = CdkMolFactory.NewCdkMol(target); bool b = CdkMolUtil.FullStructureMatch(SSSQueryMol, SSSTargetMol, switches); return(b); }