{"action":"opened","issue":{"url":"https://api.github.com/repos/MDAnalysis/mdanalysis/issues/1935","repository_url":"https://api.github.com/repos/MDAnalysis/mdanalysis","labels_url":"https://api.github.com/repos/MDAnalysis/mdanalysis/issues/1935/labels{/name}","comments_url":"https://api.github.com/repos/MDAnalysis/mdanalysis/issues/1935/comments","events_url":"https://api.github.com/repos/MDAnalysis/mdanalysis/issues/1935/events","html_url":"https://github.com/MDAnalysis/mdanalysis/issues/1935","id":331551433,"node_id":"MDU6SXNzdWUzMzE1NTE0MzM=","number":1935,"title":"Overwriting the output format","user":{"login":"xiki-tempula","id":6242032,"node_id":"MDQ6VXNlcjYyNDIwMzI=","avatar_url":"https://avatars2.githubusercontent.com/u/6242032?v=4","gravatar_id":"","url":"https://api.github.com/users/xiki-tempula","html_url":"https://github.com/xiki-tempula","followers_url":"https://api.github.com/users/xiki-tempula/followers","following_url":"https://api.github.com/users/xiki-tempula/following{/other_user}","gists_url":"https://api.github.com/users/xiki-tempula/gists{/gist_id}","starred_url":"https://api.github.com/users/xiki-tempula/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xiki-tempula/subscriptions","organizations_url":"https://api.github.com/users/xiki-tempula/orgs","repos_url":"https://api.github.com/users/xiki-tempula/repos","events_url":"https://api.github.com/users/xiki-tempula/events{/privacy}","received_events_url":"https://api.github.com/users/xiki-tempula/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-12T11:42:00Z","updated_at":"2018-06-12T11:42:00Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"I'm interested in changing the pqr output format. I wonder if there is an easy way of overwriting the existing default output format without editing the source code directly?\r\nA scenario would be that by default the pqr writes 4 digits in the charge field. However, in gromacs, for example, the charge is represented in 5 decimal places. Thus, if I open a gromacs topology file and try to write out as pqr file. The overall charge won't be an integer because the last digit has been truncated. \r\n\r\nI'm interested in an interface like this.\r\n``` python\r\nimport MDAnalysis as mda\r\nfrom MDAnalysis.coordinates.PQR import PQRWriter\r\nclass PQRWriter(PQRWriter):\r\n    fmt_ATOM = (\"ATOM {serial:6d} {name:<4} {resname:<3} {chainid:1.1}\"\r\n                \"{resid:4d}    {pos[0]:-8.3f}{pos[1]:-8.3f}\"\r\n                \"{pos[2]:-8.3f} {charge:-8.5f} {radius:6.4f}\\n\")\r\n\r\nu = mda.Universe(top)\r\nu.atoms.write(pqr)\r\n```\r\n\r\n### Currently version of MDAnalysis:\r\npy36/mda0.18.1\r\n"}}
{"actor":{"display_login":"xiki-tempula"}}