{"action":"created","issue":{"url":"https://api.github.com/repos/salilab/pmi/issues/140","repository_url":"https://api.github.com/repos/salilab/pmi","labels_url":"https://api.github.com/repos/salilab/pmi/issues/140/labels{/name}","comments_url":"https://api.github.com/repos/salilab/pmi/issues/140/comments","events_url":"https://api.github.com/repos/salilab/pmi/issues/140/events","html_url":"https://github.com/salilab/pmi/issues/140","id":117379412,"number":140,"title":"fix flexible beads so that they move according to their respective rigid bodies","user":{"login":"Pellarin","id":2477712,"avatar_url":"https://avatars.githubusercontent.com/u/2477712?v=3","gravatar_id":"","url":"https://api.github.com/users/Pellarin","html_url":"https://github.com/Pellarin","followers_url":"https://api.github.com/users/Pellarin/followers","following_url":"https://api.github.com/users/Pellarin/following{/other_user}","gists_url":"https://api.github.com/users/Pellarin/gists{/gist_id}","starred_url":"https://api.github.com/users/Pellarin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pellarin/subscriptions","organizations_url":"https://api.github.com/users/Pellarin/orgs","repos_url":"https://api.github.com/users/Pellarin/repos","events_url":"https://api.github.com/users/Pellarin/events{/privacy}","received_events_url":"https://api.github.com/users/Pellarin/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-17T15:31:49Z","updated_at":"2016-05-06T03:37:35Z","closed_at":"2016-05-06T03:37:35Z","body":"Unfortunately in PMI 1.0 we don't have a function that selectively fix some of the floppy bodies but not other, anyways one can simply manipulate the internals of the IMP.pmi.representation.Representation object roughly in this way:\r\n\r\n```\r\nr=IMP.pmi.representation.Representation(m,...)\r\n\r\n....\r\n#after building the hierarchies using macros or other methods\r\n\r\n#1 component-name approach:\r\n#if you have the component names [\"A\",\"B\",\"C\"] whose beads should be fixed:\r\nfix_beads=[]\r\nfor c in [\"A\",\"B\",\"C\"]:\r\n   fix_beads+=[h.get_particle() for h in IMP.atom.get_leaves(r.hier_dict[c])]\r\n\r\n\r\n#2 selection approach\r\n#if you have the selection tuples, ie (first_residue, last_residue, component_name) or \r\n# component_names, e.g. [(1,100,\"A\"),(40,400,\"B\"),\"C\"] whose beads should be fixed:\r\nfix_beads=[]\r\nfor st in  [(1,100,\"A\"),(40,400,\"B\"),\"C\"]:\r\n   fix_beads+=[h.get_particle() for h in IMP.pmi.tools.select_by_tuple(r,st)]\r\n\r\n#then remove the particle from the list\r\nremove_list=[]\r\nfor p in r.floppy_bodies: # the internal list of floppy_bodies\r\n   if p in fix_beads: remove_list.append(p)\r\nfor p in remove_list:  r.floppy_bodies.remove(p)\r\n```"},"comment":{"url":"https://api.github.com/repos/salilab/pmi/issues/comments/217340751","html_url":"https://github.com/salilab/pmi/issues/140#issuecomment-217340751","issue_url":"https://api.github.com/repos/salilab/pmi/issues/140","id":217340751,"user":{"login":"cgreenberg","id":1170706,"avatar_url":"https://avatars.githubusercontent.com/u/1170706?v=3","gravatar_id":"","url":"https://api.github.com/users/cgreenberg","html_url":"https://github.com/cgreenberg","followers_url":"https://api.github.com/users/cgreenberg/followers","following_url":"https://api.github.com/users/cgreenberg/following{/other_user}","gists_url":"https://api.github.com/users/cgreenberg/gists{/gist_id}","starred_url":"https://api.github.com/users/cgreenberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cgreenberg/subscriptions","organizations_url":"https://api.github.com/users/cgreenberg/orgs","repos_url":"https://api.github.com/users/cgreenberg/repos","events_url":"https://api.github.com/users/cgreenberg/events{/privacy}","received_events_url":"https://api.github.com/users/cgreenberg/received_events","type":"User","site_admin":false},"created_at":"2016-05-06T03:37:35Z","updated_at":"2016-05-06T03:37:35Z","body":"This was solved at some point by adding `representation.remove_floppy_bodies()`"}}