Protool/contact_order.py
def calculate_RCO(self,ss=False,elec_CO=False):
        """Calculate the relative contact order for the soup. Setting ss to True will lead to the sequence distance being determine using SS bridges"""
        cutoff=6.0
        contacts={}
        done={}
        if hasattr(self,'sep_results'):
            delattr(self,'sep_results')
        for residue1 in sorted(self.residues.keys()):
            print residue1, 
            import sys
            if elec_CO:
                contacts[residue1]=self.calculate_residue_Elec_CO(residue1,ss=ss)
            else:
                contacts[residue1]=self.calculate_residue_CO(residue1,ss=ss)
            #
            sys.stdout.flush()
        #
        # Calculate the contact order
        #
        #print contacts
        sum_cont=[]
        RCOs={}
        for res in contacts.keys():
            RCO=sum(contacts[res])#/float(len(contacts[res]))
            sum_cont=sum_cont+contacts[res]
            RCOs[res]=RCO
            
        RCO=sum(sum_cont)/(float(len(self.residues.keys()))*len(sum_cont))
        RCOs['all']=RCO
        return RCOs
Calculate the relative contact order for the soup. Setting ss to True will lead to the sequence distance being determine using SS bridges
Calculate the relative contact order for the soup. Setting ss to True will lead to the sequence distance being determine using SS bridges
Calculate the relative contact order for the soup . Setting ss to True will lead to the sequence distance being determine using SS bridges
def calculate_RCO(self,ss=False,elec_CO=False):
        cutoff=6.0
        contacts={}
        done={}
        if hasattr(self,'sep_results'):
            delattr(self,'sep_results')
        for residue1 in sorted(self.residues.keys()):
            print residue1, 
            import sys
            if elec_CO:
                contacts[residue1]=self.calculate_residue_Elec_CO(residue1,ss=ss)
            else:
                contacts[residue1]=self.calculate_residue_CO(residue1,ss=ss)
            sys.stdout.flush()
         Calculate the contact order
        print contacts
        sum_cont=[]
        RCOs={}
        for res in contacts.keys():
            RCO=sum(contacts[res])/float(len(contacts[res]))
            sum_cont=sum_cont+contacts[res]
            RCOs[res]=RCO
        RCO=sum(sum_cont)/(float(len(self.residues.keys()))*len(sum_cont))
        RCOs['all']=RCO
        return RCOs
def calculate_RCO ( self , ss = False , elec_CO = False ) : cutoff = 6.0 contacts = { } done = { } if hasattr ( self , 'sep_results' ) : delattr ( self , 'sep_results' ) for residue1 in sorted ( self . residues . keys ( ) ) : print residue1 , import sys if elec_CO : contacts [ residue1 ] = self . calculate_residue_Elec_CO ( residue1 , ss = ss ) else : contacts [ residue1 ] = self . calculate_residue_CO ( residue1 , ss = ss ) sys . stdout . flush ( ) sum_cont = [ ] RCOs = { } for res in contacts . keys ( ) : RCO = sum ( contacts [ res ] ) sum_cont = sum_cont + contacts [ res ] RCOs [ res ] = RCO RCO = sum ( sum_cont ) / ( float ( len ( self . residues . keys ( ) ) ) * len ( sum_cont ) ) RCOs [ 'all' ] = RCO return RCOs
Calculate the relative contact order for the soup.
Calculate the relative contact order for the soup .
"""Calculate the relative contact order for the soup. Setting ss to True will lead to the sequence distance being determine using SS bridges""" # # # Calculate the contact order # #print contacts #/float(len(contacts[res]))
self
ss
elec_CO