{"action":"created","issue":{"url":"https://api.github.com/repos/hammerlab/cohorts/issues/169","repository_url":"https://api.github.com/repos/hammerlab/cohorts","labels_url":"https://api.github.com/repos/hammerlab/cohorts/issues/169/labels{/name}","comments_url":"https://api.github.com/repos/hammerlab/cohorts/issues/169/comments","events_url":"https://api.github.com/repos/hammerlab/cohorts/issues/169/events","html_url":"https://github.com/hammerlab/cohorts/pull/169","id":196423047,"number":169,"title":"Fix variant stats; cached filtered variants; add exonic counts; add progress bar","user":{"login":"jburos","id":923453,"avatar_url":"https://avatars.githubusercontent.com/u/923453?v=3","gravatar_id":"","url":"https://api.github.com/users/jburos","html_url":"https://github.com/jburos","followers_url":"https://api.github.com/users/jburos/followers","following_url":"https://api.github.com/users/jburos/following{/other_user}","gists_url":"https://api.github.com/users/jburos/gists{/gist_id}","starred_url":"https://api.github.com/users/jburos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jburos/subscriptions","organizations_url":"https://api.github.com/users/jburos/orgs","repos_url":"https://api.github.com/users/jburos/repos","events_url":"https://api.github.com/users/jburos/events{/privacy}","received_events_url":"https://api.github.com/users/jburos/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2016-12-19T14:13:12Z","updated_at":"2017-01-18T15:58:59Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/hammerlab/cohorts/pulls/169","html_url":"https://github.com/hammerlab/cohorts/pull/169","diff_url":"https://github.com/hammerlab/cohorts/pull/169.diff","patch_url":"https://github.com/hammerlab/cohorts/pull/169.patch"},"body":"This is an updated version of another PR - #168\r\n\r\nNotes from that PR:\r\n\r\n1. Addresses issues #166 - variant stats lead to divide by zero error when total read count is 0 for a variant\r\n2. Also addresses #167 - filtering variant stats by type, irrespective of merged file type\r\n3. caches filtered variants as well as unfiltered variant collections\r\n4. pass **kwargs to filter_fn, if provided. This enables more flexible filtering \r\n\r\nAlso now includes PR #171:\r\n\r\n1. Clean up some issues in filtered-variants cache, namely:\r\n    - inspect closure of filter_fn for other filter_fns, use these to name the cached file\r\n    - ^ above method only works for python3; skip filtered cache on py2\r\n    - added some tests to identify issues in the above\r\n2. Made things more robust to errors reading from cache - e.g. fix #170  \r\n    - skip reading from cache if there is any error\r\n3. added a number of new summary functions to `cohorts.functions`, including `exonic_snv_count`, `expressed_exonic_snv_count`, etc.\r\n3. functions named 'snv' now explicitly filter for `.is_snv` type\r\n4. pass **kwargs through summary functions to filter functions; e.g. for functions like `variant_qc_filter`, so that the following works for `as_dataframe` & `plot_benefit`, etc.:\r\n\r\n    ```\r\n    df = cohort.as_dataframe(\r\n            on=[exonic_snv_count],\r\n            filter_fn=cohorts.variant_filters.variant_qc_filter,\r\n            min_tumor_depth=7,\r\n            min_normal_depth=7,\r\n            min_tumor_vaf=0.1,\r\n            max_normal_vaf=0.03,\r\n            min_tumor_alt_depth=0)\r\n    ```\r\n5. allow **kwargs use with multiple functions, e.g. so the above can be multiplexed:\r\n    ```\r\n    df = cohort.as_dataframe(\r\n            on=[exonic_snv_count, missense_snv_count, expressed_missense_snv_count],\r\n            filter_fn=cohorts.variant_filters.variant_qc_filter,\r\n            min_tumor_depth=7,\r\n            min_normal_depth=7,\r\n            min_tumor_vaf=0.1,\r\n            max_normal_vaf=0.03,\r\n            min_tumor_alt_depth=0)\r\n    ```\r\n    This will print a \"warning\" statement that the kwargs are passed to all functions, in lieu of previous behavior which resulted in an error.\r\n7. Added debug logging statements throughout load-variants & application of filter functions to test behavior.\r\n8. Added progress bar printing progress of function-application, to better know if process is running or stalled. \r\n    - modified logging to not use stdout, so that progress bars print correctly.\r\n\r\n    Output looks like:\r\n    ![screen shot 2016-12-21 at 2 08 07 pm](https://cloud.githubusercontent.com/assets/923453/21402534/f0f12bac-c786-11e6-8f44-7e1972ef4b41.png)\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/hammerlab/cohorts/issues/comments/273515721","html_url":"https://github.com/hammerlab/cohorts/pull/169#issuecomment-273515721","issue_url":"https://api.github.com/repos/hammerlab/cohorts/issues/169","id":273515721,"user":{"login":"jburos","id":923453,"avatar_url":"https://avatars.githubusercontent.com/u/923453?v=3","gravatar_id":"","url":"https://api.github.com/users/jburos","html_url":"https://github.com/jburos","followers_url":"https://api.github.com/users/jburos/followers","following_url":"https://api.github.com/users/jburos/following{/other_user}","gists_url":"https://api.github.com/users/jburos/gists{/gist_id}","starred_url":"https://api.github.com/users/jburos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jburos/subscriptions","organizations_url":"https://api.github.com/users/jburos/orgs","repos_url":"https://api.github.com/users/jburos/repos","events_url":"https://api.github.com/users/jburos/events{/privacy}","received_events_url":"https://api.github.com/users/jburos/received_events","type":"User","site_admin":false},"created_at":"2017-01-18T15:58:59Z","updated_at":"2017-01-18T15:58:59Z","body":"@tavinathanson made a bunch of requested changes - can you take another look when you have a chance? Not urgent .. "}}
{"actor":{"display_login":"jburos"}}