Пример #1
0
        /// <summary>
        /// update interface tables
        /// </summary>
        /// <param name="dbName"></param>
        public void UpdateHomoGroupInterfaces(Dictionary <int, string[]> updateGroupHash)
        {
            if (!File.Exists(ProtCidSettings.dirSettings.protcidDbPath))
            {
                ProtCidSettings.progressInfo.progStrQueue.Enqueue("Database not exist. Please check the path, try it again.");
                ProtCidSettings.progressInfo.threadAborted = true;
                return;
            }

            ProtCidSettings.progressInfo.ResetCurrentProgressInfo();

            // build X-ray crystal and detect chain contacts
            ProtCidSettings.progressInfo.ResetCurrentProgressInfo();
            ProtCidSettings.progressInfo.progStrQueue.Enqueue("Update interfaces in a crystal from XML coordinate files.");
            GroupInterfacesRetriever homoGroupInterfaces = new GroupInterfacesRetriever();

            List <int> updateGroupList = new List <int> (updateGroupHash.Keys);
            Dictionary <int, Dictionary <string, List <string> > > groupEntryHash = GetGroupEntries(updateGroupList.ToArray());

            if (groupEntryHash == null || groupEntryHash.Count == 0)
            {
                return;
            }
            homoGroupInterfaces.UpdateGroupInterfacesCompDb(groupEntryHash, updateGroupHash);

            ProtCidSettings.progressInfo.progStrQueue.Enqueue("Done.");

            // finish
            ProtCidSettings.progressInfo.progStrQueue.Enqueue("Database created. ");
        }
Пример #2
0
        /// <summary>
        /// create tables for the specific database
        /// </summary>
        /// <param name="dbName"></param>
        public void DetectHomoGroupInterfaces(int[] updateGroups)
        {
            if (!File.Exists(ProtCidSettings.dirSettings.protcidDbPath))
            {
                ProtCidSettings.progressInfo.progStrQueue.Enqueue("Database not exist. Please check the path, try it again.");
                ProtCidSettings.progressInfo.threadAborted = true;
                return;
            }

            ProtCidSettings.progressInfo.ResetCurrentProgressInfo();

            if (modifyType == "build")
            {
                ProtCidSettings.progressInfo.progStrQueue.Enqueue("Create database tables from schema file.");
                try
                {
                    //          InitializeFamilyTablesInDb();
                    // InitializeResiduesContactsTables();
                    // dbCreator.CreateTablesFromFile (ProtCidSettings.applicationStartPath + "\\dbSchema\\" + ProtCidSettings.dataType + "InterfaceDbSchema.txt");
                }
                catch (Exception ex)
                {
                    ProtCidSettings.progressInfo.progStrQueue.Enqueue(ex.Message);
                    ProtCidSettings.progressInfo.threadAborted = true;
                    return;
                }
                ProtCidSettings.progressInfo.progStrQueue.Enqueue("Done.");
            }

            // build X-ray crystal and detect chain contacts
            ProtCidSettings.progressInfo.ResetCurrentProgressInfo();
            ProtCidSettings.progressInfo.progStrQueue.Enqueue("Detect interfaces in a crystal from XML coordinate files.");
            GroupInterfacesRetriever homoGroupInterfaces = new GroupInterfacesRetriever();

            Dictionary <int, Dictionary <string, List <string> > > groupEntryHash = GetGroupEntries(updateGroups);

            if (groupEntryHash == null || groupEntryHash.Count == 0)
            {
                return;
            }
            homoGroupInterfaces.DetectGroupInterfacesCompDb(groupEntryHash);

            ProtCidSettings.progressInfo.progStrQueue.Enqueue("Done.");

            // finish
            ProtCidSettings.progressInfo.progStrQueue.Enqueue("Database created. ");
        }