Exemple #1
0
        /// <summary>
        /// Convenience method for obtaining a PGF/TikZ
        /// document. Returns a string of PGF/TikZ that
        /// draws a specified set of rendering information
        /// in the SBML file of the path passed. The
        /// rendering may be replaced with SBGN default.
        /// </summary>
        /// <param name="filename">string indicating
        /// path of the SBML file</param>
        /// <param name="selectedLayoutNum">int indicating
        /// which set of rendering information to use</param>
        /// <param name="useSBGN">boolean indicating
        /// whether the layout should be replaced by
        /// SBGN default</param>
        /// <returns></returns>
        public static string ToTex(string filename, int selectedLayoutNum, Boolean useSBGN)
        {
            var conv = new Converter();

            conv.ReadFromSBML(filename, useSBGN);
            return(conv.WriteFromLayout(selectedLayoutNum));
        }
Exemple #2
0

        
Exemple #3
0
        static void Main(string[] args)
        {
            //if (args.Length < 1 || args.Length > 2)
            //{
            //    Console.WriteLine("Pass one or two arguments; the name of the SBML file and optionally, the output .tex file name");
            //    Environment.Exit(-1);
            //}

            //string fileName = args[0];
            //Converter conv = new Converter(fileName);
            //string outputFileName;
            //if (args.Length == 1)
            //{
            //    outputFileName = Path.Combine(Path.GetDirectoryName(fileName), Path.GetFileNameWithoutExtension(fileName) + ".tex");
            //}
            //else
            //{
            //    outputFileName = args[1];
            //}

            //using (StreamWriter writer = new StreamWriter(outputFileName))
            //{
            //    writer.WriteLine(conv.WriteFromLayout());
            //}

            //string fileName = "C:\\Users\\Si Yuan\\Desktop\\testcases\\CaMK-Activation.xml";
            string fileName = @"C:\Users\Si yuan\Documents\SBML Models\linear1.xml"; ;
            //string curDir = Directory.GetCurrentDirectory();
            //string fontdatafile = curDir + "\\Fonts.txt";

            Converter conv = new Converter(fileName, false);
            string outputFileName = @"C:\Users\Si yuan\Desktop\test.tex";
            using (StreamWriter writer = new StreamWriter(outputFileName))
            {
                writer.WriteLine(conv.WriteFromLayout());
            }
            //File.WriteAllBytes(outputFileName, conv.ToPDF());
        }
Exemple #4
0
        /// <summary>
        /// Convenience method for obtaining a PGF/TikZ
        /// document. Returns a string of PGF/TikZ that
        /// draws the first set of rendering information
        /// in the SBML file of the path passed.
        /// </summary>
        /// <param name="filename">string indicating path
        /// of the SBML file</param>
        /// <returns>string of PGF/TikZ commands</returns>
        public static string ToTex(string filename)
        {
            var conv = new Converter(filename);

            return(conv.WriteFromLayout());
        }
Exemple #5
0
 /// <summary>
 /// Convenience method for obtaining a PGF/TikZ
 /// document. Returns a string of PGF/TikZ that
 /// draws a specified set of rendering information
 /// in the SBML file of the path passed. The 
 /// rendering may be replaced with SBGN default.
 /// </summary>
 /// <param name="filename">string indicating
 /// path of the SBML file</param>
 /// <param name="selectedLayoutNum">int indicating
 /// which set of rendering information to use</param>
 /// <param name="useSBGN">boolean indicating 
 /// whether the layout should be replaced by 
 /// SBGN default</param>
 /// <returns></returns>
 public static string ToTex(string filename, int selectedLayoutNum, Boolean useSBGN)
 {
     var conv = new Converter();
     conv.ReadFromSBML(filename, useSBGN);
     return conv.WriteFromLayout(selectedLayoutNum);
 }
Exemple #6
0
 /// <summary>
 /// Convenience method for obtaining a PGF/TikZ 
 /// document. Returns a string of PGF/TikZ that 
 /// draws the first set of rendering information 
 /// in the SBML file of the path passed.
 /// </summary>
 /// <param name="filename">string indicating path 
 /// of the SBML file</param>
 /// <returns>string of PGF/TikZ commands</returns>
 public static string ToTex(string filename)
 {
     var conv = new Converter(filename);
     return conv.WriteFromLayout();
 }