Example #1
0
        /// <summary>
        ///
        /// </summary>
        private void InitializeResiduesContactsTables()
        {
            DbCreator dbCreator = new DbCreator();

            string tableName         = "SgInterfaceResidues";
            string createTableString = "CREATE TABLE " + tableName + " ( " +
                                       "PDBID        CHAR(4) NOT NULL, " +
                                       "INTERFACEID  INTEGER NOT NULL, " +
                                       "RESIDUE1     CHAR(3) NOT NULL, " +
                                       "SEQID1       CHAR(5) NOT NULL,  " +
                                       "RESIDUE2     CHAR(3) NOT NULL, " +
                                       "SEQID2       CHAR(5) NOT NULL, " +
                                       "DISTANCE     FLOAT NOT NULL);";

            dbCreator.CreateTableFromString(ProtCidSettings.protcidDbConnection, createTableString, tableName);
            string createIdxString = string.Format("CREATE INDEX {0}_Idx1 ON {0} (PdbID, InterfaceID);", tableName);

            dbCreator.CreateIndex(ProtCidSettings.protcidDbConnection, createIdxString, tableName);


            tableName         = "SgInterfaceContacts";
            createTableString = "CREATE TABLE " + tableName + " ( " +
                                "PDBID        CHAR(4) NOT NULL, " +
                                "INTERFACEID  INTEGER NOT NULL, " +
                                "RESIDUE1     CHAR(3) NOT NULL, " +
                                "SEQID1       CHAR(5) NOT NULL,  " +
                                "RESIDUE2     CHAR(3) NOT NULL, " +
                                "SEQID2       CHAR(5) NOT NULL, " +
                                "DISTANCE     FLOAT NOT NULL);";
            dbCreator.CreateTableFromString(ProtCidSettings.protcidDbConnection, createTableString, tableName);
            createIdxString = string.Format("CREATE INDEX {0}_Idx1 ON {0} (PdbID, InterfaceID);", tableName);
            dbCreator.CreateIndex(ProtCidSettings.protcidDbConnection, createIdxString, tableName);
        }
        /// <summary>
        ///
        /// </summary>
        private void InitializeDbTables()
        {
            DbCreator dbCreate = new DbCreator();

            if (dbCreate.IsTableExist(ProtCidSettings.protcidDbConnection, crystBuInterfaceCompTables[(int)BuType.PDB].TableName))
            {
                return;
            }
            string createTableString = string.Format("Create Table {0} ( " +
                                                     "PdbID CHAR(4) NOT NULL, InterfaceId INTEGER NOT NULL, " +
                                                     "BuID VARCHAR(8), BuInterfaceID INTEGER, QScore FLOAT);",
                                                     crystBuInterfaceCompTables[(int)BuType.PDB].TableName);

            dbCreate.CreateTableFromString(ProtCidSettings.protcidDbConnection, createTableString, crystBuInterfaceCompTables[(int)BuType.PDB].TableName);

            string indexString = string.Format("Create INDEX {0}_Idx1 " +
                                               " ON {0} (PdbID, InterfaceID);", crystBuInterfaceCompTables[(int)BuType.PDB].TableName);

            dbCreate.CreateIndex(ProtCidSettings.protcidDbConnection, indexString, crystBuInterfaceCompTables[(int)BuType.PDB].TableName);


            createTableString = string.Format("Create Table {0} ( " +
                                              "PdbID CHAR(4) NOT NULL, InterfaceId INTEGER NOT NULL, " +
                                              "BuID VARCHAR(8), BuInterfaceID INTEGER, QScore FLOAT);",
                                              crystBuInterfaceCompTables[(int)BuType.PISA].TableName);
            dbCreate.CreateTableFromString(ProtCidSettings.protcidDbConnection, createTableString, crystBuInterfaceCompTables[(int)BuType.PISA].TableName);

            indexString = string.Format("Create INDEX {0}_Idx1 " +
                                        " ON {0} (PdbID, InterfaceID);", crystBuInterfaceCompTables[(int)BuType.PISA].TableName);
            dbCreate.CreateIndex(ProtCidSettings.protcidDbConnection, indexString, crystBuInterfaceCompTables[(int)BuType.PISA].TableName);
        }
Example #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="isUpdate"></param>
        private void CreateTables(bool isUpdate)
        {
            pfamLigandClusterTable = new DataTable(tableName);
            string[] clusterCols = { "PfamID", "ClusterID", "PdbID", "ChainDomainID", "LigandChain", "LigandFileChain" };
            foreach (string col in clusterCols)
            {
                pfamLigandClusterTable.Columns.Add(new DataColumn(col));
            }

            if (!isUpdate)
            {
                DbCreator dbCreate          = new DbCreator();
                string    createTableString = "Create Table " + tableName + " ( " +
                                              "PfamID varchar(40) NOT NULL, " +
                                              "ClusterID Integer NOT NULL, " +
                                              "PdbID char(4) Not Null, " +
                                              "ChainDomainID Integer Not Null, " +
                                              "LigandChain char(3) Not Null, " +
                                              "LigandFileChain char(3) Not Null);";
                dbCreate.CreateTableFromString(ProtCidSettings.protcidDbConnection, createTableString, tableName);
                string createIndexString = "Create Index " + tableName + "_cluster ON " + tableName + "(PfamID, ClusterID);";
                dbCreate.CreateIndex(ProtCidSettings.protcidDbConnection, createIndexString, tableName);
                createIndexString = "Create Index " + tableName + "_pdb ON " + tableName + "(PdbID, ChainDomainID);";
                dbCreate.CreateIndex(ProtCidSettings.protcidDbConnection, createIndexString, tableName);
            }
        }
Example #4
0
        /// <summary>
        ///
        /// </summary>
        public static void InitializeGroupTable()
        {
            DbCreator dbCreator         = new DbCreator();
            string    createTableString = "";
            string    createIndexString = "";
            string    tableName         = ProtCidSettings.dataType + "HomoSeqInfo";

            createTableString = "CREATE TABLE " + tableName + " ( " +
                                "GroupSeqID INTEGER NOT NULL, " +
                                "PdbID CHAR(4) NOT NULL, " +
                                "SpaceGroup VARCHAR(30) NOT NULL, " +
                                "ASU VARCHAR(50) NOT NULL, " +
                                "Method VARCHAR(100) NOT NULL, " +
                                "Resolution FLOAT NOT NULL, " +
                                "InPfam CHAR NOT NULL);";
            dbCreator.CreateTableFromString(ProtCidSettings.protcidDbConnection, createTableString, tableName);
            createIndexString = string.Format("CREATE INDEX {0}_idx1 ON {0} (GroupSeqID);", tableName);
            dbCreator.CreateIndex(ProtCidSettings.protcidDbConnection, createIndexString, tableName);
            createIndexString = string.Format("CREATE INDEX {0}_idx2 ON {0} (PdbID);", tableName);
            dbCreator.CreateIndex(ProtCidSettings.protcidDbConnection, createIndexString, tableName);

            tableName         = ProtCidSettings.dataType + "Groups";
            createTableString = "CREATE TABLE " + tableName + " ( " +
                                "GroupSeqID INTEGER NOT NULL, " +
                                "EntryPfamArch BLOB Sub_Type TEXT NOT NULL);";
            dbCreator.CreateTableFromString(ProtCidSettings.protcidDbConnection, createTableString, tableName);
            createIndexString = string.Format("CREATE INDEX {0}_idx1 ON {0} (GroupSeqID);", tableName);
            dbCreator.CreateIndex(ProtCidSettings.protcidDbConnection, createIndexString, tableName);
        }
Example #5
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="isUpdate"></param>
        private void CreateTables(bool isUpdate)
        {
            InitializeComHmmTable();

            if (! isUpdate)
            {
                DbCreator dbCreate = new DbCreator ();
                 string dbCreateTableString = "Create Table " + tableName + " ( " +
                    "PfamID Varchar(40) Not Null, " +
                    "PdbID1 char(4) Not Null, " +
                    "ChainDomainID1 Integer Not Null, " +
                    "LigandChain1 char(3) Not Null, " +
                    "PdbID2 char(4) Not Null, " +
                    "ChainDomainID2 Integer Not Null, " +
                    "LigandChain2 char(3) Not Null, " +
                    "NumOfHmmSites1 Integer Not Null, " +
                    "NumOfHmmSites2 Integer Not Null, " +
                    "NumOfComHmmSites Integer Not Null, " +
                    "Jscore FLOAT Not Null);";
                dbCreate.CreateTableFromString(ProtCidSettings.protcidDbConnection, dbCreateTableString, tableName);
                string indexString = "Create Index PfamLigandComHmm_pfam on " + tableName + " (PfamID)";
                dbCreate.CreateIndex(ProtCidSettings.protcidDbConnection, indexString, tableName);
                indexString = "Create Index PfamLigandComHmm_pdb on " + tableName + "(PdbID1, PdbID2)";
                dbCreate.CreateIndex(ProtCidSettings.protcidDbConnection, indexString, tableName);
                indexString = "Create Index PfamLigandComHmm_pdb1 on " + tableName + "(PdbID1, ChainDomainID1)";
                dbCreate.CreateIndex(ProtCidSettings.protcidDbConnection, indexString, tableName);
                indexString = "Create Index PfamLigandComHmm_pdb2 on " + tableName + "(PdbID2, ChainDomainID2)";
                dbCreate.CreateIndex(ProtCidSettings.protcidDbConnection, indexString, tableName);
            }
        }
Example #6
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="isUpdate"></param>
        private void InitializeTables(bool isUpdate)
        {
            string tableName = "PdbPfamDomainFileInfo";

            string[] tableCols = { "PdbID", "DomainID", "EntityID", "AsymChain", "SeqStart", "SeqEnd", "FileStart", "FileEnd" };
            domainFileInfoTable = new DataTable(tableName);
            foreach (string col in tableCols)
            {
                domainFileInfoTable.Columns.Add(new DataColumn(col));
            }

            if (!isUpdate)
            {
                DbCreator dbCreate          = new DbCreator();
                string    createTableString = "CREATE TABLE " + tableName + " ( " +
                                              "PdbID CHAR(4) NOT NULL, " +
                                              "DomainID BIGINT NOT NULL, " +
                                              "EntityID INTEGER NOT NULL, " +
                                              "AsymChain CHAR(3) NOT NULL, " +
                                              "SeqStart INTEGER NOT NULL, " +
                                              "SeqEnd INTEGER NOT NULL, " +
                                              "FileStart INTEGER NOT NULL, " +
                                              "FileEnd INTEGER NOT NULL );";
                dbCreate.CreateTableFromString(createTableString, tableName);
                string createIndexString = "CREATE INDEX " + tableName + "_idx1 ON " + tableName + "(PdbID);";
                dbCreate.CreateIndex(createIndexString, tableName);
                createIndexString = "CREATE INDEX " + tableName + "_idx2 ON " + tableName + "(DomainID);";
                dbCreate.CreateIndex(createIndexString, tableName);
            }
        }
