Exemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="domainInterfaceId"></param>
        /// <param name="domainInterfaceTable"></param>
        /// <param name="pdbpfamTable"></param>
        /// <param name="chainAtomsHash"></param>
        /// <returns></returns>
        private DomainInterface ReadIntraDomainInterfaceFromChain(int domainInterfaceId, DataTable domainInterfaceTable,
                                                                  DataTable pdbpfamTable, Dictionary <string, ChainAtoms> chainAtomsHash)
        {
            DomainInterface domainInterface = new DomainInterface();

            DataRow[] domainInterfaceRows = domainInterfaceTable.Select(string.Format("DomainInterfaceID = '{0}'", domainInterfaceId));
            if (domainInterfaceRows.Length > 0)
            {
                long   domainId1 = Convert.ToInt64(domainInterfaceRows[0]["DomainID1"].ToString());
                long   domainId2 = Convert.ToInt64(domainInterfaceRows[0]["DomainID2"].ToString());
                string asymChain = domainInterfaceRows[0]["AsymChain1"].ToString().TrimEnd();
                if (chainAtomsHash.ContainsKey(asymChain))
                {
                    ChainAtoms chain = chainAtomsHash[asymChain];

                    Range[] domainRanges1 = GetDomainRange(pdbpfamTable, domainId1);
                    Range[] domainRanges2 = GetDomainRange(pdbpfamTable, domainId2);

                    domainInterface.domainInterfaceId = domainInterfaceId;
                    domainInterface.firstSymOpString  = asymChain + "_1_555";
                    domainInterface.secondSymOpString = asymChain + "_1_555";
                    domainInterface.domainId1         = domainId1;
                    domainInterface.domainId2         = domainId2;
                    domainInterface.chain1            = GetDomainAtoms(chain.CartnAtoms, domainRanges1);
                    domainInterface.chain2            = GetDomainAtoms(chain.CartnAtoms, domainRanges2);

                    domainInterface.GetInterfaceResidueDist();
                }
            }
            return(domainInterface);
        }
Exemplo n.º 2
0
        /// <summary>
        /// a list of domain interfaces for the input domainInterfaceIds
        /// </summary>
        /// <param name="srcDir"></param>
        /// <param name="pdbId"></param>
        /// <param name="domainInterfaceIds"></param>
        /// <param name="type"></param>
        /// <returns></returns>
        public DomainInterface[] GetDomainInterfacesFromFiles(string srcDir, string pdbId, int[] domainInterfaceIds, string type)
        {
            DataTable pfamDomainTable = GetEntryPfamDomainTable(pdbId);
            long      domainId        = 0;
            List <DomainInterface> domainInterfaceList = new List <DomainInterface> ();

            srcDir = Path.Combine(srcDir, pdbId.Substring(1, 2));
            string gzDomainInterfaceFile = "";
            string domainInterfaceFile   = "";
            string remark = "";

            if (Directory.Exists(srcDir))
            {
                foreach (int dInterfaceId in domainInterfaceIds)
                {
                    gzDomainInterfaceFile = Path.Combine(srcDir, pdbId + "_d" + dInterfaceId.ToString() + "." + type + ".gz");
                    if (File.Exists(gzDomainInterfaceFile))
                    {
                        InterfaceChains crystInterface = new InterfaceChains();
                        domainInterfaceFile = ParseHelper.UnZipFile(gzDomainInterfaceFile, ProtCidSettings.tempDir);
                        remark = ReadInterfaceChainsFromFile(domainInterfaceFile, ref crystInterface);
                        DomainInterface domainInterface = new DomainInterface(crystInterface);
                        domainInterface.pdbId             = pdbId;
                        domainInterface.remark            = remark;
                        domainInterface.domainInterfaceId = GetDomainInterfaceId(domainInterfaceFile);

                        string[] domainChainStrings = GetDomainChainStrings(remark);
                        domainId = Convert.ToInt64(domainChainStrings[0].Substring(0, domainChainStrings[0].IndexOf("_")));
                        domainInterface.domainId1   = domainId;
                        domainInterface.familyCode1 = GetPfamId(domainId, pfamDomainTable);
                        domainId = Convert.ToInt64(domainChainStrings[1].Substring(0, domainChainStrings[1].IndexOf("_")));
                        domainInterface.domainId2   = domainId;
                        domainInterface.familyCode2 = GetPfamId(domainId, pfamDomainTable);

                        File.Delete(domainInterfaceFile);

                        if (domainInterface.GetInterfaceResidueDist())
                        {
                            domainInterfaceList.Add(domainInterface);
                        }
                    }
                }
            }
            return(domainInterfaceList.ToArray());
        }
