﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	blockedby	blocking	notify_on_close	platform	project
2342	API inconsistency copying residue with blank insertion code	Tristan Croll	Eric Pettersen	"If I try to create a new residue based on an existing one:

{{{
---> 61             nr = m.new_residue(r.name, cid, r.number-offset, insert=r.insertion_code)
     62         for a in r.atoms:
     63             na = atom_map[a] = m.new_atom(a.name, a.element)

/opt/UCSF/ChimeraX-daily/lib/python3.7/site-packages/chimerax/atomic/molobject.py in new_residue(self, residue_name, chain_id, pos, insert)
   1551                        args = (ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_int, ctypes.c_char),
   1552                        ret = ctypes.py_object)
-> 1553         return f(self._c_pointer, residue_name.encode('utf-8'), chain_id.encode('utf-8'), pos, insert.encode('utf-8'))
   1554 
   1555     @property

ArgumentError: argument 5: <class 'TypeError'>: wrong type
}}}

... which occurs because m.new_residue requires the `insert` argument to be 1 character long, but `Residue.insertion_code` returns an empty string when it has no insertion code. Easy enough to work around now I know what's going on, but not obvious to diagnose in the first place."	defect	closed	minor		Structure Editing		fixed						all	ChimeraX