Example #7
0
        private void InitializeDbTable()
        {
            DbCreator dbCreat           = new DbCreator();
            string    createTableString = string.Format("CREATE TABLE {0} ( " +
                                                        " GroupSeqID INTEGER NOT NULL, " +
                                                        " CfGroupID INTEGER NOT NULL, " +
                                                        " PdbID CHAR(4) NOT NULL, " +
                                                        " SpaceGroup VARCHAR(30) NOT NULL, " +
                                                        " ASU VARCHAR(255) NOT NULL);",
                                                        GroupDbTableNames.dbTableNames[GroupDbTableNames.NonredundantCfGroups]);

            dbCreat.CreateTableFromString(ProtCidSettings.protcidDbConnection, createTableString,
                                          GroupDbTableNames.dbTableNames[GroupDbTableNames.NonredundantCfGroups]);

            string indexString = string.Format("Create Index {0}_pdb on {0} (PdbID);",
                                               GroupDbTableNames.dbTableNames[GroupDbTableNames.NonredundantCfGroups]);

            dbCreat.CreateIndex(ProtCidSettings.protcidDbConnection, indexString,
                                GroupDbTableNames.dbTableNames[GroupDbTableNames.NonredundantCfGroups]);

            indexString = string.Format("Create Index {0}_groupcf on {0} (GroupSeqID, CfGroupID);",
                                        GroupDbTableNames.dbTableNames[GroupDbTableNames.NonredundantCfGroups]);
            dbCreat.CreateIndex(ProtCidSettings.protcidDbConnection, indexString,
                                GroupDbTableNames.dbTableNames[GroupDbTableNames.NonredundantCfGroups]);
        }
Example #8
0
        private void InitializeDbTables()
        {
            DbCreator dbCreate          = new DbCreator();
            string    createTableString = string.Format("CREATE Table {0} ( " +
                                                        " GroupSeqID INTEGER NOT NULL, " +
                                                        " SpaceGroup1 VARCHAR(30) NOT NULL, ASU1 VARCHAR(255) NOT NULL, PDBID1 CHAR(4) NOT NULL, " +
                                                        " NumOfInterfaces1 INTEGER NOT NULL, " +
                                                        " NumOfSgInterfaces1 INTEGER NOT NULL, NumOfSimInterfaces1 INTEGER NOT NULL, " +
                                                        " SpaceGroup2 VARCHAR(30) NOT NULL, ASU2 VARCHAR(255) NOT NULL, PDBID2 CHAR(4) NOT NULL, " +
                                                        " NumOfInterfaces2 INTEGER NOT NULL, " +
                                                        " NumOfSgInterfaces2 INTEGER NOT NULL, NumOfSimInterfaces2 INTEGER NOT NULL, " +
                                                        " MaxQ FLOAT NOT NULL, MinQ FLOAT NOT NULL, " +
                                                        " LeftMaxQ FLOAT NOT NULL, LeftMinQ FLOAT NOT NULL, Identity FLOAT NOT NULL, " +
                                                        " LeftMaxAsa1 FLOAT NOT NULL, LeftMaxAsa2 FLOAT NOT NULL);",
                                                        GroupDbTableNames.dbTableNames[GroupDbTableNames.ReduntCrystForms]);

            dbCreate.CreateTableFromString(ProtCidSettings.protcidDbConnection, createTableString,
                                           GroupDbTableNames.dbTableNames[GroupDbTableNames.ReduntCrystForms]);
            string indexString = string.Format("CREATE INDEX {0}_Idx1 ON {0} (PdbID1);",
                                               GroupDbTableNames.dbTableNames[GroupDbTableNames.ReduntCrystForms]);

            dbCreate.CreateIndex(ProtCidSettings.protcidDbConnection, indexString,
                                 GroupDbTableNames.dbTableNames[GroupDbTableNames.ReduntCrystForms]);
            indexString = string.Format("CREATE INDEX {0}_Idx2 ON {0} (PdbID2);",
                                        GroupDbTableNames.dbTableNames[GroupDbTableNames.ReduntCrystForms]);
            dbCreate.CreateIndex(ProtCidSettings.protcidDbConnection, indexString,
                                 GroupDbTableNames.dbTableNames[GroupDbTableNames.ReduntCrystForms]);
        }
Example #9
0
        /// <summary>
        ///
        /// </summary>
        public static void InitializeDomainDbTables()
        {
            DbCreator dbCreator         = new DbCreator();
            string    tableName         = "";
            string    createTableString = "";
            string    createIndexString = "";

            #region domain interfaces data
            foreach (string buType in BuCompBuilder.buTypes)
            {
                if (buType == "asu")
                {
                    tableName = buType + "PfamDomainInterfaces";
                }
                else
                {
                    tableName = buType + "PfamBuDomainInterfaces";
                }
                createTableString = "CREATE TABLE " + tableName + " ( " +
                                    "RelSeqID INTEGER NOT NULL, " +
                                    "PdbID CHAR(4) NOT NULL, " +
                                    "BUID VARCHAR(8) NOT NULL, " +
                                    "InterfaceID INTEGER NOT NULL, " +
                                    "DomainInterfaceID INTEGER NOT NULL, " +
                                    "DomainID1 INTEGER NOT NULL, " +
                                    "DomainID2 INTEGER NOT NULL, " +
                                    "IsReversed CHAR(1) NOT NULL );";
                dbCreator.CreateTableFromString(ProtCidSettings.buCompConnection, createTableString, tableName);
                createIndexString = string.Format("CREATE INDEX {0}_Idx1 ON {0} (PdbID, BuID);", tableName);
                dbCreator.CreateIndex(ProtCidSettings.buCompConnection, createIndexString, tableName);

                if (buType == "asu")
                {
                    tableName         = "AsuIntraDomainInterfaces";
                    createTableString = "CREATE TABLE AsuIntraDomainInterfaces ( " +
                                        "RelSeqID INTEGER NOT NULL, " +
                                        "PdbID CHAR(4) NOT NULL, " +
                                        "AsymChain CHAR(3) NOT NULL, " +
                                        "DomainInterfaceID INTEGER NOT NULL, " +
                                        "DomainID1 INTEGER NOT NULL, " +
                                        "DomainID2 INTEGER NOT NULL, " +
                                        "IsReversed CHAR(1) NOT NULL);";
                    dbCreator.CreateTableFromString(ProtCidSettings.buCompConnection, createTableString, tableName);
                    createIndexString = string.Format("CREATE INDEX AsuIntraDInterfaces_Idx1 ON {0} (PdbID, AsymChain);", tableName);
                    dbCreator.CreateIndex(ProtCidSettings.buCompConnection, createIndexString, tableName);
                }
            }

            tableName         = "PfamRelations";
            createTableString = "CREATE TABLE " + tableName + " ( " +
                                "RelSeqID INTEGER NOT NULL, " +
                                "FamilyCode1 VARCHAR(15) NOT NULL, " +
                                "FamilyCode2 VARCHAR(15) NOT NULL );";
            dbCreator.CreateTableFromString(ProtCidSettings.buCompConnection, createTableString, tableName);
            createIndexString = string.Format("CREATE INDEX {0}_Idx1 ON {0} (RelSeqID);", tableName);
            dbCreator.CreateIndex(ProtCidSettings.buCompConnection, createIndexString, tableName);
            #endregion
        }
Example #10
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="isUpdate"></param>
        /// <returns></returns>
        private DataTable CreatePfamDnaRnaInteractTable(bool isUpdate)
        {
            string[]  pfamDnaRnaCols = { "PdbID",    "BuID",           "ChainDomainID", "PfamID", "DnaRnaChain", "DnaRnaSymmetryString",
                                         "AsymChain", "SymmetryString", "DnaRnaSeqID",   "SeqID",  "HmmSeqID" };
            DataTable pfamDnaRnaTable = new DataTable("pfamDnaRnas");

            foreach (string col in pfamDnaRnaCols)
            {
                pfamDnaRnaTable.Columns.Add(new DataColumn(col));
            }
            if (!isUpdate)
            {
                DbCreator dbCreate          = new DbCreator();
                string    createTableString = "Create Table " + pfamDnaRnaTable.TableName + " ( " +
                                              " PdbID CHAR(4) NOT NULL, " +
                                              " BuID VARCHAR(8) NOT NULL, " +
                                              " PfamID VARCHAR(40) NOT NULL, " +
                                              " ChainDomainID INTEGER NOT NULL, " +
                                              " DnaRnaChain CHAR(3) NOT NULL, " +
                                              " DnaRnaSymmetryString VARCHAR(15), " +
                                              " DnaRnaSeqID INTEGER NOT NULL, " +
                                              " AsymChain CHAR(3) NOT NULL, " +
                                              " SymmetryString VARCHAR(15), " +
                                              " SeqID INTEGER NOT NULL, " +
                                              " HmmSeqID INTEGER NOT NULL);";
                dbCreate.CreateTableFromString(ProtCidSettings.protcidDbConnection, createTableString, pfamDnaRnaTable.TableName);

                string createIndexString = "CREATE INDEX " + pfamDnaRnaTable.TableName + "_idx1 ON " + pfamDnaRnaTable.TableName + "(PdbID, ChainDomainID);";
                dbCreate.CreateIndex(ProtCidSettings.protcidDbConnection, createIndexString, pfamDnaRnaTable.TableName);
            }
            return(pfamDnaRnaTable);
        }
