Protool/structure.py
def NextResidue(self,resid,checkforbound=1):
        """
        # This function returns the residue one after resid in the sequence in the same molecule
        # This function only works for amino acids
        """
        if not self.isaa(resid):
            raise NotAnAminoAcidError('%s %s' %(resid,self.resname(resid)))
        #
        # Make sure we get rid of all ',ALT' records in the name when skipping residues
        #
        resid=resid.replace(',ALT','')
        residues=self.residues.keys()
        residues.sort()
        for x in range(len(residues)):
            if residues[x]==resid:
                if x!=len(residues)-1:
                    addthis=None
                    for addvalue in range(1,15):
                        #
                        # We have to look beyond the next residue since this could be an ALT record
                        #
                        if self.isnormal(residues[x+addvalue]):
                            addthis=addvalue
                            break
                    if not addthis:
                        raise Exception('More than 15 alternative conformations for %s' %resid)
                    #
                    # we found a normal residue
                    #
                    if self.chainid(resid)==self.chainid(residues[x+addthis]) and self.isaa(resid)==self.isaa(residues[x+addthis]):
                        # Check that the C of resid is bound to the N of the residues[x+1]
                        C=resid+':C'
                        N=residues[x+addthis]+':N'
                        if not self.bound(N,C) and checkforbound:
                            raise Cterm
                        return residues[x+addthis]
                    else:
                        raise Cterm
                else:
                    raise Cterm
        raise 'Not Found','The residue was not found in this molecule'

        # This function returns the residue one after resid in the sequence in the same molecule
        # This function only works for amino acids
        
This function returns the residue one after resid in the sequence in the same molecule
This function only works for amino acids
This function returns the residue one after resid in the sequence in the same molecule This function only works for amino acids
def NextResidue(self,resid,checkforbound=1):
        if not self.isaa(resid):
            raise NotAnAminoAcidError('%s %s' %(resid,self.resname(resid)))
         Make sure we get rid of all ',ALT' records in the name when skipping residues
        resid=resid.replace(',ALT','')
        residues=self.residues.keys()
        residues.sort()
        for x in range(len(residues)):
            if residues[x]==resid:
                if x!=len(residues)-1:
                    addthis=None
                    for addvalue in range(1,15):
                         We have to look beyond the next residue since this could be an ALT record
                        if self.isnormal(residues[x+addvalue]):
                            addthis=addvalue
                            break
                    if not addthis:
                        raise Exception('More than 15 alternative conformations for %s' %resid)
                     we found a normal residue
                    if self.chainid(resid)==self.chainid(residues[x+addthis]) and self.isaa(resid)==self.isaa(residues[x+addthis]):
                         Check that the C of resid is bound to the N of the residues[x+1]
                        C=resid+':C'
                        N=residues[x+addthis]+':N'
                        if not self.bound(N,C) and checkforbound:
                            raise Cterm
                        return residues[x+addthis]
                    else:
                        raise Cterm
                else:
                    raise Cterm
        raise 'Not Found','The residue was not found in this molecule'
def NextResidue ( self , resid , checkforbound = 1 ) : if not self . isaa ( resid ) : raise NotAnAminoAcidError ( '%s %s' % ( resid , self . resname ( resid ) ) ) resid = resid . replace ( ',ALT' , '' ) residues = self . residues . keys ( ) residues . sort ( ) for x in range ( len ( residues ) ) : if residues [ x ] == resid : if x != len ( residues ) - 1 : addthis = None for addvalue in range ( 1 , 15 ) : if self . isnormal ( residues [ x + addvalue ] ) : addthis = addvalue break if not addthis : raise Exception ( 'More than 15 alternative conformations for %s' % resid ) if self . chainid ( resid ) == self . chainid ( residues [ x + addthis ] ) and self . isaa ( resid ) == self . isaa ( residues [ x + addthis ] ) : C = resid + ':C' N = residues [ x + addthis ] + ':N' if not self . bound ( N , C ) and checkforbound : raise Cterm return residues [ x + addthis ] else : raise Cterm else : raise Cterm raise 'Not Found' , 'The residue was not found in this molecule'
This function returns the residue one after resid in the sequence in the same molecule
 This function only works for amino acids
This function returns the residue one after resid in the sequence in the same molecule This function only works for amino acids
"""
        # This function returns the residue one after resid in the sequence in the same molecule
        # This function only works for amino acids
        """ # # Make sure we get rid of all ',ALT' records in the name when skipping residues # # # We have to look beyond the next residue since this could be an ALT record # # # we found a normal residue # # Check that the C of resid is bound to the N of the residues[x+1]
self
resid
checkforbound