Esempio n. 1
0
        /// <summary>
        /// update domain interfaces for same version of Pfam
        /// </summary>
        public void UpdateDomainInterfaces()
        {
            InitializeThread();

            ProtCidSettings.logWriter.WriteLine(DateTime.Today.ToShortDateString());
            ProtCidSettings.logWriter.WriteLine("Updating Pfam domain interface clusters.");

            DomainInterfaceTables.InitializeTables();
            ProtCidSettings.progressInfo.Reset();
            ProtCidSettings.progressInfo.progStrQueue.Enqueue("Update Pfam domain-domain interface info.");

            string[] updateEntries = GetUpdateEntries();

            ProtCidSettings.progressInfo.progStrQueue.Enqueue("Update domain interface database");
            UpdateDomainInterfacesDb(updateEntries);

            ProtCidSettings.progressInfo.progStrQueue.Enqueue("Update Pfam-Peptide interactions");
            PfamPepInterfaceWriter pepInterfaceWriter = new PfamPepInterfaceWriter();

            pepInterfaceBuilder.UpdatePfamPeptideInteractions(updateEntries);

            ProtCidSettings.progressInfo.progStrQueue.Enqueue("Update Pfam-ligand interactions");
            ligandInteractBuilder.UpdatePfamLigandInteractions(updateEntries);

            ProtCidSettings.progressInfo.progStrQueue.Enqueue("Update peptide-chain comparison");
            pepInterfaceBuilder.UpdatePfamPepChainComparison(updateEntries);

            ProtCidSettings.logWriter.Close();

            ProtCidSettings.progressInfo.threadFinished = true;
        }
