/// <summary> /// insert data into database /// </summary> private void InsertDataIntoDb() { dbInsert.InsertDataIntoDBtables(ProtCidSettings.protcidDbConnection, HomoGroupTables.homoGroupTables[HomoGroupTables.HomoSeqInfo]); InsertAlignmentData(); HomoGroupTables.ClearTables(); }
/// <summary> /// /// </summary> /// <param name="groupSeqId"></param> private void InsertUpdateDataIntoDb(int groupSeqId) { UpdateAlignmentData(groupSeqId); DeletePfamHomoGroupInfo(groupSeqId); dbInsert.InsertDataIntoDBtables(ProtCidSettings.protcidDbConnection, HomoGroupTables.homoGroupTables[HomoGroupTables.HomoSeqInfo]); HomoGroupTables.ClearTables(); }
public void ClassifyHomoEntries(string[] entryList) { InitializeTables(); DeleteObsHomoGroupDataInDb(groupSeqNum); AddEntryDataToTable(entryList, groupSeqNum); RetrieveRepEntries(); dbInsert.InsertDataIntoDBtables(ProtCidSettings.protcidDbConnection, HomoGroupTables.homoGroupTables); HomoGroupTables.ClearTables(); }
/// <summary> /// initialize tables /// </summary> /// <param name="isUpdate"></param> protected void InitializeTables(bool isUpdate) { // create tables in memory HomoGroupTables.InitializeTables(); if (!isUpdate) { HomoGroupTables.InitializeAllGroupDbTables(); // reuse the alignments data // HomoGroupTables.InitializeGroupTable(); // HomoGroupTables.AddFlagColumn (); } }
/// <summary> /// classify pfam group into subgroups based on /// number of entities and domain families /// </summary> /// <param name="entryList"></param> private void UpdateEntryPfamArchGroupTables(int groupSeqId, string[] groupEntries) { AddEntryDataToTable(groupEntries, groupSeqId); UpdateHomoGroupRepAlignTables(); DeletePfamHomoGroupInfo(groupSeqId); dbInsert.InsertDataIntoDBtables(ProtCidSettings.protcidDbConnection, HomoGroupTables.homoGroupTables[HomoGroupTables.HomoSeqInfo]); HomoGroupTables.ClearTables(); entryAlignment.entryEntityFamilyTable.Clear(); }
/// <summary> /// used for user-defined groups /// </summary> /// <param name="entryList"></param> /// <param name="groupName"></param> public void ClassifyHomoEntries(string[] entryList, string groupName) { InitializeTables(); DeleteObsHomoGroupDataInDb(groupSeqNum); DataRow familyRow = HomoGroupTables.homoGroupTables[HomoGroupTables.FamilyGroups].NewRow(); familyRow["GroupSeqId"] = groupSeqNum; familyRow["FamilyString"] = groupName; HomoGroupTables.homoGroupTables[HomoGroupTables.FamilyGroups].Rows.Add(familyRow); AddEntryDataToTable(entryList, groupSeqNum); RetrieveRepEntries(); dbInsert.InsertDataIntoDBtables(ProtCidSettings.protcidDbConnection, HomoGroupTables.homoGroupTables); HomoGroupTables.ClearTables(); }
/// <summary> /// /// </summary> /// <param name="pdbId1"></param> /// <param name="pdbId2"></param> public DataTable GetEntryAlignmentInfoFromAlignmentsTables(string pdbId1, string pdbId2) { if (HomoGroupTables.homoGroupTables == null) { HomoGroupTables.InitializeTables(); } HomoGroupTables.homoGroupTables[HomoGroupTables.HomoRepEntryAlign].Clear(); string[] homoEntries = new string[1]; homoEntries[0] = pdbId2; entryAlignment.RetrieveRepEntryAlignment(pdbId1, homoEntries, -1); GetHomoEntryAlignAsymInfo(ref HomoGroupTables.homoGroupTables[HomoGroupTables.HomoRepEntryAlign]); return(HomoGroupTables.homoGroupTables[HomoGroupTables.HomoRepEntryAlign]); // return alignInfoTable; }
/// <summary> /// /// </summary> /// <param name="updateGroups"></param> public void UpdateGroupMissingEntryAlignments(int[] updateGroups) { HomoGroupTables.InitializeTables(); InitializeEntityCrcRepTable(); delDataWriter = new StreamWriter("DeletedAlignData.txt", true); delDataWriter.WriteLine(DateTime.Today.ToShortDateString()); ProtCidSettings.progressInfo.ResetCurrentProgressInfo(); ProtCidSettings.progressInfo.progStrQueue.Enqueue("Retrieve rep entries alignments info in each group."); ProtCidSettings.progressInfo.currentOperationLabel = "Alignments info"; string tableName = ProtCidSettings.dataType + "HomoGroupEntryAlign"; ProtCidSettings.logWriter.WriteLine(tableName); ProtCidSettings.logWriter.WriteLine("Retrieve rep entries alignments info in each group."); ProtCidSettings.progressInfo.ResetCurrentProgressInfo(); ProtCidSettings.progressInfo.progStrQueue.Enqueue(tableName); ProtCidSettings.progressInfo.totalOperationNum = updateGroups.Length; ProtCidSettings.progressInfo.totalStepNum = updateGroups.Length; foreach (int groupId in updateGroups) { ProtCidSettings.progressInfo.currentFileName = groupId.ToString(); ProtCidSettings.progressInfo.currentOperationNum++; ProtCidSettings.progressInfo.currentStepNum++; try { DataTable missingAlignTable = GetMissingAlignTable(groupId, tableName); if (missingAlignTable.Rows.Count == 0) { continue; } string[] groupEntries = GetGroupAlignEntries(missingAlignTable); SetEntryPdbCrcMapTable(groupEntries); UpdateMissingAlignEntryTable(groupId, missingAlignTable, entityCrcRepTable); } catch (Exception ex) { ProtCidSettings.logWriter.WriteLine(groupId + " " + ex.Message); ProtCidSettings.logWriter.Flush(); ProtCidSettings.progressInfo.progStrQueue.Enqueue(groupId + " " + ex.Message); } } ProtCidSettings.progressInfo.progStrQueue.Enqueue(tableName + " Done!"); tableName = ProtCidSettings.dataType + "HomoRepEntryAlign"; ProtCidSettings.logWriter.WriteLine(tableName); ProtCidSettings.logWriter.WriteLine("Retrieve rep entries alignments info in each group."); ProtCidSettings.progressInfo.ResetCurrentProgressInfo(); ProtCidSettings.progressInfo.progStrQueue.Enqueue(tableName); ProtCidSettings.progressInfo.totalOperationNum = updateGroups.Length; ProtCidSettings.progressInfo.totalStepNum = updateGroups.Length; foreach (int groupId in updateGroups) { ProtCidSettings.progressInfo.currentFileName = groupId.ToString(); ProtCidSettings.progressInfo.currentOperationNum++; ProtCidSettings.progressInfo.currentStepNum++; try { DataTable missingAlignTable = GetMissingAlignTable(groupId, tableName); if (missingAlignTable.Rows.Count == 0) { continue; } string[] groupEntries = GetGroupAlignEntries(missingAlignTable); SetEntryPdbCrcMapTable(groupEntries); UpdateMissingAlignEntryTable(groupId, missingAlignTable, entityCrcRepTable); } catch (Exception ex) { ProtCidSettings.logWriter.WriteLine(groupId + " " + ex.Message); ProtCidSettings.logWriter.Flush(); ProtCidSettings.progressInfo.progStrQueue.Enqueue(groupId + " " + ex.Message); } } delDataWriter.Close(); ProtCidSettings.progressInfo.progStrQueue.Enqueue(tableName + " Done!"); ProtCidSettings.progressInfo.progStrQueue.Enqueue("Done!"); ProtCidSettings.logWriter.WriteLine("Done!"); }
/// <summary> /// initialize tables /// </summary> /// <param name="isUpdate"></param> protected void InitializeTables() { // create tables in memory HomoGroupTables.InitializeTables(); GetDuplicateSgHash(); }