Example #11
0
        /// <summary>
        ///
        /// </summary>
        private DataTable InitializeTable(bool isUpdate)
        {
            string[]  pfamLigandColumns = { "PdbID", "AsymID",    "ChainAsymID", "SeqID", "ChainSeqID", "Distance",
                                            "Atom",   "ChainAtom", "Residue",     "ChainResidue" };
            DataTable pfamLigandTable = new DataTable("ChainLigands");

            foreach (string ligandCol in pfamLigandColumns)
            {
                pfamLigandTable.Columns.Add(new DataColumn(ligandCol));
            }
            if (!isUpdate)
            {
                DbCreator dbCreate          = new DbCreator();
                string    createTableString = "Create Table " + pfamLigandTable.TableName + " (" +
                                              " PdbID CHAR(4) NOT NULL, " +
                                              " AsymID CHAR(3) NOT NULL, " +
                                              //    " Ligand CHAR(5) NOT NULL, " +
                                              " ChainAsymID CHAR(3), " +
                                              " SeqID INTEGER NOT NULL, " +
                                              " ChainSeqID INTEGER NOT NULL, " +
                                              " ATOM CHAR(4) NOT NULL, " +
                                              " ChainATom CHAR(4), " +
                                              " Residue CHAR(3), " +
                                              " ChainResidue CHAR(3), " +
                                              " Distance FLOAT" +
                                              " );";
                dbCreate.CreateTableFromString(ProtCidSettings.buCompConnection, createTableString, pfamLigandTable.TableName);
                string createIndexString = "CREATE INDEX " + pfamLigandTable.TableName + "_idx1 ON " + pfamLigandTable.TableName + "(PdbID, AsymID)";
                dbCreate.CreateIndex(ProtCidSettings.buCompConnection, createIndexString, pfamLigandTable.TableName);
            }
            return(pfamLigandTable);
        }
Example #12
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="dataType"></param>
        private void CreateDbRefTablesInDb(string dataType)
        {
            string    createTableString = "";
            string    createIndexString = "";
            DbCreator dbCreator         = new DbCreator();

            if (dataType == "sws")
            {
                createTableString = "CREATE TABLE " + dbRefTable.TableName + " ( " +
                                    " PdbID CHAR(4) NOT NULL, " +
                                    " RefID INTEGER NOT NULL, " +
                                    " EntityID INTEGER NOT NULL, " +
                                    //     " AuthorChain CHAR(3) NOT NULL, " +
                                    " DbAccession VARCHAR(15) NOT NULL, " +
                                    " PRIMARY KEY (PdbID, RefID));";
            }
            else
            {
                createTableString = "CREATE TABLE " + dbRefTable.TableName + " ( " +
                                    " PdbID CHAR(4) NOT NULL, " +
                                    " RefID INTEGER NOT NULL, " +
                                    " EntityID INTEGER NOT NULL, " +
                                    //     " AuthorChain CHAR(3) NOT NULL, " +
                                    " DbAccession VARCHAR(15) NOT NULL, " +
                                    " Isoform INTEGER NOT NULL, " +
                                    " PRIMARY KEY (PdbID, RefID));";
            }
            dbCreator.CreateTableFromString(createTableString, dbRefTable.TableName);
            createIndexString = "CREATE INDEX " + dbRefTable.TableName + "_idx1 ON " + dbRefTable.TableName + "(PdbID, EntityID);";
            dbCreator.CreateIndex(createIndexString, dbRefTable.TableName);

            createTableString = "CREATE TABLE" + dbRefSeqTable.TableName + " ( " +
                                " AlignID INTEGER NOT NULL, " +
                                " PdbID CHAR(4) NOT NULL, " +
                                " RefID INTEGER NOT NULL, " +
                                " AuthorChain CHAR(3) NOT NULL, " +
                                " DbAlignBeg INTEGER NOT NULL, " +
                                " DbAlignEnd INTEGER NOT NULL, " +
                                " AuthorAlignBeg INTEGER NOT NULL, " +
                                " AuthorAlignEnd INTEGER NOT NULL, " +
                                " SeqAlignBeg INTEGER NOT NULL, " +
                                " SeqAlignEnd INTEGER NOT NULL, " +
                                " PRIMARY KEY (PdbID, AlignID));";
            dbCreator.CreateTableFromString(createTableString, dbRefSeqTable.TableName);
            createIndexString = "CREATE INDEX " + dbRefSeqTable.TableName + "_idx1 ON " + dbRefSeqTable.TableName + "(PdbID, RefID);";
            dbCreator.CreateIndex(createIndexString, dbRefSeqTable.TableName);
        }
Example #13
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="isUpdate"></param>
 private void CreateDbTable(bool isUpdate)
 {
     if (!isUpdate)
     {
         DbCreator dbCreate          = new DbCreator();
         string    createTableString = "Create Table " + tableName + " ( " +
                                       "PfamID varchar(40) NOT NULL, " +
                                       "ClusterID Integer NOT NULL, " +
                                       "PdbID char(4) Not Null, " +
                                       "ChainDomainID Integer Not Null, " +
                                       "LigandChain char(3) Not Null);";
         dbCreate.CreateTableFromString(ProtCidSettings.protcidDbConnection, createTableString, tableName);
         string createIndexString = "Create Index " + tableName + "_cluster ON " + tableName + "(PfamID, ClusterID);";
         dbCreate.CreateIndex(ProtCidSettings.protcidDbConnection, createIndexString, tableName);
         createIndexString = "Create Index " + tableName + "_pdb ON " + tableName + "(PdbID, ChainDomainID);";
         dbCreate.CreateIndex(ProtCidSettings.protcidDbConnection, createIndexString, tableName);
     }
 }
Example #14
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="isUpdate"></param>
        /// <returns></returns>
        public DataTable CreateHHAlignmentTable(bool isUpdate, string tableName)
        {
            string[]  hhrAlignColumns = { "HitNo",         "Query",      "Hit",      "QueryLength", "HitLength",  "AlignLength",
                                          "Identity",       "Evalue",     "PValue",   "Score",       "Similarity", "Prob",
                                          "Sum_Probs",      "QueryStart", "QueryEnd", "HitStart",    "HitEnd",
                                          "QueryAlignment", "HitAlignment" /*, "QueryConsensus", "HitConsensus",
                                                                            * "QueryDssp", "HitDssp", "Confidence", "Match"*/};
            DataTable pfamHHalignTable = new DataTable(tableName);

            foreach (string hhCol in hhrAlignColumns)
            {
                pfamHHalignTable.Columns.Add(new DataColumn(hhCol));
            }

            if (!isUpdate)
            {
                DbCreator dbCreate          = new DbCreator();
                string    createIndexString = "";
                string    createTableString = "CREATE TABLE " + tableName + " ( " +
                                              "HitNO INTEGER NOT NULL, " +
                                              "Query VARCHAR(32) NOT NULL," +
                                              "Hit VARCHAR(32) NOT NULL, " +
                                              "QueryLength INTEGER, " +
                                              "HitLength INTEGER, " +
                                              "AlignLength INTEGER, " +
                                              "Identity FLOAT, " +
                                              "EValue  DOUBLE PRECISION, " +
                                              "PValue DOUBLE PRECISION, " +
                                              "Score DOUBLE PRECISION, " +
                                              "Similarity FLOAT, " +
                                              "Prob FLOAT, " +
                                              "Sum_Probs FLOAT, " +
                                              "QueryStart INTEGER, " + // for the input sequence
                                              "QueryEnd INTEGER, " +
                                              "HitStart INTEGER, " +
                                              "HitEnd INTEGER, " +
                                              "QueryAlignment BLOB Sub_Type 1, " +
                                              "HitAlignment BLOB Sub_Type 1);";

                /*     "QueryConsensus BLOB Sub_Type 1, " +
                 *   "HitConsensus BLOB Sub_Type 1, " +
                 *   "QueryDssp BLOB Sub_Type 1, " +
                 *   "HitDssp BLOB Sub_Type 1, " +
                 *   "Confidence BLOB Sub_Type 1, " +
                 *   "Match BLOB Sub_Type 1);";   */
                dbCreate.CreateTableFromString(ProtCidSettings.alignmentDbConnection, createTableString, tableName);
                createIndexString = "CREATE Index " + tableName + "_query ON " + tableName + "(Query)";
                dbCreate.CreateIndex(ProtCidSettings.alignmentDbConnection, createIndexString, tableName);
                createIndexString = "CREATE Index " + tableName + "_hit ON " + tableName + "(Hit)";
            }
            return(pfamHHalignTable);
        }
Example #15
0
        /// <summary>
        ///
        /// </summary>
        private void CreatProtBudBuTableInDb()
        {
            string[] buColumns         = buQuery.BuTableColumns;
            string   createTableString = "Create Table " + buTableName + "( ";
            string   lowerCaseBuCol    = "";

            foreach (string buCol in buColumns)
            {
                lowerCaseBuCol = buCol.ToLower();
                if (lowerCaseBuCol == "pdbid")
                {
                    createTableString += "PdbID CHAR(4) NOT NULL, ";
                }
                else if (lowerCaseBuCol.IndexOf("buid") > -1)
                {
                    createTableString += (buCol + " VARCHAR(10), ");
                }
                else if (lowerCaseBuCol.IndexOf("_entity") > -1 ||
                         lowerCaseBuCol.IndexOf("_asymid") > -1 ||
                         lowerCaseBuCol.IndexOf("_auth") > -1 ||
                         lowerCaseBuCol.IndexOf("_abc") > -1)
                {
                    createTableString += (buCol + " BLOB SUB_TYPE TEXT NOT NULL, ");
                }
                else if (lowerCaseBuCol == "samebus")
                {
                    createTableString += (buCol + " CHAR(9), ");
                }
                else if (lowerCaseBuCol == "dna" || lowerCaseBuCol == "rna" || lowerCaseBuCol == "ligands")
                {
                    createTableString += (buCol + " CHAR(3), ");
                }
                else if (lowerCaseBuCol == "resolution")
                {
                    createTableString += (buCol + " VARCHAR(32), ");
                }
                else if (lowerCaseBuCol == "names")
                {
                    createTableString += (buCol + " BLOB SUB_TYPE TEXT NOT NULL, ");
                }
            }
            createTableString  = createTableString.TrimEnd(", ".ToCharArray());
            createTableString += ");";
            DbCreator dbCreat = new DbCreator();

            dbCreat.CreateTableFromString(ProtCidSettings.pdbfamDbConnection, createTableString, buTableName);

            string createIndexString = "Create Index " + buTableName + "_idx1 ON " + buTableName +
                                       " ( PdbID, PdbBuID, PisaBuID);";

            dbCreat.CreateIndex(ProtCidSettings.pdbfamDbConnection, createIndexString, buTableName);
        }