Esempio n. 2
0
        public void UpdatePfamDomainInterfaceClusters()
        {
            InitializeThread();
            DomainInterfaceTables.InitializeTables();

            ProtCidSettings.progressInfo.progStrQueue.Enqueue("Comparing entry domain interfaces.");
            //     string[] updateEntries = {/* "4yc3",*/ "4y72"};
            string[] updateEntries = GetReversedOrderDomainInterfaces();
            DomainInterfaceBuComp.CrystBuDomainInterfaceComp domainInterfaceComp =
                new InterfaceClusterLib.DomainInterfaces.DomainInterfaceBuComp.CrystBuDomainInterfaceComp();
            domainInterfaceComp.UpdateCrystBuDomainInterfaceComp(updateEntries);

            /*           UnpInteractionStr unpInterInPdb = new UnpInteractionStr();
             *         unpInterInPdb.UpdateUnpInteractionNetTableFromXml ();
             *         string[] updateEntries = {"4xr8"};
             *         unpInterInPdb.UpdateUnpInteractionNetTable(updateEntries);
             *         PfamDomainInterfaceComp domainComp = new PfamDomainInterfaceComp();
             *         string[] entries = {"5vam", "6cad", "6b8u"};
             *         domainComp.SynchronizeDomainChainInterfaceComp(entries);
             */
            /*           DomainClusterStat clusterStat = new DomainClusterStat();
             *         int[] relSeqIds = { 14511 };
             *         clusterStat.PrintDomainClusteStatInfo(relSeqIds);
             * //          clusterStat.AddMissingRedundantInterfacesToClusterTable ();
             *
             *         int[] updateRelSeqIds = GetUpdateRelSeqIds();
             *         PfamClusterFilesCompress clusterFileCompress = new PfamClusterFilesCompress();
             *         clusterFileCompress.UpdateRelationClusterChainInterfaceFiles(updateRelSeqIds);
             *
             *         string[] updateEntries = GetOtherUpdateEntries();
             *
             *         UpdateDomainInterfacesDb(updateEntries);
             *
             *         ProtCidSettings.progressInfo.progStrQueue.Enqueue("Comparing entry domain interfaces.");
             *         DomainInterfaceBuComp.CrystBuDomainInterfaceComp domainInterfaceComp =
             *             new InterfaceClusterLib.DomainInterfaces.DomainInterfaceBuComp.CrystBuDomainInterfaceComp();
             *         domainInterfaceComp.UpdateCrystBuDomainInterfaceComp (updateEntries);
             *
             *         int[] updateRelSeqIds = GetUpdateRelSeqIds ();
             *         Dictionary<int, string[]> updateRelEntryDict = ReadUpdateRelEntries();
             *
             *         ProtCidSettings.progressInfo.progStrQueue.Enqueue("Updating the comparison of domain interfaces in each relation.");
             *         ProtCidSettings.logWriter.WriteLine("Updating the comparison of domain interfaces in each relation.");
             *         PfamDomainInterfaceComp domainComp = new PfamDomainInterfaceComp();
             * //         domainComp.UpdateEntryDomainInterfaceComp(updateEntries);
             *         domainComp.UpdateEntryDomainInterfaceComp(updateRelEntryDict);
             *
             *         ProtCidSettings.progressInfo.progStrQueue.Enqueue("Update domain interface clusters.");
             *         ProtCidSettings.logWriter.WriteLine("Update domain interface clusters.");
             *         DomainInterfaceCluster domainInterfaceCluster = new DomainInterfaceCluster();
             *         domainInterfaceCluster.ClusterDomainInterfaces();
             *         //     int[] updateRelSeqIds = domainInterfaceCluster.GetUpdateRelSeqIds();
             *         //   domainInterfaceCluster.UpdateDomainInterfaceClusters(updateRelSeqIds);
             *
             *         ProtCidSettings.progressInfo.progStrQueue.Enqueue("Update Domain Interface Cluster Info.");
             *         ProtCidSettings.logWriter.WriteLine("Update Domain Interface Cluster Info.");
             *         DomainClusterStat clusterStat = new DomainClusterStat();
             *     //    clusterStat.PrintDomainDbSumInfo("PfamDomain");
             *         clusterStat.PrintDomainClusterInfo();
             *
             *         //    clusterStat.UpdateDomainClusterInfo(updateRelSeqIds);
             *
             *         ProtCidSettings.progressInfo.progStrQueue.Enqueue("Update cluster file compressing.");
             *         PfamClusterFilesCompress clusterFileCompress = new PfamClusterFilesCompress();
             *         clusterFileCompress.UpdateRelationClusterChainInterfaceFiles(updateRelSeqIds);
             *
             *         ProtCidSettings.progressInfo.progStrQueue.Enqueue("Update domain cluster interface images.");
             *         ProtCidSettings.logWriter.WriteLine("Update domain cluster interface images");
             *         DomainInterfaceImageGen imageGen = new DomainInterfaceImageGen();
             *         //     imageGen.GenerateDomainInterfaceImages();
             *         imageGen.UpdateDomainInterfaceImages(updateRelSeqIds);
             *
             *         DomainSeqFasta seqFasta = new DomainSeqFasta();
             *         seqFasta.PrintClusterDomainSequences();
             *   //      seqFasta.UpdateClusterDomainSequences(updateRelSeqIds); */
        }
