Ejemplo n.º 1
0
    chainid = ' '

for i in range(len(lines)):
    line = lines[i]

    if len(line) > 5 and line[:6] == 'ENDMDL': break  # Its an NMR model.
    chainid = [i for i in chainid]
    if (line[21] in chainid or ignorechain or removechain):
        line_edit = line
        if line[0:3] == 'TER':
            continue
        elif (line[0:6] == 'HETATM'):
            ok = False

            # Is it a modified residue ?
            if modres.has_key(line[17:20]):
              # if so replace it with its canonical equivalent !
                line_edit = 'ATOM  '+line[6:17]+modres[line[17:20]] + line[20:]
                modifiedres = modifiedres + line[17:20] + ',  '
                # dont count MSEs as modiied residues (cos they're so common and get_pdb deal with them previosuly)
                if line[17:20] != "MSE":
                    shit_stat_modres = True
                ok = True

            # other substitution (of atoms mainly)
            if (line[17:20] == 'MSE'):  # Selenomethionine
                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:]
Ejemplo n.º 2
0
if chainid == '_':
    chainid = ' '

for line in lines:

    if line.startswith('ENDMDL'): break  # Only take the first NMR model
    if len(line) > 21 and ( line[21] in chainid or options.allchains):
        if line[0:4] != "ATOM" and line[0:6] != 'HETATM':
            continue

        line_edit = line
        resn = line[17:20]

        # Is it a modified residue ?
        # (Looking for modified residues in both ATOM and HETATM records is deliberate)
        if modres.has_key(resn):
            # if so replace it with its canonical equivalent !
            orig_resn = resn
            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
Ejemplo n.º 3
0
	chainid = ' '

for i in range(len(lines)):
	line = lines[i]

	if len(line)>5 and line[:6]=='ENDMDL':break #Its an NMR model.

	if (chainid == line[21] or ignorechain):
		line_edit = line
		if line[0:3] == 'TER':
			continue
		elif (line[0:6] == 'HETATM'):
			ok = False

			## Is it a modified residue ?
			if modres.has_key( line[17:20] ):
			  ## if so replace it with its canonical equivalent !
				line_edit = 'ATOM  '+line[6:17]+modres[line[17:20]] +line[20:]
				modifiedres = modifiedres +  line[17:20]  + ',  '
				## dont count MSEs as modiied residues (cos they're so common and get_pdb deal with them previosuly)
				if line[17:20] != "MSE":
				  shit_stat_modres = True
				ok = True

			## other substitution (of atoms mainly)
			if (line[17:20]=='MSE'): #Selenomethionine
				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:]
Ejemplo n.º 4
0
    chainid = " "

for line in lines:

    if line.startswith("ENDMDL"):
        break  # Only take the first NMR model
    if len(line) > 21 and (line[21] in chainid or options.allchains):
        if line[0:4] != "ATOM" and line[0:6] != "HETATM":
            continue

        line_edit = line
        resn = line[17:20]

        # Is it a modified residue ?
        # (Looking for modified residues in both ATOM and HETATM records is deliberate)
        if modres.has_key(resn):
            # if so replace it with its canonical equivalent !
            orig_resn = resn
            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