/// <summary> /// Add residues with no-coordinates or no-Calpha to the alignment /// </summary> /// <param name="alignInfo1"></param> /// <param name="alignInfo2"></param> public void AddDisorderResiduesToDomainAlignment(ref DomainAlignSeqInfo alignInfo1, ref DomainAlignSeqInfo alignInfo2) { List <string> pdbList = new List <string> (); pdbList.Add(alignInfo1.pdbId); if (!pdbList.Contains(alignInfo2.pdbId)) { pdbList.Add(alignInfo2.pdbId); } DataTable seqTable = GetSequenceTable(pdbList, asuSeqInfoTable); // the sequence in coordinate and sequence from the domain files which are used to FATCAT align string[] domainSequences1 = GetDomainFileSequences(alignInfo1.pdbId, alignInfo1.domainId, seqTable); string[] domainSequences2 = GetDomainFileSequences(alignInfo2.pdbId, alignInfo2.domainId, seqTable); // if there are no disorder residues in the domain sequences, do nothing if (!IsSequenceWithDisorderResidues(domainSequences1[0]) && !IsSequenceWithDisorderResidues(domainSequences2[0])) { return; } try { if (HasMissingResidues(alignInfo1.alignSequence, alignInfo1.alignStart, alignInfo1.alignEnd)) { int[] alignXmlSeq1 = ConvertSeqToXmlSeq(ref alignInfo1, domainSequences1[0]); // from sequence of the domain file string[] alignSequences = FillMissingResidues(alignInfo1.alignSequence, alignXmlSeq1, domainSequences1[1], alignInfo2.alignSequence); alignInfo1.alignSequence = alignSequences[0]; alignInfo2.alignSequence = alignSequences[1]; } } catch (Exception ex) { throw ex; } try { if (HasMissingResidues(alignInfo2.alignSequence, alignInfo2.alignStart, alignInfo2.alignEnd)) { int[] alignXmlSeq2 = ConvertSeqToXmlSeq(ref alignInfo2, domainSequences2[0]); string[] alignSequences = FillMissingResidues(alignInfo2.alignSequence, alignXmlSeq2, domainSequences2[1], alignInfo1.alignSequence); alignInfo2.alignSequence = alignSequences[0]; alignInfo1.alignSequence = alignSequences[1]; } } catch (Exception ex) { throw ex; } }
/// <summary> /// residue numbers to xml numbers /// </summary> /// <param name="alignInfo"></param> /// <param name="seqTable"></param> /// <returns></returns> private int[] ConvertSeqToXmlSeq(ref DomainAlignSeqInfo alignInfo, string domainSeqInCoord) { string nonGapAlignString = GetNonGapSequenceString(alignInfo.alignSequence); int[] xmlSeqIndexes = GetXmlIndexes(nonGapAlignString, domainSeqInCoord); /* if (xmlSeqNumbers.Length == 0) * { * xmlSeqNumbers = MatchSequencesByBlast(nonGapAlignString, domainSeqInCoord); * }*/ if (xmlSeqIndexes.Length == 0) { return(null); } alignInfo.alignStart = xmlSeqIndexes[0] + 1; // added 1 on January 4, 2017 alignInfo.alignEnd = xmlSeqIndexes[xmlSeqIndexes.Length - 1] + 1; return(xmlSeqIndexes); }