Example #16
0
        private void InitializeDbTable()
        {
            DbCreator dbCreator = new DbCreator();

            if (!dbCreator.IsTableExist(ProtCidSettings.buCompConnection, buGroupTable.TableName))
            {
                string createTableString = "Create Table " + buGroupTable.TableName + " ( " +
                                           " GroupSeqID INTEGER NOT NULL, " +
                                           " PdbID CHAR(4) NOT NULL, " +
                                           " BuID VARCHAR(8) NOT NULL, " +
                                           " EntityFormat VARCHAR(255) NOT NULL, " +
                                           " AsymFormat VARCHAR(255) NOT NULL, " +
                                           " AbcFormat VARCHAR(255) NOT NULL );";
                dbCreator.CreateTableFromString(ProtCidSettings.buCompConnection, createTableString, buGroupTable.TableName);

                string createIndexString = "Create INDEX " + buGroupTable.TableName + "_Idx1 ON " +
                                           buGroupTable.TableName + "(PdbID, BuID);";
                dbCreator.CreateIndex(ProtCidSettings.buCompConnection, createIndexString, buGroupTable.TableName);

                createIndexString = "Create INDEX " + buGroupTable.TableName + "_idx2 ON " +
                                    buGroupTable.TableName + "(GroupSeqID);";
                dbCreator.CreateIndex(ProtCidSettings.buCompConnection, createIndexString, buGroupTable.TableName);
            }

            if (!dbCreator.IsTableExist(ProtCidSettings.buCompConnection, groupTable.TableName))
            {
                string createTableString = "Create Table " + groupTable.TableName + " ( " +
                                           " GroupSeqID INTEGER NOT NULL, " +
                                           " FamilyString BLOB Sub_Type Text NOT NULL);";
                dbCreator.CreateTableFromString(ProtCidSettings.buCompConnection, createTableString, groupTable.TableName);

                /*          string createIndexString = "Create INDEX " + groupTable.TableName + "_idx1 ON " +
                 *            groupTable.TableName + "(GroupSeqID);";
                 *        dbCreator.CreateTable(ProtCidSettings.buCompConnection, createIndexString, groupTable.TableName);*/
            }
        }
Example #17
0
        /// <summary>
        /// initialize tables in database
        /// </summary>
        public static void InitializeDbTables()
        {
            DbCreator dbCreator                = new DbCreator();
            string    createTableString        = "";
            string    createIndexString        = "";
            string    buCompTableName          = "PdbPisaBuComp";
            string    buInterfaceCompTableName = "PdbPisaBuInterfaceComp";

            // for BU Comparison

            createTableString = "CREATE TABLE " + buCompTableName + " ( " +
                                "PdbID CHAR(4) NOT NULL, " +
                                "BuID1 VARCHAR(8) NOT NULL, " +
                                "BuID2 VARCHAR(8) NOT NULL, " +
                                "InterfaceNum1 INTEGER NOT NULL, " +
                                "InterfaceNum2 INTEGER NOT NULL, " +
                                "IsSame CHAR(1) NOT NULL);";

            dbCreator.CreateTableFromString(ProtCidSettings.buCompConnection, createTableString, buCompTableName);

            createIndexString = string.Format("CREATE INDEX {0}_idx1 ON {0} (PdbID, BuID1, BuID2);", buCompTableName);
            dbCreator.CreateIndex(ProtCidSettings.buCompConnection, createIndexString, buCompTableName);

            // for BU Interface comparison
            createTableString = "CREATE TABLE " + buInterfaceCompTableName + " ( " +
                                "PdbID CHAR(4) NOT NULL, " +
                                "BuID1 VARCHAR(8) NOT NULL, " +
                                "BuID2 VARCHAR(8) NOT NULL, " +
                                "InterfaceID1 INTEGER NOT NULL, " +
                                "InterfaceID2 INTEGER NOT NULL, " +
                                "QScore FLOAT NOT NULL);";
            dbCreator.CreateTableFromString(ProtCidSettings.buCompConnection, createTableString, buInterfaceCompTableName);

            createIndexString = string.Format("CREATE INDEX {0}_idx1 ON {0} (PdbID, BuID1, BuID2);", buInterfaceCompTableName);
            dbCreator.CreateIndex(ProtCidSettings.buCompConnection, createIndexString, buInterfaceCompTableName);
        }
Example #18
0
        private void InitializeFamilyTablesInDb()
        {
            DbCreator dbCreator = new DbCreator();

            string tableName         = ProtCidSettings.dataType + "SgInterfaces";
            string createTableString = string.Format("CREATE TABLE {0} (" +
                                                     " GroupSeqID INTEGER NOT NULL, " +
                                                     " SpaceGroup VARCHAR(30) NOT NULL, " +
                                                     " ASU BLOB Sub_Type TEXT NOT NULL, " +
                                                     " PDBID CHAR(4) NOT NULL, " +
                                                     " InterfaceID INTEGER NOT NULL, " +
                                                     " NumOfSG INTEGER NOT NULL, " +
                                                     " NumOfSG_Identity INTEGER NOT NULL, " +
                                                     " SurfaceArea FLOAT );", tableName);

            dbCreator.CreateTableFromString(ProtCidSettings.protcidDbConnection, createTableString, tableName);
            string createIdxString = string.Format("CREATE INDEX {0}_Idx1 " +
                                                   " ON {0} (GroupSeqID, PdbID, InterfaceID);", tableName);

            dbCreator.CreateIndex(ProtCidSettings.protcidDbConnection, createIdxString, tableName);
        }
Example #19
0
        /// <summary>
        ///
        /// </summary>
        private void InitializeDbTable()
        {
            string createTableString = string.Format("CREATE Table {0} (" +
                                                     " ClanSeqID INTEGER NOT NULL, " +
                                                     " ClusterID INTEGER NOT NULL, " +
                                                     //     " RelSeqID INTEGER NOT NULL, " +
                                                     " GroupSeqID INTEGER NOT NULL, " +
                                                     " CFGroupID INTEGER NOT NULL, " +
                                                     " SpaceGroup VARCHAR(30) NOT NULL, " +
                                                     " ASU VARCHAR(50) NOT NULL, " +
                                                     " PDBID CHAR(4) NOT NULL, " +
                                                     " DomainInterfaceID INTEGER NOT NULL);",
                                                     tableName);
            DbCreator dbCreate = new DbCreator();

            dbCreate.CreateTableFromString(ProtCidSettings.protcidDbConnection, createTableString, tableName, true);

            string indexString = string.Format("Create INDEX {0}_Idx1 ON {0} (ClanSeqID, PdbID, DomainInterfaceID);",
                                               tableName);

            dbCreate.CreateIndex(ProtCidSettings.protcidDbConnection, indexString, tableName);
        }
Example #20
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="dataType"></param>
        private void CreateDbTable(string dataType)
        {
            DbCreator dbCreate          = new DbCreator();
            string    createTableString = "";

            createTableString = "CREATE TABLE " + pdbUnpDbTable.TableName + " ( " +
                                " PdbID CHAR(4) NOT NULL, ";
            if (dataType == "ssmap")
            {
                createTableString += "Isoform INTEGER NOT NULL, ";
            }
            createTableString += (" AuthorChain CHAR(3) NOT NULL, " +
                                  " EntityID INTEGER NOT NULL, " +
                                  " DbAccession CHAR(6) NOT NULL, " +
                                  " PdbSequence BLOB Sub_Type Text NOT NULL, " +
                                  " UnpSequence BLOB Sub_Type Text NOT NULL, " +
                                  " AuthorSeqNumbers BLOB Sub_Type Text NOT NULL, " +
                                  " UnpSeqNumbers BLOB Sub_Type Text NOT NULL, " +
                                  " SeqNumbers BLOB Sub_Type Text NOT NULL );");
            dbCreate.CreateTableFromString(createTableString, pdbUnpDbTable.TableName);
            string createIndexString = "CREATE INDEX " + pdbUnpDbTable.TableName + "_idx1 ON " + pdbUnpDbTable.TableName + "(PdbID, AuthorChain);";

            dbCreate.CreateIndex(createIndexString, pdbUnpDbTable.TableName);
        }
Example #21
0
        /// <summary>
        /// create summary information for the interface clusters
        /// </summary>
        public void InitializeSumInfoTablesInDb(string type)
        {
            DbCreator dbCreate = new DbCreator();
            // details for interfaces in each cluster, including representative entry and homologous entries
            string createTableString = "";

            type = type.ToUpper();
            createTableString = "CREATE TABLE " + type + "ClusterEntryInterfaces ( ";
            if (type.IndexOf("SUPER") > -1)
            {
                createTableString += "SuperGroupSeqID INTEGER NOT NULL, ";
            }
            createTableString = createTableString +
                                " GroupSeqID INTEGER NOT NULL, " +
                                " ClusterID INTEGER NOT NULL, " +
                                " CfGroupID INTEGER NOT NULL, " +
                                " SpaceGroup VARCHAR(40) NOT NULL, " +
                                " CrystForm BLOB Sub_Type TEXT NOT NULL, " +
                                " PdbID CHAR(4) NOT NULL, " +
                                " InterfaceID INTEGER NOT NULL, " +
                                " InterfaceUnit CHAR(3) NOT NULL, " +
                                " NumOfInterfaces INTEGER NOT NULL, " +
                                " SurfaceArea FLOAT, " +
                                " InASU CHAR, InPDB CHAR, InPISA CHAR, " +
                                " ASU BLOB Sub_Type TEXT NOT NULL,  " +
                                " PDBBU BLOB Sub_Type TEXT NOT NULL, PdbBuID VARCHAR(20), " +
                                " PISABU BLOB Sub_Type TEXT NOT NULL, PisaBUID INTEGER, " +
                                " pdbpisa VARCHAR(20), " +
                                " Name BLOB Sub_Type TEXT, " +
                                " Species VARCHAR(255), " +
                                " UnpCode VARCHAR(255) );";
            dbCreate.CreateTableFromString(ProtCidSettings.protcidDbConnection, createTableString, type + "ClusterEntryInterfaces");
            string createIndexString = "";

            if (type.IndexOf("SUPER") > -1)
            {
                createIndexString = string.Format("CREATE INDEX {0}Cluster_Idx1 ON {1} (SuperGroupSeqID, ClusterID);",
                                                  type, type + "ClusterEntryInterfaces");
            }
            else
            {
                createIndexString = string.Format("CREATE INDEX {0}Cluster_Idx1 ON {1} (GroupSeqID, ClusterID);",
                                                  type, type + "ClusterEntryInterfaces");
            }
            dbCreate.CreateIndex(ProtCidSettings.protcidDbConnection, createIndexString, type + "ClusterEntryInterfaces");
            createIndexString = string.Format("CREATE INDEX {0}Cluster_Idx2 ON {1} (PdbID);",
                                              type, type + "ClusterEntryInterfaces");
            dbCreate.CreateIndex(ProtCidSettings.protcidDbConnection, createIndexString, type + "ClusterEntryInterfaces");

            // the summary information for each cluster
            createTableString = "CREATE TABLE " + type + "ClusterSumInfo (";
            if (type.IndexOf("SUPER") > -1)
            {
                createTableString += " SuperGroupSeqID INTEGER NOT NULL, ";
            }
            else
            {
                createTableString += " GroupSeqID INTEGER NOT NULL, ";
            }
            createTableString = createTableString +
                                " ClusterID INTEGER NOT NULL, " +
                                " SurfaceArea FLOAT NOT NULL, " +
                                " InASU INTEGER, InPDB INTEGER, InPISA INTEGER, " +
                                " MaxASU BLOB Sub_Type TEXT, MaxPdbBU BLOB Sub_Type TEXT, MaxPisaBU BLOB Sub_Type TEXT," +
                                " NumOfCfgCluster INTEGER NOT NULL, " +
                                " NumOfCfgFamily INTEGER NOT NULL, " +
                                " NumOfEntryCluster INTEGER NOT NULL, " +
                                " NumOfEntryFamily INTEGER NOT NULL, " +
                                " MinSeqIdentity FLOAT, " +
                                " Q_MinIdentity FLOAT, " +
                                " OutMaxSeqIdentity FLOAT, " +
                                " InterfaceType VARCHAR(3), " +
                                " NumOfNMR INTEGER, " +
                                " ClusterInterface VARCHAR(12), " + // the interface with maximum surface area
                                " MediumSurfaceArea FLOAT );";
            dbCreate.CreateTableFromString(ProtCidSettings.protcidDbConnection, createTableString, type + "ClusterSumInfo");
            if (type.IndexOf("SUPER") > -1)
            {
                createIndexString = string.Format("CREATE INDEX {0}ClusterSum_Idx1 ON {1} (SuperGroupSeqID, ClusterID);",
                                                  type, type + "ClusterSumInfo");
            }
            else
            {
                createIndexString = string.Format("CREATE INDEX {0}ClusterSum_Idx1 ON {1} (GroupSeqID, ClusterID);",
                                                  type, type + "ClusterSumInfo");
            }
            dbCreate.CreateIndex(ProtCidSettings.protcidDbConnection, createIndexString, type + "ClusterSumInfo");
        }
