{"action":"created","issue":{"url":"https://api.github.com/repos/michellab/Sire/issues/232","repository_url":"https://api.github.com/repos/michellab/Sire","labels_url":"https://api.github.com/repos/michellab/Sire/issues/232/labels{/name}","comments_url":"https://api.github.com/repos/michellab/Sire/issues/232/comments","events_url":"https://api.github.com/repos/michellab/Sire/issues/232/events","html_url":"https://github.com/michellab/Sire/issues/232","id":368261502,"node_id":"MDU6SXNzdWUzNjgyNjE1MDI=","number":232,"title":"Unable to rename or renumber residues using ResEditor","user":{"login":"lohedges","id":648557,"node_id":"MDQ6VXNlcjY0ODU1Nw==","avatar_url":"https://avatars1.githubusercontent.com/u/648557?v=4","gravatar_id":"","url":"https://api.github.com/users/lohedges","html_url":"https://github.com/lohedges","followers_url":"https://api.github.com/users/lohedges/followers","following_url":"https://api.github.com/users/lohedges/following{/other_user}","gists_url":"https://api.github.com/users/lohedges/gists{/gist_id}","starred_url":"https://api.github.com/users/lohedges/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lohedges/subscriptions","organizations_url":"https://api.github.com/users/lohedges/orgs","repos_url":"https://api.github.com/users/lohedges/repos","events_url":"https://api.github.com/users/lohedges/events{/privacy}","received_events_url":"https://api.github.com/users/lohedges/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-10-09T15:12:15Z","updated_at":"2018-10-10T09:18:17Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"I need to be able to rename residues to be able to run SOMD simulations with BioSimSpace. This is because SOMD expects all water molecules to have a `Sire.Mol.ResName` of `WAT`.\r\n\r\nIf I do this...\r\n\r\n```python\r\nfrom Sire.Mol import *\r\n\r\n# Here I assume that water is a Sire.Mol.Molecule object.\r\nwater = water.edit() \\\r\n             .residue(ResIdx(0)) \\\r\n             .rename(ResName(\"WAT\")) \\\r\n             .molecule() \\\r\n             .commit()\r\n```\r\n\r\n...then I get the following error...\r\n\r\n```bash\r\nException 'SireError::incomplete_code' thrown by the thread 'master'.\r\nFILE: /home/lester/Code/Sire/corelib/src/libs/SireMol/reseditor.cpp, LINE: 138\r\n```\r\n\r\ni.e. the `rename` method hasn't been implemented for the `Sire.Mol.ResEditor` class. However, if I create a new molecule and add a residue and rename it, things work, e.g.\r\n\r\n```\r\nfrom Sire.Mol import *\r\n\r\n# Create a test molecule.\r\nmolecule = Molecule(\"A test molecule\")\r\n\r\n# Add a single residue and rename it.\r\nres = molecule.edit().add(ResNum(1))\r\nres.rename(ResName(\"WAT\"))\r\n```\r\nAt the point of being renamed, the residue above is of type `Sire.Mol.ResStructureEditor`, for which the rename function has been implemented correctly. With this in mind, it is possible to fix the initial code by creating a `ResStructureEditor` object from the `ResEditor`, i.e.\r\n\r\n```python\r\nwater = ResStructureEditor(water.edit() \\\r\n                                .residue(ResIdx(0))\\ \r\n                          ).rename(ResName(\"WAT\")) \\\r\n                           .molecule() \\\r\n                           .commit()\r\n```\r\n\r\nWhile this is okay for now, it would be nice if it was possible to rename and renumber directly using the `ResEditor` object.\r\n\r\nApologies if I'm missing something, or if there is an easier way to do this."},"comment":{"url":"https://api.github.com/repos/michellab/Sire/issues/comments/428499955","html_url":"https://github.com/michellab/Sire/issues/232#issuecomment-428499955","issue_url":"https://api.github.com/repos/michellab/Sire/issues/232","id":428499955,"node_id":"MDEyOklzc3VlQ29tbWVudDQyODQ5OTk1NQ==","user":{"login":"lohedges","id":648557,"node_id":"MDQ6VXNlcjY0ODU1Nw==","avatar_url":"https://avatars1.githubusercontent.com/u/648557?v=4","gravatar_id":"","url":"https://api.github.com/users/lohedges","html_url":"https://github.com/lohedges","followers_url":"https://api.github.com/users/lohedges/followers","following_url":"https://api.github.com/users/lohedges/following{/other_user}","gists_url":"https://api.github.com/users/lohedges/gists{/gist_id}","starred_url":"https://api.github.com/users/lohedges/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lohedges/subscriptions","organizations_url":"https://api.github.com/users/lohedges/orgs","repos_url":"https://api.github.com/users/lohedges/repos","events_url":"https://api.github.com/users/lohedges/events{/privacy}","received_events_url":"https://api.github.com/users/lohedges/received_events","type":"User","site_admin":false},"created_at":"2018-10-10T09:18:17Z","updated_at":"2018-10-10T09:18:17Z","author_association":"CONTRIBUTOR","body":"This is now fixed on the `feature-mapping` branch. Will be closed when merged into `devel`."}}
{"actor":{"display_login":"lohedges"}}