/// <summary> /// Get molecule string in correct format /// </summary> /// <param name="vo"></param> /// <param name="structureExportFormat"></param> /// <returns></returns> string GetMoleculeString( object vo, ExportStructureFormat structureExportFormat) { string molString = ""; MoleculeMx cs = (MoleculeMx)vo; if (structureExportFormat == ExportStructureFormat.Chime) { molString = cs.GetChimeString(); // save structure as Chime } else if (structureExportFormat == ExportStructureFormat.Smiles) { molString = cs.GetSmilesString(); // save structure as Smiles } else if (structureExportFormat == ExportStructureFormat.Molfile) { molString = cs.GetMolfileString(); // save structure as molfile } else // save structure as molfile as default { molString = cs.GetMolfileString(); } return(molString); }
/// <summary> /// Map query against structure & return highlighted match /// </summary> /// <param name="cs"></param> /// <returns></returns> public MoleculeMx HighlightMatchingSubstructure( MoleculeMx cs) { if (cs.IsBiopolymerFormat) // fix later { return(cs); } MoleculeMx cs2 = null; PerformanceTimer pt = PT.Start("HighlightMatchingSubstructure"); string molfile = CdkMolUtil.HilightSSSMatch(cs.GetMolfileString()); cs2 = new MoleculeMx(MoleculeFormat.Molfile, molfile); pt.Update(); return(cs2); }
/// <summary> /// Align supplied structure to query structure /// </summary> /// <param name="skid"></param> /// <returns></returns> public MoleculeMx AlignToMatchingSubstructure( MoleculeMx target) { if (target.IsBiopolymerFormat) // fix later { return(target); } MoleculeMx cs2 = null; PerformanceTimer pt = PT.Start("AlignToMatchingSubstructure"); Stopwatch sw = Stopwatch.StartNew(); string molfile = CdkMolUtil.OrientToMatchingSubstructure(target.GetMolfileString()); cs2 = new MoleculeMx(MoleculeFormat.Molfile, molfile); pt.Update(); return(cs2); }