Example #22
0
        /// <summary>
        /// initialize tables in the database
        /// </summary>
        public static void InitializeDbTables()
        {
            DbCreator dbCreate          = new DbCreator();
            string    tableName         = ProtCidSettings.dataType + "DomainInterfaceComp";
            string    createTableString = "Create Table " + tableName +
                                          "( RelSeqID INTEGER NOT NULL, " +
                                          " PdbID1 CHAR(4) NOT NULL, " +
                                          " DomainInterfaceID1 INTEGER NOT NULL, " +
                                          " PdbID2 CHAR(4) NOT NULL, " +
                                          " DomainInterfaceID2 INTEGER NOT NULL, " +
                                          " QScore FLOAT NOT NULL, " +
                                          " Identity FLOAT NOT NULL, " +
                                          " IsReversed CHAR(1) );";

            dbCreate.CreateTableFromString(ProtCidSettings.protcidDbConnection, createTableString, tableName);
            string createIdxString = "Create INDEX " + tableName + "_idx1 ON " + tableName + "(PdbID1);";

            dbCreate.CreateIndex(ProtCidSettings.protcidDbConnection, createIdxString, tableName);
            createIdxString = "Create INDEX " + tableName + "_idx2 ON " + tableName + " (PdbID2);";
            dbCreate.CreateIndex(ProtCidSettings.protcidDbConnection, createIdxString, tableName);

            tableName         = ProtCidSettings.dataType + "EntryDomainInterfaceComp";
            createTableString = "Create Table " + tableName +
                                "( RelSeqID INTEGER NOT NULL, " +
                                " PdbID CHAR(4) NOT NULL, " +
                                " DomainInterfaceID1 INTEGER NOT NULL, " +
                                " DomainInterfaceID2 INTEGER NOT NULL, " +
                                " QScore FLOAT NOT NULL, " +
                                " IsReversed CHAR(1) );";
            dbCreate.CreateTableFromString(ProtCidSettings.protcidDbConnection, createTableString, tableName);
            createIdxString = "Create INDEX " + ProtCidSettings.dataType + "EntryDomInterComp_idx1 ON " + tableName + "(RelSeqID, PdbID);";
            dbCreate.CreateIndex(ProtCidSettings.protcidDbConnection, createIdxString, tableName);

            tableName         = ProtCidSettings.dataType + "DomainInterfaces";
            createTableString = "Create Table " + tableName +
                                "( RelSeqID INTEGER NOT NULL, " +
                                " PdbID CHAR(4) NOT NULL, " +
                                " InterfaceID INTEGER NOT NULL, " +
                                " DomainInterfaceID INTEGER NOT NULL, " +
                                " DomainID1 BIGINT NOT NULL, " +
                                " AsymChain1 CHAR(3) NOT NULL, " +
                                " DomainID2 BIGINT NOT NULL, " +
                                " AsymChain2 CHAR(3) NOT NULL, " +
                                " SurfaceArea FLOAT, " +
                                " ChainDomainID1 INTEGER, " +
                                " ChainDomainID2 INTEGER, " +
                                " IsReversed CHAR(1) NOT NULL);";
            dbCreate.CreateTableFromString(ProtCidSettings.protcidDbConnection, createTableString, tableName);
            createIdxString = "Create INDEX " + tableName + "_idx1 ON " + tableName + " (PdbID, InterfaceID);";
            dbCreate.CreateIndex(ProtCidSettings.protcidDbConnection, createIdxString, tableName);
            createIdxString = "Create INDEX " + tableName + "_idx2 ON " + tableName + " (DomainID1);";
            dbCreate.CreateIndex(ProtCidSettings.protcidDbConnection, createIdxString, tableName);
            createIdxString = "Create INDEX " + tableName + "_idx3 ON " + tableName + " (DomainID2);";
            dbCreate.CreateIndex(ProtCidSettings.protcidDbConnection, createIdxString, tableName);
            createIdxString = "Create INDEX " + tableName + "_idx4 ON " + tableName + " (RelSeqID);";
            dbCreate.CreateIndex(ProtCidSettings.protcidDbConnection, createIdxString, tableName);

            tableName         = ProtCidSettings.dataType + "DomainFamilyRelation";
            createTableString = "Create Table " + tableName +
                                "( RelSeqID INTEGER NOT NULL, " +
                                " FamilyCode1 VARCHAR(40) NOT NULL, " +
                                " FamilyCode2 VARCHAR(40) NOT NULL, " +
                                " ClanSeqID INTEGER NOT NULL);";
            dbCreate.CreateTableFromString(ProtCidSettings.protcidDbConnection, createTableString, tableName);
            createIdxString = "Create INDEX " + ProtCidSettings.dataType + "DomainRel_idx1 ON " + tableName + " (RelSeqID);";
            dbCreate.CreateIndex(ProtCidSettings.protcidDbConnection, createIdxString, tableName);

            tableName         = ProtCidSettings.dataType + "DomainClanRelation";
            createTableString = "Create Table " + tableName +
                                "(ClanSeqID INTEGER NOT NULL, " +
                                "ClanCode1 VARCHAR(40) NOT NULL, " +
                                "ClanCode2 VARCHAR(40) NOT NULL);";
            dbCreate.CreateTableFromString(ProtCidSettings.protcidDbConnection, createTableString, tableName);
            createIdxString = "Create INDEX " + ProtCidSettings.dataType + "ClanRel_idx1 ON " + tableName + " (ClanSeqID);";
            dbCreate.CreateIndex(ProtCidSettings.protcidDbConnection, createIdxString, tableName);

            tableName         = "ClanDomainInterfaceComp";
            createTableString = "Create Table " + tableName +
                                "( ClanSeqID INTEGER NOT NULL, " +
                                " RelSeqID1 INTEGER NOT NULL, " +
                                " PdbID1 CHAR(4) NOT NULL, " +
                                " DomainInterfaceID1 INTEGER NOT NULL, " +
                                " RelSeqID2 INTEGER NOT NULL, " +
                                " PdbID2 CHAR(4) NOT NULL, " +
                                " DomainInterfaceID2 INTEGER NOT NULL, " +
                                " QScore FLOAT NOT NULL, " +
                                " Identity FLOAT NOT NULL, " +
                                " IsReversed CHAR(1) );";
            dbCreate.CreateTableFromString(ProtCidSettings.protcidDbConnection, createTableString, tableName);
            createIdxString = "Create INDEX " + tableName + "_idx1 ON " + tableName + "(PdbID1);";
            dbCreate.CreateIndex(ProtCidSettings.protcidDbConnection, createIdxString, tableName);
            createIdxString = "Create INDEX " + tableName + "_idx2 ON " + tableName + " (PdbID2);";
            dbCreate.CreateIndex(ProtCidSettings.protcidDbConnection, createIdxString, tableName);

            tableName         = "PfamDomainCfGroups";
            createTableString = "Create Table " + tableName + "( " +
                                " RelSeqID INTEGER NOT NULL, " +
                                " RelCfGroupID INTEGER NOT NULL, " +
                                " GroupSeqID INTEGER NOT NULL, " +
                                " CfGroupID INTEGER NOT NULL);";
            dbCreate.CreateTableFromString(ProtCidSettings.protcidDbConnection, createTableString, tableName);
            createIdxString = "Create INDEX " + tableName + "_idx1 ON " + tableName + "(RelSeqID);";
            dbCreate.CreateIndex(ProtCidSettings.protcidDbConnection, createIdxString, tableName);
        }