Esempio n. 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="stepNum"></param>
        public void BuildDomainInterfaces(int stepNum)
        {
            InitializeThread();

            DomainInterfaceTables.InitializeTables();
            ProtCidSettings.progressInfo.Reset();
            ProtCidSettings.progressInfo.progStrQueue.Enqueue("Retrieving domain-domain interactions.");

            /*    ProtCidSettings.progressInfo.progStrQueue.Enqueue("Creating database tables.");
             *  DomainInterfaceTables.InitializeDbTables();
             *  ProtCidSettings.progressInfo.progStrQueue.Enqueue("Done.");
             */
            switch (stepNum)
            {
            case 1:
                ProtCidSettings.progressInfo.progStrQueue.Enqueue("Detecting domain-domain interactions from cryst chain interfaces.");
                DomainClassifier domainClassifier = new DomainClassifier();
                domainClassifier.RetrieveDomainInterfaces();
                ProtCidSettings.progressInfo.currentOperationIndex++;
                //	goto case 1;
                break;

            case 2:
                ProtCidSettings.progressInfo.progStrQueue.Enqueue("Write domain interface files.");
                DomainInterfaceWriter domainInterfaceWriter = new DomainInterfaceWriter();
                domainInterfaceWriter.WriteDomainInterfaceFiles();
                //      domainInterfaceWriter.UpdateDomainInterfaceFiles();
                //        domainInterfaceWriter.WriteMultiChainDomainInterfaces();
                ProtCidSettings.progressInfo.currentOperationIndex++;

                ProtCidSettings.progressInfo.progStrQueue.Enqueue("Calculate SAs of domain interface files.");
                DomainInterfaceSA interfaceSa = new DomainInterfaceSA();
                //   interfaceSa.UpdateDomainInterfaceSAs();
                interfaceSa.CalculateDomainInterfaceSAs();
                ProtCidSettings.progressInfo.currentOperationIndex++;
                //   goto case 2;
                break;

            case 3:
                ProtCidSettings.progressInfo.progStrQueue.Enqueue("Comparing domain interfaces.");
                PfamDomainInterfaceComp domainComp = new PfamDomainInterfaceComp();
                domainComp.CompareDomainInterfaces();

                /*   domainComp.SynchronizeDomainChainInterfaceComp();
                 *  domainComp.CompareSpecificDomainInterfaces ();
                 *  domainComp.UpdateMultiChainDomainInterfaces();
                 */
                ProtCidSettings.progressInfo.currentOperationIndex++;
                break;

            case 4:
                ProtCidSettings.progressInfo.progStrQueue.Enqueue("Comparing entry domain interfaces.");
                DomainInterfaceBuComp.CrystBuDomainInterfaceComp domainInterfaceComp =
                    new InterfaceClusterLib.DomainInterfaces.DomainInterfaceBuComp.CrystBuDomainInterfaceComp();
                //    int[] relSeqIds = {10515 };
                //     domainInterfaceComp.UpdateCrystBuDomainInterfaceComp(relSeqIds);
                domainInterfaceComp.CompareCrystBuDomainInterfaces();
                ProtCidSettings.progressInfo.currentOperationIndex++;
                break;


            case 5:
                ProtCidSettings.progressInfo.progStrQueue.Enqueue("Cluster domain interfaces.");
                DomainInterfaceCluster interfaceCluster = new DomainInterfaceCluster();
                int[] relSeqIds = { 2 };
                interfaceCluster.UpdateDomainInterfaceClusters(relSeqIds);
//                    interfaceCluster.ClusterDomainInterfaces();
                // interfaceCluster.ClusterLeftRelations();
                break;
            //    goto case 4;

            case 6:
                ProtCidSettings.progressInfo.progStrQueue.Enqueue("Print Domain Interface Cluster Info.");
                DomainClusterStat clusterStat     = new DomainClusterStat();
                int[]             updateRelSeqIds = { 2 };
                clusterStat.UpdateDomainClusterInfo(updateRelSeqIds);
                //                   clusterStat.PrintDomainClusterInfo();
                //            clusterStat.PrintDomainDbSumInfo("PfamDomain");
                //           clusterStat.AddNumCFsToIPfamInPdbMetaData();



                //      clusterStat.PrintPartialDomainClusterInfo();
                //      clusterStat.GetPfamDomainSumInfo();

                /*                  DomainInterfaceStatInfo statInfo = new DomainInterfaceStatInfo();
                 *          //      statInfo.PrintPepInteractingHmmSites();
                 *                //     statInfo.GetPfamPepInterfaceClusterInfo();
                 *                //    statInfo.PrintPepLigandHmmSites ();
                 *                    statInfo.PrintPfamDomainRelationInfo();
                 *                //    statInfo.GetGenAsymChainDomainInterfaces();*/
                break;
            //    goto case 7;

            case 7:
                PfamClusterFilesCompress clusterFileCompress = new PfamClusterFilesCompress();
                clusterFileCompress.CompressPfamClusterChainInterfaceFiles();
                clusterFileCompress.RetrieveCrystInterfaceFilesNotInClusters(true);

                DomainSeqFasta seqFasta = new DomainSeqFasta();
                seqFasta.PrintClusterDomainSequences();

                DomainInterfaceImageGen imageGen = new DomainInterfaceImageGen();
                imageGen.GenerateDomainInterfaceImages();

                PfamRelNetwork pfamNetWriter = new PfamRelNetwork();
                pfamNetWriter.GeneratePfamNetworkGraphmlFiles();

                // build the unp-unp interaction table based on pdb domain interfaces
                UnpInteractionStr unpInteract = new UnpInteractionStr();
                unpInteract.BuildUnpInteractionNetTable();
                break;

            case 8:      // about peptide interfaces
                PfamPeptideInterfaces pepInterfaces = new PfamPeptideInterfaces();
                pepInterfaceBuilder.BuildPfamPeptideInterfaces();
                break;

            case 9:
                //          ligandInteractBuilder.AddClusterInfoToPfamDomainAlign();

                ligandInteractBuilder.BuildPfamLigandInteractions();
                break;

            default:
                break;
            }
            ProtCidSettings.logWriter.Close();

            ProtCidSettings.progressInfo.threadFinished = true;
        }
