def _translate_residue(self, selection, default_atomname='<STR_LIT>'):
m = self.RESIDUE.match(selection)<EOL>if not m:<EOL><INDENT>errmsg = "<STR_LIT>".format(**vars())<EOL>logger.error(errmsg)<EOL>raise ValueError(errmsg)<EOL><DEDENT>gmx_resid = self.gmx_resid(int(m.group('<STR_LIT>')))    <EOL>residue = m.group('<STR_LIT>')<EOL>if len(residue) == <NUM_LIT:1>:<EOL><INDENT>gmx_resname = utilities.convert_aa_code(residue) <EOL><DEDENT>else:<EOL><INDENT>gmx_resname = residue                            <EOL><DEDENT>gmx_atomname = m.group('<STR_LIT>')<EOL>if gmx_atomname is None:<EOL><INDENT>gmx_atomname = default_atomname<EOL><DEDENT>return {'<STR_LIT>':gmx_resname, '<STR_LIT>':gmx_resid, '<STR_LIT>':gmx_atomname}<EOL>
Translate selection for a single res to make_ndx syntax.