Q. How to locate gaps in a protein chain and then cap them with "acet" at the N-terminal and "conh" at the C-terminal.
A.
This script reads in the PDB structure 1xbb, identifies gaps in the protein chain and determines their N- and C-terminal residue numbers. It then processes the termini by adding an acetyl (Acet) group to the N-terminal residues and a CONH group to the C-terminal residues.
Please feel free to adapt it to your needs or suggest improvements.
# read in PDB 1xbb as an example
# find N- and C- residue numbers for the gaps in the protein chain
r_ = Res( Select( a_ delete ) )
for i=1,Nof(r_)
r_[i]
endfor
NandC = Iarray(r_ number)
split molecule segment a_
convertObject a_ no yes yes no
#add acet group to N-terminal
for j=2,Nof(NandC),2
myRes = NandC [j]
modify a_/$myRes "acet"
delete myRes
endfor
#add conh to C-terminal
for k=1,Nof(NandC),2
myRes = NandC [k]
modify a_/$myRes "conh"
delete myRes
endfor