Esempio n. 4
0
        /// <summary>
        ///
        /// </summary>
        public void UpdateDomainInterfaces(int step)
        {
            InitializeThread();

            ProtCidSettings.logWriter.WriteLine(DateTime.Today.ToShortDateString());
            ProtCidSettings.logWriter.WriteLine("Updating Pfam domain interface clusters.");

            DomainInterfaceTables.InitializeTables();
            ProtCidSettings.progressInfo.Reset();
            ProtCidSettings.progressInfo.progStrQueue.Enqueue("Update Pfam domain-domain interface info.");

            //       string[] updateEntries = GetUpdateEntries();
            // for update peptide/ligands
            //        string[] updateEntries = GetOtherUpdateEntries(@"D:\Qifang\ProjectData\DbProjectData\PDB\updateEntries_ligandsDif.txt");
            //         string[] updateEntries = GetOtherUpdateEntries(@"D:\Qifang\ProjectData\DbProjectData\PDB\MissingChainPepEntries.txt");
            //         string[] updateEntries = GetMissingDomainInterfaceEntries();
            string[] updateEntries = { "2gs0" };

            switch (step)
            {
            case 1:
                ProtCidSettings.progressInfo.progStrQueue.Enqueue("Update domain interface database");
                UpdateDomainInterfacesDb(updateEntries);

                /*               int[] updateRelSeqIds = { 10348 };
                 *              PfamClusterFilesCompress clusterFileCompress = new PfamClusterFilesCompress();
                 *             clusterFileCompress.UpdateRelationClusterChainInterfaceFiles(updateRelSeqIds);
                 *             string updateRelEntryFile = "UpdateRelationEntries.txt";
                 *             UpdateDomainInterfacesDb(updateRelEntryFile);
                 * //
                 * //             updateEntries = GetOtherUpdateEntries();
                 *             updateEntries = new string[1];
                 *             updateEntries[0] = "3mtj";
                 *             DomainInterfaceBuComp.CrystBuDomainInterfaceComp domainInterfaceComp =
                 *                     new InterfaceClusterLib.DomainInterfaces.DomainInterfaceBuComp.CrystBuDomainInterfaceComp();
                 *             domainInterfaceComp.UpdateCrystBuDomainInterfaceComp(updateEntries);
                 *             DomainClusterStat clusterStat = new DomainClusterStat();
                 *             clusterStat.UpdateBACompInfo();
                 *             DomainSeqFasta seqFasta = new DomainSeqFasta();
                 *             int[] updateRelSeqIds = { 2986};
                 *             seqFasta.UpdateClusterDomainSequences(updateRelSeqIds);*/
                break;

            case 2:
                ProtCidSettings.progressInfo.progStrQueue.Enqueue("Update Pfam-Peptide interactions");
                //   pepInterfaceBuilder.UpdatePfamPeptideInteractions(updateEntries);
                pepInterfaceBuilder.UpdateSomePfamPeptideInteractionsDebug();
                break;

            case 3:
                ProtCidSettings.progressInfo.progStrQueue.Enqueue("Update Pfam-ligand interactions");
                ligandInteractBuilder.UpdatePfamLigandInteractions(updateEntries);

                /*   ligandInteractBuilder.DebugPfamLigandInteractions();
                 *   ligandInteractBuilder.UpdatePfamLigandInteractions(updateDnaEntries, updateEntries);
                 *   PfamDomainFileCompress domainCompress = new PfamDomainFileCompress();
                 *   domainCompress.CompressPfamDomainFiles ();*/
                ProtCidSettings.logWriter.Flush();

                break;

            case 4:
                ProtCidSettings.progressInfo.progStrQueue.Enqueue("Update peptide-chain comparison");
                pepInterfaceBuilder.UpdatePfamPepChainComparison(updateEntries);
                break;

            default:
                break;
            }
            ProtCidSettings.logWriter.Close();

            ProtCidSettings.progressInfo.threadFinished = true;
        }