Protool/contact_order.py
def calculate_residue_CO(self,residue1,ss=False):
        """Calculate the contact order for a single residue"""
        cutoff=6.0
        contacts=[]
        for residue2 in sorted(self.residues.keys()):
            if residue1==residue2:
                continue
            try:
                if self.dist('%s:CA' %(residue1),'%s:CA' %(residue2))>25.0:
                    continue
            except:
                pass
            for atom1 in self.residues[residue1]:
                for atom2 in self.residues[residue2]:
                    if self.dist(atom1,atom2)<=cutoff:
                        contacts.append(self.res_separation(atom1,atom2,ss=ss))   

        #
        # Calculate the contact order
        #
        #print contacts
        #RCO=sum(contacts)/float(len(contacts))
        #print 'RCO for residue: %5.3f' %RCO
        return contacts
Calculate the contact order for a single residue
Calculate the contact order for a single residue
Calculate the contact order for a single residue
def calculate_residue_CO(self,residue1,ss=False):
        cutoff=6.0
        contacts=[]
        for residue2 in sorted(self.residues.keys()):
            if residue1==residue2:
                continue
            try:
                if self.dist('%s:CA' %(residue1),'%s:CA' %(residue2))>25.0:
                    continue
            except:
                pass
            for atom1 in self.residues[residue1]:
                for atom2 in self.residues[residue2]:
                    if self.dist(atom1,atom2)<=cutoff:
                        contacts.append(self.res_separation(atom1,atom2,ss=ss))   
         Calculate the contact order
        print contacts
        RCO=sum(contacts)/float(len(contacts))
        print 'RCO for residue: %5.3f' %RCO
        return contacts
def calculate_residue_CO ( self , residue1 , ss = False ) : cutoff = 6.0 contacts = [ ] for residue2 in sorted ( self . residues . keys ( ) ) : if residue1 == residue2 : continue try : if self . dist ( '%s:CA' % ( residue1 ) , '%s:CA' % ( residue2 ) ) > 25.0 : continue except : pass for atom1 in self . residues [ residue1 ] : for atom2 in self . residues [ residue2 ] : if self . dist ( atom1 , atom2 ) <= cutoff : contacts . append ( self . res_separation ( atom1 , atom2 , ss = ss ) ) return contacts
Calculate the contact order for a single residue
Calculate the contact order for a single residue
"""Calculate the contact order for a single residue""" # # Calculate the contact order # #print contacts #RCO=sum(contacts)/float(len(contacts)) #print 'RCO for residue: %5.3f' %RCO
self
residue1
ss