Logo Search packages:      
Sourcecode: python-biopython version File versions

def Bio::PDB::StructureAlignment::StructureAlignment::__init__ (   self,
  fasta_align,
  m1,
  m2,
  si = 0,
  sj = 1 
)

fasta_align --- A Bio.Fasta.FastaAlign object 
m1, m2 --- two models
si, sj --- the sequences in the Bio.Fasta.FastaAlign object that
correspond to the structures

Definition at line 17 of file StructureAlignment.py.

00017                                                        :
        """
        fasta_align --- A Bio.Fasta.FastaAlign object 
        m1, m2 --- two models
        si, sj --- the sequences in the Bio.Fasta.FastaAlign object that
                correspond to the structures
        """
        l=fasta_align.get_alignment_length()
        s1=fasta_align.get_seq_by_num(si)
        s2=fasta_align.get_seq_by_num(sj)
        # Get the residues in the models
        rl1=Selection.unfold_entities(m1, 'R')
        rl2=Selection.unfold_entities(m2, 'R')
        # Residue positions
        p1=0
        p2=0
        # Map equivalent residues to each other
        map12={}
        map21={}
        # List of residue pairs (None if -)
        duos=[]
        for i in range(0, l):
            column=fasta_align.get_column(i)
            aa1=column[si]
            aa2=column[sj]
            if aa1!="-":
                # Position in seq1 is not -
                while 1:
                    # Loop until an aa is found
                    r1=rl1[p1]
                    p1=p1+1
                    if is_aa(r1):
                        break
                self._test_equivalence(r1, aa1)
            else:
                r1=None
            if aa2!="-":
                # Position in seq2 is not -
                while 1:
                    # Loop until an aa is found
                    r2=rl2[p2]
                    p2=p2+1
                    if is_aa(r2):
                        break
                self._test_equivalence(r2, aa2)
            else:
                r2=None
            if r1:
                # Map residue in seq1 to its equivalent in seq2
                map12[r1]=r2
            if r2:
                # Map residue in seq2 to its equivalent in seq1
                map21[r2]=r1
            # Append aligned pair (r is None if gap)
            duos.append((r1, r2))
        self.map12=map12
        self.map21=map21
        self.duos=duos

    def _test_equivalence(self, r1, aa1):


Generated by  Doxygen 1.6.0   Back to index