public FunctionalGroupEditor(ChemInfo.FunctionalGroupCollection groups)
 {
     InitializeComponent();
     fGroupColl = groups;
     fGroupEnum = groups.GetEnumerator();
     fGroupEnum.MoveNext();
     //while (fGroupEnum.Current.Name != "TRIAZOLE") fGroupEnum.MoveNext();
 }
Esempio n. 2
0
        public Form1()
        {
            InitializeComponent();
            //System.Data.SQLite.SQLiteConnection.CreateFile("MyDatabase.sqlite");

            m_dbConnection = new System.Data.SQLite.SQLiteConnection("Data Source=..\\..\\Data\\SustainableChemistry.sqlite;Version=3;");
            m_dbConnection.Open();

            FunctionalGroups     = new DataTable();
            NamedReactions       = new DataTable();
            molecule             = new ChemInfo.Molecule();
            fGroups              = new ChemInfo.FunctionalGroupCollection();
            reactions            = new ChemInfo.NamedReactionCollection();
            this.trackBar1.Value = (int)(this.moleculeViewer1.Zoom * 100);
            documentPath         = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\USEPA\\SustainableChemistry";

            this.OpenFunctionGroupExcelResource();

            System.IO.FileStream fs = new System.IO.FileStream("..\\..\\Data\\references.dat", System.IO.FileMode.Open);

            // Construct a BinaryFormatter and use it to serialize the data to the stream.
            System.Runtime.Serialization.Formatters.Binary.BinaryFormatter formatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
            try
            {
                m_References = (ChemInfo.References)formatter.Deserialize(fs);
            }
            catch (System.Runtime.Serialization.SerializationException e)
            {
                Console.WriteLine("Failed to deserialize. Reason: " + e.Message);
                throw;
            }
            finally
            {
                fs.Close();
            }


            //Reads in functional groups from JSON file. This should be used after Excel file is completed.
            //var json = new System.Web.Script.Serialization.JavaScriptSerializer();
            //functionalGroups = (List<ChemInfo.FunctionalGroup>)json.Deserialize(ChemInfo.Functionalities.AvailableFunctionalGroups(), typeof(List<ChemInfo.FunctionalGroup>));            // string text = ChemInfo.Functionalities.FunctionalGroups("P(c1ccccc1)(c1ccccc1)(N)=O", "json");

            // Test code for generating a results file from a functional group name.
            //Results res = new Results("phosphoramidite", m_References);
            //string results = json.Serialize(res);

            // Initial code to load references from text RIS resource files. Can be deleted when done.
            //m_References = new ChemInfo.References();
            //m_References.Add(new ChemInfo.Reference("phosphoramidite", "Diisoproprylethyamine Solvent", enc8.GetString(Properties.Resources.S0040403900813763)));
            //m_References.Add(new ChemInfo.Reference("phosphoramidite", "Diisoproprylethyamine Solvent", enc8.GetString(Properties.Resources.S0040403900942163)));
            //m_References.Add(new ChemInfo.Reference("phosphoramidite", "Diisoproprylethyamine Solvent", enc8.GetString(Properties.Resources.S0040403901904617)));
            //m_References.Add(new ChemInfo.Reference("phosphoramidite", "Diisoproprylethyamine Solvent", enc8.GetString(Properties.Resources.achs_jacsat105_661)));
            //m_References.Add(new ChemInfo.Reference("phosphate", "No Name", enc8.GetString(Properties.Resources.S1001841712003142)));
            //m_References.Add(new ChemInfo.Reference("phosphate", "Catalyst", Properties.Resources._10_1002_2Fchin_199605199));
            //m_References.Add(new ChemInfo.Reference("phosphoramidite", "Catalyst Solvent", enc8.GetString(Properties.Resources.europepmc)));
            //m_References.Add(new ChemInfo.Reference("phosphoramidite", "Catalyst Solvent", enc8.GetString(Properties.Resources.europepmc1)));
            //m_References.Add(new ChemInfo.Reference("phosphoramidite", "Catalyst Solvent", enc8.GetString(Properties.Resources.achs_oprdfk4_175)));
            //m_References.Add(new ChemInfo.Reference("phosphoramidite", "Catalyst Solvent", enc8.GetString(Properties.Resources.BIB)));
        }
 public ReactionEditor(ChemInfo.FunctionalGroupCollection fGroups)
 {
     InitializeComponent();
     molecule = null;
     this.m_FunctionalGroups = fGroups;
     this.productComboBox.Items.AddRange(m_FunctionalGroups.FunctionalGroups);
     reactantAComboBox.Items.AddRange(ChemInfo.Reactants.ReactantList);
     reactantBComboBox.Items.AddRange(ChemInfo.Reactants.ReactantList);
     this.linkLabel1.Text = string.Empty;
 }
        public DSSToxChemicals(string newChem)
        {
            string[] parts = newChem.Split('\t');
            float    id    = 0;

            float.TryParse(parts[0], out id);
            ToxCast_chid        = (int)id;
            DSSTox_Substance_Id = parts[1];
            DSSTox_Structure_Id = parts[2];
            DSSTox_QC_Level     = parts[3];
            Substance_Name      = parts[4];
            Substance_CASRN     = parts[5];
            Substance_Type      = parts[6];
            Substance_Note      = parts[7];
            if (parts.Length > 8)
            {
                Structure_SMILES = parts[8];
            }
            if (parts.Length > 9)
            {
                Structure_InChI = parts[9];
            }
            if (parts.Length > 10)
            {
                Structure_InChIKey = parts[10];
            }
            if (parts.Length > 11)
            {
                Structure_Formula = parts[11];
            }
            if (parts.Length > 12)
            {
                Structure_MolWt = parts[12];
            }
            m_FunctionalGroups = new ChemInfo.FunctionalGroupCollection();
        }
 public DSSToxChemicals()
 {
     m_FunctionalGroups = new ChemInfo.FunctionalGroupCollection();
 }
Esempio n. 6
0
 public FunctionalGroupViewer(ChemInfo.FunctionalGroupCollection groups)
 {
     InitializeComponent();
     m_FunctGroups = groups;
     this.comboBox1.Items.AddRange(m_FunctGroups.FunctionalGroups);
 }