/// <summary> /// /// </summary> /// <param name="pdbId"></param> public void WriteDomainDnaRnaInterfaceFiles(string pdbId) { string queryString = string.Format("Select * From PfamDnaRnas Where PdbID = '{0}';", pdbId); DataTable pfamDnaRnaTable = ProtCidSettings.protcidQuery.Query(queryString); int[] chainDomainIds = GetEntryChainDomainIds(pfamDnaRnaTable); queryString = string.Format("Select PdbID, AsymID, PolymerStatus, PolymerType From AsymUnit Where PdbID = '{0}';", pdbId); DataTable entryAsuTable = ProtCidSettings.pdbfamQuery.Query(queryString); Dictionary <string, List <string> > buDomainWithMaxHmmHash = new Dictionary <string, List <string> > (); foreach (int chainDomainId in chainDomainIds) { SelectDomainDnaRnaInterfaces(chainDomainId, pfamDnaRnaTable, ref buDomainWithMaxHmmHash); } List <string> buIdList = new List <string> (buDomainWithMaxHmmHash.Keys); string[] buIds = new string[buIdList.Count]; buIdList.CopyTo(buIds); Dictionary <string, Dictionary <string, AtomInfo[]> > entryBuHash = buGenerator.BuildPdbBus(pdbId, buIds, true); EntryCrystal thisEntryCrystal = buGenerator.ReadEntryCrystalFromXml(pdbId); string domainFile = ""; string chainId = ""; string chainSymOp = ""; foreach (string buId in buDomainWithMaxHmmHash.Keys) { List <string> domainSymOpList = buDomainWithMaxHmmHash[buId]; string[][] nonProtChainSymOps = GetAllNonProtChainSymOps(pdbId, buId, entryAsuTable); string[] dnaRnaChainSymOps = nonProtChainSymOps[0]; string[] ligandChainSymOps = nonProtChainSymOps[1]; if (dnaRnaChainSymOps.Length == 0) { continue; } foreach (string domainSymOp in domainSymOpList) { // string[] dnaRnaChains = GetInteractingDnaRnaChainSymOps(pdbId, buId, domainSymOp, pfamDnaRnaTable); string[] domainSymOpFields = SeparateDomainFields(domainSymOp); chainId = GetDomainChainId(pdbId, buId, Convert.ToInt32(domainSymOpFields[0]), domainSymOpFields[1], pfamDnaRnaTable); chainSymOp = chainId + "_" + domainSymOpFields[1]; domainFile = Path.Combine(pfamDnaRnaDir, pdbId + domainSymOpFields[0] + ".pfam"); // WriteDomainDnaRnaInterfaceFiles(pdbId, buId, chainSymOp, dnaRnaChains, buHash, thisEntryCrystal, domainFile); try { WriteDomainDnaRnaInterfaceFiles(pdbId, buId, chainSymOp, dnaRnaChainSymOps, ligandChainSymOps, entryBuHash[buId], thisEntryCrystal, domainFile); } catch (Exception ex) { ProtCidSettings.logWriter.WriteLine(pdbId + " " + domainSymOp + " domain-DNA/RNA interface error: " + ex.Message); ProtCidSettings.logWriter.Flush(); } } } }
/// <summary> /// /// </summary> /// <param name="pdbId"></param> /// <returns></returns> public Dictionary <string, Dictionary <string, AtomInfo[]> > GetPdbBiolUnits(string pdbId, string[] nonMonomerBUs) { PdbBuGenerator pdbBuBuilder = new PdbBuGenerator(); string zippedXmlFile = Path.Combine(ProtCidSettings.dirSettings.coordXmlPath, pdbId + ".xml.gz"); string xmlFile = ParseHelper.UnZipFile(zippedXmlFile, ProtCidSettings.tempDir); // Hashtable pdbBiolUnits = pdbBuBuilder.BuildPdbBusFromCoordFile(xmlFile, nonMonomerBUs, "ALL"); Dictionary <string, Dictionary <string, AtomInfo[]> > pdbBiolUnits = pdbBuBuilder.BuildPdbBus(pdbId, nonMonomerBUs, false); if (pdbBiolUnits.Count == 0) { if (IsEntryNmrStructure(pdbId)) { Dictionary <string, Dictionary <string, AtomInfo[]> > asymUnitHash = GetAsymUnit(pdbId); // the BuID is set to be 1 for NMR structure // the NMR biological unit is same as asymunit pdbBiolUnits.Add("1", asymUnitHash["0"]); } } File.Delete(xmlFile); return(pdbBiolUnits); }
/// <summary> /// /// </summary> /// <param name="pdbId"></param> /// <param name="chainDnaRnaTable"></param> public void RetrieveChainDnaRnaInteractions(string pdbId) { string[][] protDnaRnaChains = GetProtDnaRnaChains(pdbId); string[] protChains = protDnaRnaChains[0]; string[] dnaRnaChains = protDnaRnaChains[1]; if (protChains.Length == 0 || dnaRnaChains.Length == 0) { return; } string[] protDnaRnaBuIds = GetBiolAssembliesWithBothChains(pdbId, protChains, dnaRnaChains); Dictionary <string, Dictionary <string, AtomInfo[]> > protDnaRnaBuHash = buGenerator.BuildPdbBus(pdbId, protDnaRnaBuIds, true); // protein chain - DNA/RNA interactios from biological assemblies in the PDB foreach (string buId in protDnaRnaBuIds) { Dictionary <string, AtomInfo[]> buHash = protDnaRnaBuHash[buId]; RetrieveProtDnaRnaInteractions(pdbId, buId, buHash, protChains, dnaRnaChains); } // retrieve protein-DNA/RNA interactions RetrieveChainDnaRnaInteractionsInAsu(pdbId, protChains, dnaRnaChains); }