I've got some code that answer your question, I am sure its not the right way nor the fastest. Had to figure out how Biopythion manage PDB structure object and not sure I got it. I believe every piece of a structure is an object but not sure about relations among them. My code outputs a correct(in term of question not format: 3 atoms are not a Cys residue, (I hope)) pdb file, while the Biopython PDB object structure it creates its kind of wrong: the 3 atoms from Cys 1-A you wanted to be moved don't have a parent. I guess its because of the way I copied the Cys 1-A and detached the atoms only after moving them. Have a look at the code the outputand the printS() of the atoms during my too long alghoritm. I need more time to try to understand it but I feel I am getting a grasp on it, maybe you'll catch it faster than me:
PS I started from your recent question answer here: How do I change the chain name of a pdb file?
from Bio.PDB import PDBList, PDBIO, PDBParser
from Bio.PDB.Chain import Chain
import warnings
warnings.filterwarnings('ignore')
def atom_id_total(struct):
# print(struct)
id_t = 0
for model in struct:
# print(model)
for chain in model:
# print(chain)
for resi in chain:
for atom in resi:
id_t +=1
# print(resi)
return id_t
pdbl = PDBList()
io = PDBIO()
parser = PDBParser()
pdbl.retrieve_pdb_file('6gch', pdir='.', file_format="pdb")
# pdb6gch.ent is the filename when retrieved by PDBList
structure = parser.get_structure('6gch', 'pdb6gch.ent')
renames = {
"E": "A",
"F": "B",
"G": "C"
}
for model in structure:
for chain in model:
old_name = chain.get_id()
new_name = renames.get(old_name)
if new_name:
print(f"renaming chain {old_name} to {new_name}")
chain.id = new_name
else:
print(f"keeping chain name {old_name}")
io.set_structure(structure)
io.save('6gch_renamed.pdb')
structure2 = parser.get_structure('6gch_renamed', '6gch_renamed.pdb')
for model in structure2:
print('model :',model, model.id, model.full_id)
# for model in structure2:
# for chain in model:
# if chain.id == 'A' :
# for residue in chain:
# for ii in residue:
# print(atom,atom.serial_number,atom.get_id(),atom.fullname,atom.get_parent())
my_chain = Chain("E")
print('my_chain : ', my_chain, my_chain.id, my_chain.get_parent())
model_list=[]
for model in structure2.get_models():
print(model)
model_list.append(model)
model_list[0].add(my_chain)
print('my_chain : ', my_chain, type(my_chain), my_chain.get_full_id(), my_chain.get_parent())
print('structure2 :',structure2)
list_resi =[]
list_atom=[]
for model in structure2:
for chain in model:
# if chain.id == 'E':
print(chain.id)
# print(dir(chain))
for residue in chain:
for atom in residue:
if atom.serial_number in [1,2,3]:
print(atom,atom.serial_number,atom.get_id(),atom.fullname,atom.get_parent())
list_resi.append(residue)
list_atom.append(atom)
list_resi = set(list_resi)
print('list_resi : ',list_resi)
print('list_atom : ',list_atom)
cnt_resi=0
for i in list_resi:
print(i.id, i.full_id)
copi = i.copy()
print(copi.id, copi.full_id)
print('copy', copi.id,copi.get_parent())
setattr(copi, 'id',(copi.id[0], 1 ,(copi.id[2])))
copi.set_parent(my_chain)
print('copy parent :' , copi.get_parent())
print('copy', copi.id, copi.get_parent(),'full_id :', copi.get_full_id())
cnt_resi += 1
copi_child = []
for i in copi.get_list():
print(i)
copi_child.append(i.id)
print('copi child : ',copi_child)
for i in copi_child:
copi.__delitem__(i)
print(copi)
for i in copi:
print(i)
cnt_atm = 0
for i in list_atom:
# setattr(i, 'serial_number', (atom_id_total(structure2))+300+cnt_atm) #non cambia nulla io.set_structure(structure2) rinomina atomi
setattr(i, 'serial_number', 1)
i.set_parent(copi)
print('atom i :',i.fullname, i.serial_number, i.id, 'parent :',i.get_parent(), 'atom full_id :',i.get_full_id())
copi.add(i)
cnt_atm += 1
print('copi :',copi)
for i in copi:
print(i, i.serial_number)
my_chain.add(copi)
for model in structure2:
for chain in model:
if chain.id == 'A' :
for residue in chain:
for ii in residue:
print(ii.serial_number,ii, ii.id, ii.serial_number,chain.id, type(ii), (ii.get_parent()).get_parent().id)
if chain.id == 'E' :
for residue in chain:
for ii in residue:
print(ii.serial_number,ii, ii.id, ii.serial_number,chain.id, type(ii), (ii.get_parent()))
del_atom = []
for model in structure2:
for chain in model:
if chain.id == 'A':
print(chain.id)
for residue in chain:
for atom in residue:
if atom in list_atom:
del_atom.append(atom)
print('del_atom : ',del_atom)
for i in del_atom:
print(i, i.serial_number, ((i.get_parent()).get_parent()).id)
for i in list_resi:
del_i = i
print('del_i :',del_i)
for ii in i.get_list():
if ii in del_atom:
i.detach_child(ii.id)
print(ii.serial_number)
if ii in del_atom:
print('ok')
print('____________')
#
for model in structure2:
for chain in model:
if chain.id == 'A' :
for residue in chain:
for ii in residue:
print(ii.serial_number,ii, ii.id, ii.serial_number,chain.id, type(ii), (ii.get_parent()).get_parent().id)
if chain.id == 'E' :
for residue in chain:
for ii in residue:
print(ii.serial_number,ii, ii.id, ii.serial_number,chain.id, type(ii), (ii.get_parent()))
print(structure2.child_dict)
for model in structure2:
print(model.child_dict)
io.set_structure(structure2)
io.save('6gch_re-renamed.pdb')
the output pdb image below show your half 1A (red) half 1E Cys (blue)

Probably it would have been better to have a look here: https://biopython.org/wiki/The_Biopython_Structural_Bioinformatics_FAQ
especially "The Structure Object
What’s the overall layout of a Structure object?" part before rushing into typing bits of code.