#    break
            elif (line[0:6] == 'HETATM') & (line[17:20]
                                            == 'MSE'):  #Selenomethionine
                line_edit = 'ATOM  ' + line[6:17] + 'MET' + line[20:]
                if (line_edit[12:14] == 'SE'):
                    line_edit = line_edit[0:12] + ' S' + line_edit[14:]
                if len(line_edit) > 75:
                    if (line_edit[76:78] == 'SE'):
                        line_edit = line_edit[0:76] + ' S' + line_edit[78:]

            if line_edit[0:4] == 'ATOM':
                resnum = line_edit[23:26]
                if not resnum == oldresnum:
                    count = count + 1
                    longname = line_edit[17:20]
                    if longer_names.has_key(longname):
                        fastaid.write(longer_names[longname])
                    else:
                        fastaid.write('X')
                oldresnum = resnum

                newnum = '%3d' % count
                line_edit = line_edit[0:23] + newnum + line_edit[26:]
                if removechain:
                    line_edit = line_edit[0:21] + ' ' + line_edit[22:]

                #outid.write(line_edit)
    fastaid.write('\n')

    #outid.close()
    #fastaid.close()
示例#2
0
            resn = modres[resn]
            line_edit = 'ATOM  '+line[6:17]+ resn + line[20:]

            if orig_resn == "MSE":
                # don't count MSE as modified residues for flagging purposes (because they're so common)
                # Also, fix up the selenium atom naming
                if (line_edit[12:14] == 'SE'):
                    line_edit = line_edit[0:12]+' S'+line_edit[14:]
                if len(line_edit) > 75:
                    if (line_edit[76:78] == 'SE'):
                        line_edit = line_edit[0:76]+' S'+line_edit[78:]
            else:
                shit_stat_modres = True

        # Only process residues we know are valid.
        if not longer_names.has_key(resn):
            continue

        resnum = line_edit[22:27]

        # Is this a new residue
        if not resnum == oldresnum:
            if residue_buffer != []:  # is there a residue in the buffer ?
                if not check_and_print_pdb(count, residue_buffer, residue_letter):
                    # if unsuccessful
                    shit_stat_misdns = True
                else:
                    count = count + 1

            residue_buffer = []
            residue_letter = longer_names[resn]
示例#3
0
            # Is thresidue_letter
            if not resnum == oldresnum:
                if residue_buffer != []:  # is there a residue in the buffer ?
                    if not residue_invalid:
                        if not check_and_print_pdb(count, residue_buffer, residue_letter):
                            # if unsuccessful
                            shit_stat_misdns = True
                        else:
                            count = count + 1

                residue_buffer = []
                residue_letter = ""
                residue_invalid = False

                longname = line_edit[17:20]
                if longer_names.has_key(longname):
                    residue_letter = longer_names[longname]
                else:
                    residue_letter = 'X'
                    residue_invalid = True

            oldresnum = resnum

            # What does this do ?
            if line_edit[16:17] == 'A':
                line_edit = line_edit[:16]+' '+line_edit[17:]

            if line_edit[16:17] != ' ':
                continue

            if removechain:
示例#4
0
            resn = modres[resn]
            line_edit = "ATOM  " + line[6:17] + resn + line[20:]

            if orig_resn == "MSE":
                # don't count MSE as modified residues for flagging purposes (because they're so common)
                # Also, fix up the selenium atom naming
                if line_edit[12:14] == "SE":
                    line_edit = line_edit[0:12] + " S" + line_edit[14:]
                if len(line_edit) > 75:
                    if line_edit[76:78] == "SE":
                        line_edit = line_edit[0:76] + " S" + line_edit[78:]
            else:
                shit_stat_modres = True

        # Only process residues we know are valid.
        if not longer_names.has_key(resn):
            continue

        resnum = line_edit[22:27]

        # Is this a new residue
        if not resnum == oldresnum:
            if residue_buffer != []:  # is there a residue in the buffer ?
                if not check_and_print_pdb(count, residue_buffer, residue_letter):
                    # if unsuccessful
                    shit_stat_misdns = True
                else:
                    count = count + 1

            residue_buffer = []
            residue_letter = longer_names[resn]