Exemplo n.º 3
0
        /// <summary>
        /// get the cryst interfaces from the cryst interface files
        /// </summary>
        /// <param name="pdbId"></param>
        /// <param name="pqsBuId"></param>
        public DomainInterface[] GetDomainInterfacesFromFiles(string srcDir, string pdbId, string type)
        {
            DataTable pfamDomainTable = GetEntryPfamDomainTable(pdbId);
            long      domainId        = 0;

            string searchMode = pdbId + "*." + type + ".gz";
            List <DomainInterface> domainInterfaceList = new List <DomainInterface> ();

            if (Directory.Exists(srcDir))
            {
                string[] interfaceFiles = Directory.GetFiles(Path.Combine(srcDir, pdbId.Substring(1, 2)), searchMode);
                string   remark         = "";
                for (int i = 0; i < interfaceFiles.Length; i++)
                {
                    InterfaceChains crystInterface      = new InterfaceChains();
                    string          domainInterfaceFile = ParseHelper.UnZipFile(interfaceFiles[i], ProtCidSettings.tempDir);
                    remark = ReadInterfaceChainsFromFile(domainInterfaceFile, ref crystInterface);
                    DomainInterface domainInterface = new DomainInterface(crystInterface);
                    domainInterface.pdbId             = pdbId;
                    domainInterface.remark            = remark;
                    domainInterface.domainInterfaceId = GetDomainInterfaceId(domainInterfaceFile);

                    string[] domainChainStrings = GetDomainChainStrings(remark);
                    domainId = Convert.ToInt64(domainChainStrings[0].Substring(0, domainChainStrings[0].IndexOf("_")));
                    domainInterface.domainId1   = domainId;
                    domainInterface.familyCode1 = GetPfamId(domainId, pfamDomainTable);
                    domainId = Convert.ToInt64(domainChainStrings[1].Substring(0, domainChainStrings[1].IndexOf("_")));
                    domainInterface.domainId2   = domainId;
                    domainInterface.familyCode2 = GetPfamId(domainId, pfamDomainTable);

                    File.Delete(domainInterfaceFile);

                    if (domainInterface.GetInterfaceResidueDist())
                    {
                        domainInterfaceList.Add(domainInterface);
                    }
                }
            }
            return(domainInterfaceList.ToArray());
        }
Exemplo n.º 4
0
        /// <summary>
        /// domain-domain interactions with the relation in the BU
        /// </summary>
        /// <param name="domainInterfacesHash">domain interfaces for the BU</param>
        /// <param name="biolUnitHash">the chains and atoms for the BU</param>
        /// <returns>the domain-domain interfaces in the BU</returns>
        private DomainInterface[] GetDomainInterfaces(Dictionary <int, DomainInterfaceComponent> domainInterfacesHash, Dictionary <string, AtomInfo[]> biolUnitHash)
        {
            List <DomainInterface> domainInterfaceList = new List <DomainInterface> ();

            foreach (int domainInterfaceId in domainInterfacesHash.Keys)
            {
                DomainInterfaceComponent component = (DomainInterfaceComponent)domainInterfacesHash[domainInterfaceId];
                AtomInfo[] domainAtoms1            = null;
                AtomInfo[] domainAtoms2            = null;
                foreach (string chainSymOpString in biolUnitHash.Keys)
                {
                    if (component.chainSymOpString1 == chainSymOpString)
                    {
                        domainAtoms1 = GetDomainAtoms((AtomInfo[])biolUnitHash[chainSymOpString],
                                                      component.domainRange1);
                    }
                    if (component.chainSymOpString2 == chainSymOpString)
                    {
                        domainAtoms2 = GetDomainAtoms((AtomInfo[])biolUnitHash[chainSymOpString],
                                                      component.domainRange2);
                    }
                }
                DomainInterface domainInterface = new DomainInterface();
                domainInterface.domainInterfaceId = domainInterfaceId;
                domainInterface.interfaceId       = component.chainInterfaceId;
                domainInterface.chain1            = domainAtoms1;
                domainInterface.chain2            = domainAtoms2;
                domainInterface.firstSymOpString  = component.chainSymOpString1;
                domainInterface.secondSymOpString = component.chainSymOpString2;
                domainInterface.domainId1         = component.domainId1;
                domainInterface.domainId2         = component.domainId2;
                domainInterface.familyCode1       = component.familyCode1;
                domainInterface.familyCode2       = component.familyCode2;
                domainInterface.GetInterfaceResidueDist();
                domainInterfaceList.Add(domainInterface);
            }
            return(domainInterfaceList.ToArray());
        }