Example #23
0
        public static void  InitializeDbTables()
        {
            string    createTableString = "";
            string    createIndexString = "";
            string    tableName         = "";
            DbCreator dbCreator         = new DbCreator();

            tableName         = "CRYSTENTRYINTERFACES";
            createTableString = "CREATE TABLE CRYSTENTRYINTERFACES ( " +
                                "PDBID                CHAR(4) NOT NULL," +
                                "INTERFACEID          INTEGER NOT NULL," +
                                "ASYMCHAIN1           CHAR(4) NOT NULL," +
                                "AUTHCHAIN1           CHAR(3) NOT NULL," +
                                "ENTITYID1            INTEGER NOT NULL," +
                                "SYMMETRYSTRING1      VARCHAR(15) NOT NULL," +
                                "FULLSYMMETRYSTRING1  VARCHAR(30) NOT NULL," +
                                "ASYMCHAIN2           CHAR(4) NOT NULL," +
                                "AUTHCHAIN2           CHAR(3) NOT NULL," +
                                "ENTITYID2            INTEGER NOT NULL," +
                                "SYMMETRYSTRING2      VARCHAR(15) NOT NULL," +
                                "FULLSYMMETRYSTRING2  VARCHAR(30) NOT NULL," +
                                "SURFACEAREA          FLOAT DEFAULT -1 NOT NULL" +
                                "SymmetryIndex        FLOAT DEFAULT 0);"; // added on August 16, 2018 whether the interface with same pfam architecture is in symmetry
            dbCreator.CreateTableFromString(ProtCidSettings.protcidDbConnection, createTableString, tableName);
            createIndexString = "CREATE INDEX CRYSTENTRYINTERFACES_IDX1 ON CRYSTENTRYINTERFACES (PDBID, INTERFACEID);";
            dbCreator.CreateIndex(ProtCidSettings.protcidDbConnection, createIndexString, tableName);

            tableName         = "DIFENTRYINTERFACECOMP";
            createTableString = "CREATE TABLE DIFENTRYINTERFACECOMP (" +
                                "PDBID1           CHAR(4) NOT NULL," +
                                "INTERFACEID1     INTEGER NOT NULL," +
                                "PDBID2           CHAR(4) NOT NULL," +
                                "INTERFACEID2     INTEGER NOT NULL," +
                                "QSCORE           FLOAT NOT NULL," +
                                "IDENTITY         FLOAT NOT NULL, " +
                                "ISREVERSED       INTEGER NOT NULL );";
            dbCreator.CreateTableFromString(ProtCidSettings.protcidDbConnection, createTableString, tableName);
            createIndexString = "CREATE INDEX DIFENTRYINTERFACECOMP_IDX1 ON DIFENTRYINTERFACECOMP (PDBID1, INTERFACEID1);";
            dbCreator.CreateIndex(ProtCidSettings.protcidDbConnection, createIndexString, tableName);
            createIndexString = "CREATE INDEX DIFENTRYINTERFACECOMP_IDX2 ON DIFENTRYINTERFACECOMP (PDBID2, INTERFACEID2);";
            dbCreator.CreateIndex(ProtCidSettings.protcidDbConnection, createIndexString, tableName);

            tableName         = "ENTRYINTERFACECOMP";
            createTableString = "CREATE TABLE ENTRYINTERFACECOMP (" +
                                "PDBID         CHAR(4) NOT NULL," +
                                "INTERFACEID1  INTEGER NOT NULL," +
                                "INTERFACEID2  INTEGER NOT NULL," +
                                "QSCORE        FLOAT NOT NULL," +
                                "ISREVERSED    INTEGER NOT NULL);";
            dbCreator.CreateTableFromString(ProtCidSettings.protcidDbConnection, createTableString, tableName);
            createIndexString = "CREATE INDEX ENTRYINTERFACECOMP_IDX1 ON ENTRYINTERFACECOMP (PDBID);";
            dbCreator.CreateIndex(ProtCidSettings.protcidDbConnection, createIndexString, tableName);

            /*
             * Not maintain since Pfam30 since November 2016, due to the size of tables
             * */
/*
 *          tableName = "SGINTERFACECONTACTS";
 *          createTableString = "CREATE TABLE SGINTERFACECONTACTS (" +
 *                              "PDBID        CHAR(4) NOT NULL," +
 *                              "INTERFACEID  INTEGER NOT NULL," +
 *                              "RESIDUE1     CHAR(3) NOT NULL," +
 *                              "SEQID1       CHAR(5) NOT NULL," +
 *                              "RESIDUE2     CHAR(3) NOT NULL," +
 *                              "SEQID2       CHAR(5) NOT NULL," +
 *                              "DISTANCE     FLOAT NOT NULL);";
 *          dbCreator.CreateTableFromString(ProtCidSettings.protcidDbConnection, createTableString, tableName);
 *          createIndexString = "CREATE INDEX SGINTERFACECONTACTS_IDX1 ON SGINTERFACECONTACTS (PDBID, INTERFACEID);";
 *          dbCreator.CreateIndex(ProtCidSettings.protcidDbConnection, createIndexString, tableName);
 *
 *          tableName = "SGINTERFACERESIDUES";
 *          createTableString = "CREATE TABLE SGINTERFACERESIDUES (" +
 *                              "PDBID        CHAR(4) NOT NULL," +
 *                              "INTERFACEID  INTEGER NOT NULL," +
 *                              "RESIDUE1     CHAR(3) NOT NULL," +
 *                              "SEQID1       CHAR(5) NOT NULL," +
 *                              "RESIDUE2     CHAR(3) NOT NULL," +
 *                              "SEQID2       CHAR(5) NOT NULL," +
 *                              "DISTANCE     FLOAT NOT NULL);";
 *          dbCreator.CreateTableFromString(ProtCidSettings.protcidDbConnection, createTableString, tableName);
 *          createIndexString = "CREATE INDEX SGINTERFACERESIDUES_IDX1 ON SGINTERFACERESIDUES (PDBID, INTERFACEID);";
 *          dbCreator.CreateIndex(ProtCidSettings.protcidDbConnection, createIndexString, tableName);*/
        }
Example #24
0
        /// <summary>
        /// create table structures in the database
        /// </summary>
        public static void InitializeDbTables(DbConnect alignmentDbConnect)
        {
            if (!alignmentDbConnect.IsConnected())
            {
                alignmentDbConnect.ConnectToDatabase();
            }
            DbCreator dbCreator = new DbCreator();

            /*       string createTableString = "CREATE TABLE PsiBlastAlignments ( " +
             *                               "QueryEntry CHAR(4) NOT NULL," +
             *                               "QueryChain CHAR(3) NOT NULL," +
             *                               "QueryAsymChain CHAR(3)," +
             *                               "HitEntry CHAR(4) NOT NULL," +
             *                               "HitChain CHAR(3) NOT NULL," +
             *                               "HitAsymChain CHAR(3)," +
             *                               "QueryLength INTEGER  NOT NULL," +
             *                               "HitLength INTEGER  NOT NULL," +
             *                               "Identity FLOAT NOT NULL," +
             *                               "AlignmentLength INTEGER  NOT NULL," +
             *                               "E_value DOUBLE PRECISION NOT NULL," +
             *                               "QueryStart INTEGER  NOT NULL," +
             *                               "QueryEnd INTEGER  NOT NULL," +
             *                               "HitStart INTEGER  NOT NULL," +
             *                               "HitEnd INTEGER  NOT NULL," +
             *                               "QuerySequence BLOB SUB_TYPE TEXT NOT NULL," +
             *                               "HitSequence BLOB SUB_TYPE TEXT NOT NULL);";
             *     dbCreator.CreateTableFromString(alignmentDbConnect, createTableString, "PsiBlastAlignments");
             *     string createIdxString = "CREATE INDEX PsiblastAlign_queryindex ON PsiBlastAlignments(QueryEntry, QueryChain);";
             *     dbCreator.CreateIndex(alignmentDbConnect, createIdxString, "PsiBlastAlignments");
             *     createIdxString = "CREATE INDEX PsiblastAlign_Hitindex ON PsiBlastAlignments(HitEntry, HitChain);";
             *     dbCreator.CreateIndex(alignmentDbConnect, createIdxString, "PsiBlastAlignments");
             *
             *     createTableString = "CREATE TABLE CeAlignments ( " +
             *                               "QueryEntry CHAR(4) NOT NULL," +
             *                               "QueryChain CHAR(3) NOT NULL," +
             *                               "QueryAsymChain CHAR(3)," +
             *                               "HitEntry CHAR(4) NOT NULL," +
             *                               "HitChain CHAR(3) NOT NULL," +
             *                               "HitAsymChain CHAR(3)," +
             *                               "QueryLength INTEGER  NOT NULL," +
             *                               "HitLength INTEGER  NOT NULL," +
             *                               "Identity FLOAT NOT NULL," +
             *                               "AlignmentLength INTEGER  NOT NULL," +
             *                               "E_value DOUBLE PRECISION NOT NULL," +
             *                               "QueryStart INTEGER  NOT NULL," +
             *                               "QueryEnd INTEGER  NOT NULL," +
             *                               "HitStart INTEGER  NOT NULL," +
             *                               "HitEnd INTEGER  NOT NULL," +
             *                               "QuerySequence BLOB SUB_TYPE TEXT NOT NULL," +
             *                               "HitSequence BLOB SUB_TYPE TEXT NOT NULL);";
             *     dbCreator.CreateTableFromString(alignmentDbConnect, createTableString, "CeAlignments");
             *     createIdxString = "CREATE INDEX CeAlign_queryindex ON CeAlignments(QueryEntry, QueryChain);";
             *     dbCreator.CreateIndex(alignmentDbConnect, createIdxString, "CeAlignments");
             *     createIdxString = "CREATE INDEX CeAlign_Hitindex ON CeAlignments(HitEntry, HitChain);";
             *     dbCreator.CreateIndex(alignmentDbConnect, createIdxString, "CeAlignments");
             */
            string createTableString = "CREATE TABLE RedundantPdbChains ( " +
                                       "PdbID1 CHAR(4) NOT NULL," +
                                       "ChainID1 CHAR(3) NOT NULL," +
                                       "AsymChainID1 CHAR(3)," +
                                       "EntityID1 INTEGER, " +
                                       "PdbID2 CHAR(4) NOT NULL," +
                                       "ChainID2 CHAR(3) NOT NULL, " +
                                       "AsymChainID2 CHAR(3), " +
                                       "EntityID2 INTEGER);";

            dbCreator.CreateTableFromString(alignmentDbConnect, createTableString, "RedundantPdbChains");
            string createIdxString = "CREATE INDEX RedundantPdbChains_indexPdbid1 ON RedundantPdbChains(PdbID1);";

            dbCreator.CreateIndex(alignmentDbConnect, createIdxString, "RedundantPdbChains");
            createIdxString = "CREATE INDEX RedundantPdbChains_indexPdbid2 ON RedundantPdbChains(PdbID2);";
            dbCreator.CreateIndex(alignmentDbConnect, createIdxString, "RedundantPdbChains");
        }
