예제 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="interfaceRow"></param>
        private void ReverseInterfaceRowInDb(DataRow interfaceRow)
        {
            object tempObj = interfaceRow["AsymChain1"];

            interfaceRow["AsymChain1"] = interfaceRow["AsymChain2"];
            interfaceRow["AsymChain2"] = tempObj;

            tempObj = interfaceRow["AuthChain1"];
            interfaceRow["AuthChain1"] = interfaceRow["AuthChain2"];
            interfaceRow["AuthChain2"] = tempObj;

            tempObj = interfaceRow["EntityID1"];
            interfaceRow["EntityID1"] = interfaceRow["EntityID2"];
            interfaceRow["EntityID2"] = tempObj;

            tempObj = interfaceRow["SymmetryString1"];
            interfaceRow["SymmetryString1"] = interfaceRow["SymmetryString2"];
            interfaceRow["SymmetryString2"] = tempObj;

            tempObj = interfaceRow["FullSymmetryString1"];
            interfaceRow["FullSymmetryString1"] = interfaceRow["FullSymmetryString2"];
            interfaceRow["FullSymmetryString2"] = tempObj;

            DeleteEntryInterface(interfaceRow["PdbID"].ToString(), Convert.ToInt32(interfaceRow["InterfaceID"].ToString()));
            dbInsert.InsertDataIntoDb(ProtCidSettings.protcidDbConnection, interfaceRow);
        }
예제 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="dataFile"></param>
        private void ParseBuDomainInterfaceCompFile(string dataFile, DataRow dataRow)
        {
            StreamReader dataReader = new StreamReader(dataFile);
            string       line       = "";

            while ((line = dataReader.ReadLine()) != null)
            {
                string[] fields = line.Split(',');
                dataRow.ItemArray = fields;
                dbInsert.InsertDataIntoDb(ProtCidSettings.buCompConnection, dataRow);
            }
            dataReader.Close();
        }
예제 #3
0
        public void ParseDBInsertLogFile(string fileName, DbConnect dbConnect)
        {
            DbInsert     dbInsert   = new DbInsert();
            StreamReader dataReader = new StreamReader(fileName);
            string       line       = "";

            while ((line = dataReader.ReadLine()) != null)
            {
                if (line.ToUpper().IndexOf("INSERT INTO") > -1)
                {
                    dbInsert.InsertDataIntoDb(dbConnect, line);
                }
            }
            dataReader.Close();
        }
예제 #4
0
        /// <summary>
        /// update asymmetric unit db table
        /// </summary>
        /// <param name="thisEntryCrystal"></param>
        private void UpdateAsymUnitDbTable(EntryCrystal thisEntryCrystal)
        {
            string queryString = string.Format("Select * From AsymUnit Where PdbID = '{0}' AND PolymerType = 'polypeptide';",
                                               thisEntryCrystal.PdbId);
            DataTable asuTable = ProtCidSettings.pdbfamQuery.Query(queryString);

            asuTable.TableName = "AsymUnit";
            foreach (ChainAtoms chain in thisEntryCrystal.atomCat.ChainAtomList)
            {
                DataRow[] existRows = asuTable.Select(string.Format("PdbID = '{0}' AND AsymID = '{1}'",
                                                                    thisEntryCrystal.PdbId, chain.AsymChain));
                if (existRows.Length > 0)
                {
                    continue;
                }
                DataRow[] existEntityRows = asuTable.Select(string.Format("PdbID = '{0}' AND EntityID = '{1}'",
                                                                          thisEntryCrystal.PdbId, chain.EntityID));
                existEntityRows[0]["AsymID"] = chain.AsymChain;
                dbInsert.InsertDataIntoDb(ProtCidSettings.pdbfamDbConnection, existEntityRows[0]);
            }
        }
예제 #5
0
        public void InsertCrystInterfaceDataDueInsertBug()
        {
            DbInsert     dbInsert       = new DbInsert();
            DbQuery      dbQuery        = new DbQuery();
            StreamWriter logWriter      = new StreamWriter("MissCrystEntryInterfaceLog.txt");
            string       queryString    = "Select First 1 * From CrystEntryInterfaces;";
            DataTable    interfaceTable = ProtCidSettings.protcidQuery.Query(queryString);

            interfaceTable.Clear();
            interfaceTable.TableName = "CrystEntryInterfaces";
            StreamReader dataReader = new StreamReader("dbInsertErrorLog.txt");
            string       line       = "";

            while ((line = dataReader.ReadLine()) != null)
            {
                if (line.IndexOf("EXECUTE BLOCK AS BEGIN") > -1)
                {
                    line = line.Remove(0, "EXECUTE BLOCK AS BEGIN".Length + 1);
                    line = line.Replace("END", "");
                    string[] insertFields = line.Split(';');
                    foreach (string insertString in insertFields)
                    {
                        try
                        {
                            dbInsert.InsertDataIntoDb(ProtCidSettings.protcidDbConnection, insertString);
                        }
                        catch (Exception ex)
                        {
                            logWriter.WriteLine(ex.Message);
                            logWriter.WriteLine(insertString);
                            logWriter.Flush();
                        }
                    }
                }
            }
            dataReader.Close();
            logWriter.Close();
        }