{"action":"created","issue":{"url":"https://api.github.com/repos/MDAnalysis/mdanalysis/issues/1105","repository_url":"https://api.github.com/repos/MDAnalysis/mdanalysis","labels_url":"https://api.github.com/repos/MDAnalysis/mdanalysis/issues/1105/labels{/name}","comments_url":"https://api.github.com/repos/MDAnalysis/mdanalysis/issues/1105/comments","events_url":"https://api.github.com/repos/MDAnalysis/mdanalysis/issues/1105/events","html_url":"https://github.com/MDAnalysis/mdanalysis/issues/1105","id":193354808,"number":1105,"title":"resids don't stay consistent between topology levels","user":{"login":"kain88-de","id":4302678,"avatar_url":"https://avatars.githubusercontent.com/u/4302678?v=3","gravatar_id":"","url":"https://api.github.com/users/kain88-de","html_url":"https://github.com/kain88-de","followers_url":"https://api.github.com/users/kain88-de/followers","following_url":"https://api.github.com/users/kain88-de/following{/other_user}","gists_url":"https://api.github.com/users/kain88-de/gists{/gist_id}","starred_url":"https://api.github.com/users/kain88-de/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kain88-de/subscriptions","organizations_url":"https://api.github.com/users/kain88-de/orgs","repos_url":"https://api.github.com/users/kain88-de/repos","events_url":"https://api.github.com/users/kain88-de/events{/privacy}","received_events_url":"https://api.github.com/users/kain88-de/received_events","type":"User","site_admin":false},"labels":[{"id":244973372,"url":"https://api.github.com/repos/MDAnalysis/mdanalysis/labels/Component-Core","name":"Component-Core","color":"ff0000","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/MDAnalysis/mdanalysis/milestones/9","html_url":"https://github.com/MDAnalysis/mdanalysis/milestones/0.16.0","labels_url":"https://api.github.com/repos/MDAnalysis/mdanalysis/milestones/9/labels","id":1716502,"number":9,"title":"0.16.0","description":"","creator":{"login":"richardjgowers","id":9249543,"avatar_url":"https://avatars.githubusercontent.com/u/9249543?v=3","gravatar_id":"","url":"https://api.github.com/users/richardjgowers","html_url":"https://github.com/richardjgowers","followers_url":"https://api.github.com/users/richardjgowers/followers","following_url":"https://api.github.com/users/richardjgowers/following{/other_user}","gists_url":"https://api.github.com/users/richardjgowers/gists{/gist_id}","starred_url":"https://api.github.com/users/richardjgowers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richardjgowers/subscriptions","organizations_url":"https://api.github.com/users/richardjgowers/orgs","repos_url":"https://api.github.com/users/richardjgowers/repos","events_url":"https://api.github.com/users/richardjgowers/events{/privacy}","received_events_url":"https://api.github.com/users/richardjgowers/received_events","type":"User","site_admin":false},"open_issues":23,"closed_issues":78,"state":"open","created_at":"2016-04-19T08:42:42Z","updated_at":"2016-12-05T10:14:32Z","due_on":null,"closed_at":null},"comments":11,"created_at":"2016-12-04T14:50:04Z","updated_at":"2016-12-05T13:13:39Z","closed_at":null,"body":"I right now have the problem that I want to convert a selection of `bynum 1:34 or bynum 128:256 or ...` into selection I can actually transfer between different topologies.  The target should be something like `(chain A and resid 1 to 45) or (chain B and resid 1 to 128)`, *here for VMD*.\r\n\r\nI know have a selection spanning several segments named *domain* \r\n\r\n `'bynum 192:214 or bynum 229:405 or bynum 420:638 or bynum 830:852 or bynum 867:1043 or bynum 1058:1276'`\r\n\r\nThe crucial part here is that the selection spans several segments! My confusion is now that I think that accessing the segments and lower levels in that selection will **only** returns atoms in the selection and not from the rest of the topology\r\n\r\n### Code to reproduce the behaviour\r\n\r\nHere is a test case\r\n\r\n``` python\r\nimport MDAnalysis as mda\r\n\r\nu = mda.fetch_mmtf('1nmu')\r\n# exclude all HETATM entries\r\nprotein = u.select_atoms('protein')\r\n# make a selection across chains\r\nsel = protein.select_atoms('(segid A and resid 10-50) or (segid C and resid 51-100)')\r\nfor seg in sel.segments:\r\n    print(len(seg.residues.resids), seg.residues.resids[:10])\r\n```\r\n\r\nThis prints that the resids are 368 long. That corresponds to all residues in the segment `A` or `C`. I would have expected that this would actually only contain 50 residues.\r\n\r\n### Currently version of MDAnalysis:\r\n0.16.0dev0\r\n"},"comment":{"url":"https://api.github.com/repos/MDAnalysis/mdanalysis/issues/comments/264850619","html_url":"https://github.com/MDAnalysis/mdanalysis/issues/1105#issuecomment-264850619","issue_url":"https://api.github.com/repos/MDAnalysis/mdanalysis/issues/1105","id":264850619,"user":{"login":"richardjgowers","id":9249543,"avatar_url":"https://avatars.githubusercontent.com/u/9249543?v=3","gravatar_id":"","url":"https://api.github.com/users/richardjgowers","html_url":"https://github.com/richardjgowers","followers_url":"https://api.github.com/users/richardjgowers/followers","following_url":"https://api.github.com/users/richardjgowers/following{/other_user}","gists_url":"https://api.github.com/users/richardjgowers/gists{/gist_id}","starred_url":"https://api.github.com/users/richardjgowers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richardjgowers/subscriptions","organizations_url":"https://api.github.com/users/richardjgowers/orgs","repos_url":"https://api.github.com/users/richardjgowers/repos","events_url":"https://api.github.com/users/richardjgowers/events{/privacy}","received_events_url":"https://api.github.com/users/richardjgowers/received_events","type":"User","site_admin":false},"created_at":"2016-12-05T13:13:39Z","updated_at":"2016-12-05T13:13:39Z","body":"Yeah definitely needs a warning/note somewhere as it's a potential gotcha.\r\n\r\nIf we had the set operations that are mentioned in #726 we could have something like\r\n\r\n```python\r\nfor seg in sel.segments:\r\n    res = seg.residues & sel.residues\r\n    res = seg.residues.intersect(sel.residues)  # or maybe only as a method\r\n```"}}
{"actor":{"display_login":"richardjgowers"}}