예제 #1
0
        /// <summary>
        /// Format structure for output to SDFile
        /// </summary>
        /// <param name="molid"></param>

        void FormatSdfileStructure(
            MoleculeMx cs)
        {
            string molFile, cid;

            if (SS.I.RemoveLeadingZerosFromCids)             // normal formatting
            {
                cid = CompoundId.Format(CurrentKey);
            }
            else
            {
                cid = CurrentKey;              // just use internal formatting
            }
            cs      = cs.Convert(Rf.StructureFlags | MoleculeTransformationFlags.RemoveStructureCaption, cid);
            molFile = cs.GetMolfileString();

            if (molFile.IndexOf("\r") < 0)             // add carriage returns to molfile if it doesn't contain them
            {
                molFile = molFile.Replace("\n", "\r\n");
            }

            SdfLine = molFile;

            return;
        }