Пример #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="domainEntityInfo"></param>
        /// <param name="chainInfo"></param>
        /// <returns></returns>
        private AtomInfo[] GetDomainSegmentAtoms(DomainSegmentInfo domainEntityInfo, ChainAtoms chainInfo)
        {
            ArrayList domainAtomList = new ArrayList();
            int       seqId          = -1;

            foreach (AtomInfo atom in chainInfo.CartnAtoms)
            {
                seqId = Convert.ToInt16(atom.seqId);
                if (seqId >= domainEntityInfo.seqStart && seqId <= domainEntityInfo.seqEnd)
                {
                    //     AddAtomToList(atom, domainAtomList);
                    domainAtomList.Add(atom);
                }
            }
            AtomInfo[] domainAtoms = new AtomInfo[domainAtomList.Count];
            domainAtomList.CopyTo(domainAtoms);
            return(domainAtoms);
        }
Пример #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="domainSegInfo"></param>
 /// <param name="entryEntityInfos"></param>
 /// <returns></returns>
 private string[] GetDomainSegmentThreeLetterResidues(DomainSegmentInfo domainSegInfo, EntityInfo[] entryEntityInfos)
 {
     foreach (EntityInfo entityInfo in entryEntityInfos)
     {
         if (entityInfo.entityId == domainSegInfo.entityId)
         {
             string[] residues        = entityInfo.threeLetterSeq.TrimEnd(' ').Split(' ');
             string[] segmentResidues = new string[domainSegInfo.seqEnd - domainSegInfo.seqStart + 1];
             try
             {
                 Array.Copy(residues, domainSegInfo.seqStart - 1, segmentResidues, 0,
                            domainSegInfo.seqEnd - domainSegInfo.seqStart + 1);
                 return(segmentResidues);
             }
             catch (Exception ex)
             {
                 throw new Exception("Get Segment three letter sequences error: " + ex.Message);
             }
         }
     }
     return(null);
 }
Пример #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="pdbId"></param>
        public string[] GenerateEntryPfamDomainFiles(string pdbId)
        {
            DataTable entryPfamTable = GetEntryPfamDomainTable(pdbId);

            if (entryPfamTable.Rows.Count == 0) // no pfam domain definition for the entry
            {
                return(null);
            }
            ArrayList entryDomainInfoList = new ArrayList();
            ArrayList domainList          = new ArrayList();

            foreach (DataRow domainRow in entryPfamTable.Rows)
            {
                string domainId = domainRow["DomainID"].ToString();
                if (!domainList.Contains(domainId))
                {
                    domainList.Add(domainId);
                }
            }
            string    domainFile          = "";
            Hashtable entityChainInfoHash = new Hashtable();

            foreach (string domainId in domainList)
            {
                domainFile = Path.Combine(pfamDomainFileDir, pdbId.Substring(1, 2) + "\\" +
                                          pdbId + domainId + ".pfam.gz");
                if (File.Exists(domainFile))
                {
                    continue;
                }
                DataRow[]      domainRows = entryPfamTable.Select(string.Format("DomainID = '{0}'", domainId), "HmmStart ASC");
                PfamDomainInfo domainInfo = new PfamDomainInfo();
                domainInfo.pdbId    = pdbId;
                domainInfo.domainId = domainId;
                domainInfo.pfamAcc  = domainRows[0]["Pfam_ACC"].ToString().TrimEnd();
                domainInfo.pfamId   = domainRows[0]["Pfam_ID"].ToString().TrimEnd();
                DomainSegmentInfo[] segmentInfos = new DomainSegmentInfo[domainRows.Length];
                int count = 0;
                foreach (DataRow domainRow in domainRows)
                {
                    DomainSegmentInfo segmentInfo = new DomainSegmentInfo();
                    segmentInfo.entityId = Convert.ToInt32(domainRow["EntityId"].ToString());
                    string[] chainInfos = GetAsymAuthorChainWithMaxCoord(pdbId, segmentInfo.entityId, ref entityChainInfoHash);
                    segmentInfo.asymChain  = chainInfos[0];
                    segmentInfo.authChain  = chainInfos[1];
                    segmentInfo.seqStart   = Convert.ToInt32(domainRow["SeqStart"].ToString());
                    segmentInfo.seqEnd     = Convert.ToInt32(domainRow["SeqEnd"].ToString());
                    segmentInfo.hmmStart   = Convert.ToInt32(domainRow["HmmStart"].ToString());
                    segmentInfo.hmmEnd     = Convert.ToInt32(domainRow["HmmEnd"].ToString());
                    segmentInfo.alignStart = Convert.ToInt32(domainRow["AlignStart"].ToString());
                    segmentInfo.alignEnd   = Convert.ToInt32(domainRow["AlignEnd"].ToString());
                    segmentInfos[count]    = segmentInfo;
                    count++;
                }
                domainInfo.segmentInfos = segmentInfos;
                entryDomainInfoList.Add(domainInfo);
            }
            PfamDomainInfo[] entryDomainInfos = new PfamDomainInfo[entryDomainInfoList.Count];
            entryDomainInfoList.CopyTo(entryDomainInfos);
            string[] domainFiles = GenerateEntryPfamDomainFiles(pdbId, entryDomainInfos);
            return(domainFiles);
        }