Example #25
0
        /// <summary>
        ///
        /// </summary>
        public static void InitializeAllGroupDbTables()
        {
            DbCreator dbCreator         = new DbCreator();
            string    createTableString = "";
            string    createIndexString = "";
            string    tableName         = ProtCidSettings.dataType + "HomoSeqInfo";

            createTableString = "CREATE TABLE " + tableName + " ( " +
                                "GroupSeqID INTEGER NOT NULL, " +
                                "PdbID CHAR(4) NOT NULL, " +
                                "SpaceGroup VARCHAR(30) NOT NULL, " +
                                "ASU BLOB Sub_Type TEXT NOT NULL, " +
                                "Method VARCHAR(100) NOT NULL, " +
                                "Resolution FLOAT NOT NULL, " +
                                "InPfam CHAR NOT NULL);";
            dbCreator.CreateTableFromString(ProtCidSettings.protcidDbConnection, createTableString, tableName);
            createIndexString = string.Format("CREATE INDEX {0}_idx1 ON {0} (GroupSeqID);", tableName);
            dbCreator.CreateIndex(ProtCidSettings.protcidDbConnection, createIndexString, tableName);
            createIndexString = string.Format("CREATE INDEX {0}_idx2 ON {0} (PdbID);", tableName);
            dbCreator.CreateIndex(ProtCidSettings.protcidDbConnection, createIndexString, tableName);

            tableName         = ProtCidSettings.dataType + "HomoRepEntryAlign";
            createTableString = "CREATE TABLE " + tableName + " ( " +
                                "GroupSeqID INTEGER NOT NULL," +
                                "PdbID1 CHAR(4) NOT NULL," +
                                "EntityID1 INTEGER NOT NULL," +
                                "PdbID2 CHAR(4) NOT NULL," +
                                "EntityID2 INTEGER NOT NULL," +
                                "Identity FLOAT NOT NULL," +
                                "QueryStart INTEGER NOT NULL," +
                                "QueryEnd INTEGER NOT NULL," +
                                "HitStart INTEGER NOT NULL," +
                                "HitEnd INTEGER NOT NULL," +
                                "QuerySequence BLOB Sub_Type TEXT NOT NULL," +
                                "HitSequence BLOB Sub_Type TEXT NOT NULL);";
            dbCreator.CreateTableFromString(ProtCidSettings.protcidDbConnection, createTableString, tableName);
            createIndexString = string.Format("CREATE INDEX {0}_idx1 ON {0} (PdbID1);", tableName);
            dbCreator.CreateIndex(ProtCidSettings.protcidDbConnection, createIndexString, tableName);
            createIndexString = string.Format("CREATE INDEX {0}_idx2 ON {0} (PdbID2);", tableName);
            dbCreator.CreateIndex(ProtCidSettings.protcidDbConnection, createIndexString, tableName);

            tableName         = ProtCidSettings.dataType + "HomoGroupEntryAlign";
            createTableString = "CREATE TABLE " + tableName + " ( " +
                                "GroupSeqID INTEGER NOT NULL," +
                                "PdbID1 CHAR(4) NOT NULL," +
                                "EntityID1 INTEGER NOT NULL," +
                                "PdbID2 CHAR(4) NOT NULL," +
                                "EntityID2 INTEGER NOT NULL," +
                                "Identity FLOAT NOT NULL," +
                                "QueryStart INTEGER NOT NULL," +
                                "QueryEnd INTEGER NOT NULL," +
                                "HitStart INTEGER NOT NULL," +
                                "HitEnd INTEGER NOT NULL," +
                                "QuerySequence BLOB Sub_Type TEXT NOT NULL," +
                                "HitSequence BLOB Sub_Type TEXT NOT NULL);";
            dbCreator.CreateTableFromString(ProtCidSettings.protcidDbConnection, createTableString, tableName);
            string indexName = ProtCidSettings.dataType + "GroupEntryAlign";

            createIndexString = string.Format("CREATE INDEX {0}_idx1 ON {1} (PdbID1);", indexName, tableName);
            dbCreator.CreateIndex(ProtCidSettings.protcidDbConnection, createIndexString, tableName);
            createIndexString = string.Format("CREATE INDEX {0}_idx2 ON {1} (PdbID2);", indexName, tableName);
            dbCreator.CreateIndex(ProtCidSettings.protcidDbConnection, createIndexString, tableName);

            tableName         = ProtCidSettings.dataType + "Groups";
            createTableString = "CREATE TABLE " + tableName + " ( " +
                                "GroupSeqID INTEGER NOT NULL, " +
                                "EntryPfamArch BLOB Sub_Type TEXT NOT NULL);";
            dbCreator.CreateTableFromString(ProtCidSettings.protcidDbConnection, createTableString, tableName);
            createIndexString = string.Format("CREATE INDEX {0}_idx1 ON {0} (GroupSeqID);", tableName);
            dbCreator.CreateIndex(ProtCidSettings.protcidDbConnection, createIndexString, tableName);
        }
Example #26
0
        /// <summary>
        ///
        /// </summary>
        public static void InitializeDbTables()
        {
            DbCreator dbCreator         = new DbCreator();
            string    tableName         = "";
            string    createTableString = "";
            string    createIndexString = "";

            foreach (string buType in BuCompBuilder.buTypes)
            {
                if (buType == "asu")
                {
                    tableName = buType + "Interfaces";
                }
                else
                {
                    tableName = buType + "BuInterfaces";
                }

                createTableString = "Create Table " + tableName + "( " +
                                    "PdbID CHAR(4) NOT NULL, " +
                                    "BuID VARCHAR(8) NOT NULL, " +
                                    "InterfaceID INTEGER NOT NULL, " +
                                    "AsymChain1 CHAR(3) NOT NULL, " +
                                    "AsymChain2 CHAR(3) NOT NULL, " +
                                    "AuthChain1 CHAR(3) NOT NULL, " +
                                    "AuthChain2 CHAR(3) NOT NULL, " +
                                    "EntityID1 INTEGER NOT NULL, " +
                                    "EntityID2 INTEGER NOT NULL, " +
                                    "SurfaceArea FLOAT NOT NULL, " +
                                    "NumOfCopy INTEGER NOT NULL, " +
                                    "PRIMARY KEY (PdbID, BuID, InterfaceID))";

                dbCreator.CreateTableFromString(ProtCidSettings.buCompConnection, createTableString, tableName);

                if (buType == "asu")
                {
                    tableName = buType + "SameInterfaces";
                }
                else
                {
                    tableName = buType + "BuSameInterfaces";
                }
                createTableString = "CREATE TABLE " + tableName + "( " +
                                    "PdbID CHAR(4) NOT NULL, " +
                                    "BuID VARCHAR(8) NOT NULL, " +
                                    "InterfaceID INTEGER NOT NULL, " +
                                    "SameInterfaceID INTEGER NOT NULL, " +
                                    "Chain1 CHAR(3) NOT NULL, " +
                                    "SymmetryString1 VARCHAR(50) NOT NULL, " +
                                    "Chain2 CHAR(3) NOT NULL, " +
                                    "SymmetryString2 VARCHAR(50) NOT NULL, " +
                                    "QScore FLOAT NOT NULL);";
                dbCreator.CreateTableFromString(ProtCidSettings.buCompConnection, createTableString, tableName);
                createIndexString = string.Format("CREATE INDEX {0}_idx1 ON {0} (PdbID, BuID, InterfaceID);", tableName);
                dbCreator.CreateIndex(ProtCidSettings.buCompConnection, createIndexString, tableName);

                if (buType != "asu")
                {
                    tableName         = buType + "EntryBuInterfaceComp";
                    createTableString = "CREATE TABLE " + tableName + " ( " +
                                        "PdbID CHAR(4) NOT NULL, " +
                                        "BuID1 VARCHAR(8) NOT NULL, " +
                                        "InterfaceID1 INTEGER NOT NULL, " +
                                        "BuID2 VARCHAR(8) NOT NULL, " +
                                        "InterfaceID2 INTEGER NOT NULL, " +
                                        "QScore FLOAT NOT NULL);";
                    dbCreator.CreateTableFromString(ProtCidSettings.buCompConnection, createTableString, tableName);
                    createIndexString = string.Format("CREATE INDEX {0}BuInterfaceComp_idx1 " +
                                                      " ON {0}EntryBuInterfaceComp (PdbID, BuID1, BuID2);", buType);
                    dbCreator.CreateIndex(ProtCidSettings.buCompConnection, createIndexString, tableName);

                    tableName         = buType + "EntryBuComp";
                    createTableString = "CREATE TABLE " + tableName + " ( " +
                                        "PdbID CHAR(4) NOT NULL, " +
                                        "BUID1 VARCHAR(8) NOT NULL, " +
                                        "BUID2 VARCHAR(8) NOT NULL, " +
                                        "EntityFormat1 VARCHAR(150) NOT NULL, " +
                                        "EntityFormat2 VARCHAR(150) NOT NULL, " +
                                        "NumOfInterfaces1 INTEGER NOT NULL, " +
                                        "NumOfInterfaces2 INTEGER NOT NULL, " +
                                        "SameBUs CHAR(1) NOT NULL);";
                    dbCreator.CreateTableFromString(ProtCidSettings.buCompConnection, createTableString, tableName);
                    createIndexString = string.Format("CREATE INDEX {0}BuComp_Idx1 " +
                                                      " ON {0}EntryBuComp (PdbID, BuID1, BuID2);", buType);
                    dbCreator.CreateIndex(ProtCidSettings.buCompConnection, createIndexString, tableName);
                }
            }
        }
