{"action":"created","issue":{"url":"https://api.github.com/repos/galaxyproject/tools-devteam/issues/103","labels_url":"https://api.github.com/repos/galaxyproject/tools-devteam/issues/103/labels{/name}","comments_url":"https://api.github.com/repos/galaxyproject/tools-devteam/issues/103/comments","events_url":"https://api.github.com/repos/galaxyproject/tools-devteam/issues/103/events","html_url":"https://github.com/galaxyproject/tools-devteam/pull/103","id":68187816,"number":103,"title":"Unify and collectionify read group handling. [WIP]","user":{"login":"jmchilton","id":216771,"avatar_url":"https://avatars.githubusercontent.com/u/216771?v=3","gravatar_id":"","url":"https://api.github.com/users/jmchilton","html_url":"https://github.com/jmchilton","followers_url":"https://api.github.com/users/jmchilton/followers","following_url":"https://api.github.com/users/jmchilton/following{/other_user}","gists_url":"https://api.github.com/users/jmchilton/gists{/gist_id}","starred_url":"https://api.github.com/users/jmchilton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmchilton/subscriptions","organizations_url":"https://api.github.com/users/jmchilton/orgs","repos_url":"https://api.github.com/users/jmchilton/repos","events_url":"https://api.github.com/users/jmchilton/events{/privacy}","received_events_url":"https://api.github.com/users/jmchilton/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/galaxyproject/tools-devteam/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":16,"created_at":"2015-04-13T20:31:47Z","updated_at":"2015-06-18T20:38:28Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/galaxyproject/tools-devteam/pulls/103","html_url":"https://github.com/galaxyproject/tools-devteam/pull/103","diff_url":"https://github.com/galaxyproject/tools-devteam/pull/103.diff","patch_url":"https://github.com/galaxyproject/tools-devteam/pull/103.patch"},"body":"The reusable macro file has:\r\n\r\n - Defines widgets for common read group parameters.\r\n - Widgets can be used at top-level (e.g. ``picard_AddOrReplaceReadGroups`` where handling is required) of inputs or within a conditional (e.g. in the mappers).\r\n - The conditional (used by mappers) has fours modes:\r\n    - Set according the specification (only ID required - has all parameters). Current BWA approach.\r\n    - Set Picard-style (presumably useful for broad pipelines?) (``ID``, ``SM``, ``LB``, ``PU``, ``PL`` are all required and there are no params for ``KS``, ``PG``, or ``FO``). In terms of what is shown and what is required - this mirrors ``picard_AddOrReplaceReadGroups``.\r\n    - Just assign the ``ID`` and do so automatically (based either on collection or standalone dataset information). No extra form elements are shown to the user. (Should this be the new default?)\r\n    - Do not set read groups.\r\n - Utilities for conditionally including parameters and formatting them (eliminates many explicit conditionals in the mappers for instance).\r\n - An example \"mapper\" test tool which demonstrates optionally including read groups.\r\n - An example read group assign test tool which demonstrates unconditionally specifying macros.\r\n\r\nIn addition to unifying everything, the macro file defines enhanced ``ID``, ``SM``, and ``LB`` parameter inputs that are wrapped in a conditional. That conditional allows manual input but also allows the user to just say Galaxy should use collection information or dataset name (if input is not in a collection) to assign these parameters. This should simplify things and make simple workflows more robust, but is absolutely essential for collection-based workflows and newer tool form options that allow running a tool in parallel over many inputs.\r\n\r\nThis may look at first glance like it is really complicated - but if you focus just on the mappers for instance and treat the macro file like a library - the client interface is actually a good deal easier than doing this stuff by hand for each tool.\r\n\r\nUpdates from original version:\r\n\r\n - Tests pass for ``picard_AddOrReplaceReadGroups`` as well as the BWA and Bowtie tools.\r\n - Remove the changes from tophat - it will require more work (it is less free form and won't accept certain valid read groups arguments).\r\n - Deleted empty lines I had previously introduced and idented the Cheetah code (hadn't realized I could do that).\r\n\r\nSmaller Notes:\r\n\r\nThe new approach for BWA tools excludes empty read groups instead of adding them as empty - hopefully this is fine:\r\n\r\n```\r\n-@RG    ID:rg1  SM:     PL:CAPILLARY\r\n-@PG    ID:bwa  PN:bwa  VN:0.7.12-r1039 CL:bwa sampe -r @RG     ID:rg1  SM:     PL:CAPILLARY localref.fa first.sai second.sai /tmp/tmpn_I5mQ/files/000/dataset_9.dat /tmp/tmpn_I5mQ/files/000/dataset_10.dat\r\n+@RG    ID:rg1  PL:CAPILLARY\r\n+@PG    ID:bwa  PN:bwa  VN:0.7.12-r1039 CL:bwa sampe -r @RG     ID:rg1  PL:CAPILLARY localref.fa first.sai second.sai /tmp/tmpmN3j1j/files/000/dataset_9.dat /tmp/tmpmN3j1j/files/000/dataset_10.dat\r\n```"},"comment":{"url":"https://api.github.com/repos/galaxyproject/tools-devteam/issues/comments/113282611","html_url":"https://github.com/galaxyproject/tools-devteam/pull/103#issuecomment-113282611","issue_url":"https://api.github.com/repos/galaxyproject/tools-devteam/issues/103","id":113282611,"user":{"login":"bgruening","id":469983,"avatar_url":"https://avatars.githubusercontent.com/u/469983?v=3","gravatar_id":"","url":"https://api.github.com/users/bgruening","html_url":"https://github.com/bgruening","followers_url":"https://api.github.com/users/bgruening/followers","following_url":"https://api.github.com/users/bgruening/following{/other_user}","gists_url":"https://api.github.com/users/bgruening/gists{/gist_id}","starred_url":"https://api.github.com/users/bgruening/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bgruening/subscriptions","organizations_url":"https://api.github.com/users/bgruening/orgs","repos_url":"https://api.github.com/users/bgruening/repos","events_url":"https://api.github.com/users/bgruening/events{/privacy}","received_events_url":"https://api.github.com/users/bgruening/received_events","type":"User","site_admin":false},"created_at":"2015-06-18T20:38:28Z","updated_at":"2015-06-18T20:38:28Z","body":":( sorry @jmchilton. It's just such a large change ..."}}