Example #27
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="dbConnect"></param>
        /// <param name="dbTableName"></param>
        public static void InitializeDbTable(DbConnect dbConnect, string dbTableName)
        {
            string    createTableString = "";
            string    createIndexString = "";
            DbCreator dbCreator         = new DbCreator();
            string    pfamAlignType     = "";

            if (dbTableName.ToLower().IndexOf("pfam") > -1)
            {
                if (dbTableName.ToLower().IndexOf("pfamweak") > -1)
                {
                    pfamAlignType = "PfamDomainWeak";
                    if (dbTableName.ToLower().IndexOf("rigid") > -1)
                    {
                        pfamAlignType = "PfamDomainWeakRigid";
                    }
                }
                else
                {
                    pfamAlignType = "PfamDomain";
                    if (dbTableName.ToLower().IndexOf("rigid") > -1)
                    {
                        pfamAlignType = "PfamDomainRigid";
                    }
                }
                createTableString = string.Format("CREATE TABLE {0} ( " +
                                                  " QueryEntry CHAR(4) NOT NULL, QueryEntity INTEGER NOT NULL, " +
                                                  " QueryDomainID BIGINT NOT NULL, " +
                                                  " QueryDomainStart INTEGER NOT NULL, QueryLength INTEGER NOT NULL, " +
                                                  " HitEntry CHAR(4) NOT NULL, HitEntity INTEGER NOT NULL, " +
                                                  " HitDOmainID BIGINT NOT NULL, " +
                                                  " HitDomainStart INTEGER NOT NULL, HitLength INTEGER NOT NULL, " +
                                                  " Align_Len INTEGER NOT NULL, Score FLOAT NOT NULL, Gaps INTEGER NOT NULL, " +
                                                  " E_Value DOUBLE PRECISION NOT NULL, Identity FLOAT NOT NULL, Similarity FLOAT NOT NULL, " +
                                                  " AlignmentLength INTEGER NOT NULL, " +
                                                  " QuerySequence BLOB Sub_Type TEXT NOT NULL, HitSequence BLOB Sub_Type TEXT NOT NULL, ",
                                                  dbTableName);
                if (dbTableName.ToLower().IndexOf("weak") < 0)
                {
                    createTableString = createTableString +
                                        " QuerySeqNumbers BLOB Sub_Type TEXT NOT NULL, HitSeqNumbers BLOB Sub_Type TEXT NOT NULL, ";
                }
                createTableString = createTableString +
                                    " QueryStart INTEGER NOT NULL, QueryEnd INTEGER NOT NULL, " +
                                    " HitStart INTEGER NOT NULL, HitEnd INTEGER NOT NULL);";

                dbCreator.CreateTableFromString(dbConnect, createTableString, dbTableName);

                createIndexString = string.Format("CREATE INDEX {0}_Idx1 ON {1} (QueryEntry, QueryEntity);", pfamAlignType, dbTableName);
                dbCreator.CreateIndex(dbConnect, createIndexString, dbTableName);

                createIndexString = string.Format("CREATE INDEX {0}_Idx2 ON {1} (HitEntry, HitEntity);", pfamAlignType, dbTableName);
                dbCreator.CreateIndex(dbConnect, createIndexString, dbTableName);

                createIndexString = string.Format("CREATE INDEX {0}_Idx3 ON {1} (QueryEntry, QueryDomainID);", pfamAlignType, dbTableName);
                dbCreator.CreateIndex(dbConnect, createIndexString, dbTableName);

                createIndexString = string.Format("CREATE INDEX {0}_Idx4 ON {1} (HitEntry, HitDomainID);", pfamAlignType, dbTableName);
                dbCreator.CreateIndex(dbConnect, createIndexString, dbTableName);
            }
            else
            {
                createTableString = string.Format("CREATE TABLE {0} ( " +
                                                  " QueryEntry CHAR(4) NOT NULL, QueryChain CHAR(3) NOT NULL, QueryLength INTEGER NOT NULL, " +
                                                  " HitEntry CHAR(4) NOT NULL, HitChain CHAR(3) NOT NULL, HitLength INTEGER NOT NULL, " +
                                                  " Align_Len INTEGER NOT NULL, Score FLOAT NOT NULL, Gaps INTEGER NOT NULL, " +
                                                  " E_Value DOUBLE PRECISION NOT NULL, Identity FLOAT NOT NULL, Similarity FLOAT NOT NULL, " +
                                                  " AlignmentLength INTEGER NOT NULL, " +
                                                  " QuerySequence BLOB Sub_Type TEXT NOT NULL, HitSequence BLOB Sub_Type TEXT NOT NULL, " +
                                                  " QueryStart INTEGER NOT NULL, QueryEnd INTEGER NOT NULL, " +
                                                  " HitStart INTEGER NOT NULL, HitEnd INTEGER NOT NULL, " +
                                                  " QueryAsymChain CHAR(3), HitAsymChain CHAR(3));",
                                                  dbTableName);

                dbCreator.CreateTableFromString(dbConnect, createTableString, dbTableName);

                createIndexString = string.Format("CREATE INDEX FatcatAlign_Idx1 ON {0} (QueryEntry, QueryChain);", dbTableName);
                dbCreator.CreateIndex(dbConnect, createIndexString, dbTableName);

                createIndexString = string.Format("CREATE INDEX FatcatAlign_Idx2 ON {0} (HitEntry, HitChain);", dbTableName);
                dbCreator.CreateIndex(dbConnect, createIndexString, dbTableName);
            }
        }
Example #28
0
        /// <summary>
        ///
        /// </summary>
        private void InitializeBamDbTables()
        {
            DbCreator dbCreator         = new DbCreator();
            string    createTableString = "";
            string    createIndexString = "";
            string    tableName         = "pdb_entry";

            createTableString = "Create Table " + tableName + " ( " +
                                "PDB_ID                          CHAR(4) Not Null, " +
                                "TITLE                           BLOB sub_type TEXT Not Null, " +
                                "DESCRIPTION                     BLOB sub_type TEXT Not Null, " +
                                "EXPDTA                          VARCHAR(250) Not Null, " +
                                "KEYWORDS                        VARCHAR(250) Not Null, " +
                                "KEYWORDS_TEXT                   BLOB sub_type TEXT Not Null, " +
                                "PDB_ORI_DATE                    Date Not Null, " +
                                "RESOLUTION                      FLOAT);";
            dbCreator.CreateTableFromString(bamDbConnect, createTableString, tableName);
            createIndexString = "Create Index " + tableName + "_pdb ON " + tableName + "(PDB_ID);";
            dbCreator.CreateIndex(bamDbConnect, createIndexString, tableName);


            tableName         = "pdb_dbref";
            createTableString = "Create Table " + tableName + " ( " +
                                "PDB_ID                          CHAR(4) Not Null, " +
                                "REF_ID                          INTEGER Not Null, " +
                                "ENTITY_ID                       INTEGER Not Null, " +
                                "DB_NAME                         VARCHAR(10) Not Null, " +
                                "DB_CODE                         VARCHAR(32) Not Null, " +
                                "DB_ACCESSION                    VARCHAR(32) Not Null);";
            dbCreator.CreateTableFromString(bamDbConnect, createTableString, tableName);
            createIndexString = "Create Index " + tableName + "_pdb ON " + tableName + "(PDB_ID, Entity_ID);";
            dbCreator.CreateIndex(bamDbConnect, createIndexString, tableName);

            tableName         = "pdb_seq";
            createTableString = "Create Table " + tableName + " ( " +
                                "PDB_ID                          CHAR(4) Not Null, " +
                                "ENTITY_ID                       INTEGER Not Null, " +
                                "TYPE                            VARCHAR(64) Not Null, " +
                                "NSTD_MONOMER                    CHAR(1) Not Null, " +
                                "SEQ_CODE                        BLOB sub_type TEXT Not Null, " +
                                "SEQ_CODE_CANONICAL              BLOB sub_type TEXT Not Null);";
            dbCreator.CreateTableFromString(bamDbConnect, createTableString, tableName);
            createIndexString = "Create Index " + tableName + "_pdb ON " + tableName + "(PDB_ID, Entity_ID);";
            dbCreator.CreateIndex(bamDbConnect, createIndexString, tableName);

            tableName         = "pdb_asym_auth";
            createTableString = "Create Table " + tableName + " ( " +
                                "PDB_ID                          CHAR(4) Not Null, " +
                                "ENTITY_ID                       INTEGER Not Null, " +
                                "ASYM_ID                         VARCHAR(3) Not Null, " +
                                "AUTH_ASYM_ID                    VARCHAR(4) Not Null);";
            dbCreator.CreateTableFromString(bamDbConnect, createTableString, tableName);
            createIndexString = "Create Index " + tableName + "_pdb ON " + tableName + "(PDB_ID);";
            dbCreator.CreateIndex(bamDbConnect, createIndexString, tableName);

            tableName         = "pdb_pfam";
            createTableString = "Create Table " + tableName + " ( " +
                                "PDB_ID                          CHAR(4) Not Null, " +
                                "ENTITY_ID                       INTEGER Not Null, " +
                                "MODEL                           VARCHAR(50) Not Null, " +
                                "PFAM_accession                  VARCHAR(10) Not Null, " +
                                "Description                     VARCHAR(1200) Not Null, " +
                                "SEQ_F                           INTEGER Not Null, " +
                                "SEQ_T                           INTEGER Not Null, " +
                                "HMM_F                           INTEGER Not Null, " +
                                "HMM_T                           INTEGER Not Null, " +
                                "SCORE                           FLOAT, " +
                                "E_VALUE                         FLOAT);";
            dbCreator.CreateTableFromString(bamDbConnect, createTableString, tableName);
            createIndexString = "Create Index " + tableName + "_pdb ON " + tableName + "(PDB_ID, Entity_ID);";
            dbCreator.CreateIndex(bamDbConnect, createIndexString, tableName);

            tableName         = "pdb_protbud";
            createTableString = "Create Table " + tableName + " ( " +
                                "PDB_ID                          CHAR(4) Not Null, " +
                                "NAME                            BLOB sub_type TEXT, " +
                                "PDBBUID                         VARCHAR(10) Not Null, " +
                                "PISABUID                        VARCHAR(10) Not Null, " +
                                "ASU_ENTITY                      BLOB sub_type TEXT Not Null, " +
                                "ASU_ASYMID                      BLOB sub_type TEXT Not Null, " +
                                "ASU_AUTH                        BLOB sub_type TEXT Not Null, " +
                                "ASU_ABC                         BLOB sub_type TEXT Not Null, " +
                                "PDBBU_ENTITY                    BLOB sub_type TEXT Not Null, " +
                                "PDBBU_ASYMID                    BLOB sub_type TEXT Not Null, " +
                                "PDBBU_AUTH                      BLOB sub_type TEXT Not Null, " +
                                "PDBBU_ABC                       BLOB sub_type TEXT Not Null, " +
                                "PISABU_ENTITY                   BLOB sub_type TEXT Not Null, " +
                                "PISABU_ASYMID                   BLOB sub_type TEXT Not Null, " +
                                "PISABU_AUTH                     BLOB sub_type TEXT Not Null, " +
                                "PISABU_ABC                      BLOB sub_type TEXT Not Null, " +
                                "SAMEBUS                         CHAR(9), " +
                                "DNA                             CHAR(3), " +
                                "RNA                             CHAR(3), " +
                                "LIGANDS                         CHAR(3), " +
                                "RESOLUTION                      VARCHAR(32));";
            dbCreator.CreateTableFromString(bamDbConnect, createTableString, tableName);
            createIndexString = "Create Index " + tableName + "_pdb ON " + tableName + "(PDB_ID);";
            dbCreator.CreateIndex(bamDbConnect, createIndexString, tableName);
        }