{"action":"created","issue":{"url":"https://api.github.com/repos/ernstlab/ChromTime/issues/4","repository_url":"https://api.github.com/repos/ernstlab/ChromTime","labels_url":"https://api.github.com/repos/ernstlab/ChromTime/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/ernstlab/ChromTime/issues/4/comments","events_url":"https://api.github.com/repos/ernstlab/ChromTime/issues/4/events","html_url":"https://github.com/ernstlab/ChromTime/issues/4","id":381870039,"node_id":"MDU6SXNzdWUzODE4NzAwMzk=","number":4,"title":"ZeroDivisionError: float division by zero","user":{"login":"chrisclarkson","id":26774207,"node_id":"MDQ6VXNlcjI2Nzc0MjA3","avatar_url":"https://avatars3.githubusercontent.com/u/26774207?v=4","gravatar_id":"","url":"https://api.github.com/users/chrisclarkson","html_url":"https://github.com/chrisclarkson","followers_url":"https://api.github.com/users/chrisclarkson/followers","following_url":"https://api.github.com/users/chrisclarkson/following{/other_user}","gists_url":"https://api.github.com/users/chrisclarkson/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisclarkson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisclarkson/subscriptions","organizations_url":"https://api.github.com/users/chrisclarkson/orgs","repos_url":"https://api.github.com/users/chrisclarkson/repos","events_url":"https://api.github.com/users/chrisclarkson/events{/privacy}","received_events_url":"https://api.github.com/users/chrisclarkson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-17T14:55:42Z","updated_at":"2018-11-17T15:43:26Z","closed_at":null,"author_association":"NONE","body":"Hi I think I have formatted my files properly this time:\r\n\r\n```\r\n1       3000211 3000312 HWI-D00436:416:CCFY2ANXX:3:1303:18089:47589/1   27      +\r\n1       3000228 3000327 HWI-D00436:416:CCFY2ANXX:4:1108:15962:53423/1   42      +\r\n1       3000228 3000327 HWI-D00436:416:CCFY2ANXX:4:1108:15962:53423/2   42      -\r\n1       3000239 3000339 HWI-D00436:416:CCFY2ANXX:3:1303:18089:47589/2   27      -\r\n1       3000349 3000449 HWI-D00436:416:CCFY2ANXX:3:1304:13359:3723/2    26      +\r\n1       3000420 3000520 HWI-D00436:416:CCFY2ANXX:3:1304:13359:3723/1    26      -\r\n\r\n\r\npython ~/ChromTime/ChromTime.py -a W4.bed KO4.bed -c INPUT_WT.bed INPUT_KO.bed -o H3K9ME3_4 -p development -t 4 -g mm9\r\n[2018-11-17 15:03:17] Options:\r\n {'aligned_fnames': ['W4_ME3.bed',\r\n                    'K4_ME3.bed'],\r\n 'bin_size': 200,\r\n 'broad': False,\r\n 'control_fnames': ['INPUT_WT_ME3.bed',\r\n                    'INPUT_KO_ME3.bed'],\r\n 'data_fname': None,\r\n 'fdr_for_decoding': 0.05,\r\n 'genome': 'mm9',\r\n 'keep_fixed_priors': False,\r\n 'merge_peaks': False,\r\n 'min_dynamic_prior': 0,\r\n 'min_expected_reads': 1,\r\n 'min_gap': 600,\r\n 'mode': 'narrow',\r\n 'model_fname': None,\r\n 'n_threads': 4,\r\n 'n_training_examples': 10000,\r\n 'order_fname': None,\r\n 'out_dir': 'H3K9ME3_4',\r\n 'output_empty_blocks': False,\r\n 'output_signal_files': False,\r\n 'p_value_extend': 0.15,\r\n 'prefix': 'development',\r\n 'q_value_seed': 0.05,\r\n 'shift': 100,\r\n 'skip_training': False,\r\n 'use_broad_window_for_background': False}\r\n[2018-11-17 15:03:17] Estimating initial block boundaries\r\n[2018-11-17 15:03:18] Reading reads from: \r\nW4_ME3.bed\r\n[2018-11-17 15:06:09] Total reads used for peak calling: 0\r\n[2018-11-17 15:06:09] Skipped reads outside of chromosome boundaries: 104676202\r\n[2018-11-17 15:06:09] Reading reads from: \r\nINPUT_WT_ME3.bed\r\n[2018-11-17 15:09:26] Total reads used for peak calling: 0\r\n[2018-11-17 15:09:26] Skipped reads outside of chromosome boundaries: 120787050\r\n```\r\n\r\nBut this time I'm getting the error:\r\n\r\n```\r\nTraceback (most recent call last):\r\n  File \"/home/cc16956/ChromTime/ChromTime.py\", line 865, in <module>\r\n    use_broad_window_for_background=args.use_broad_window_for_background)\r\n  File \"/home/cc16956/ChromTime/ChromTime.py\", line 537, in determine_block_boundaries\r\n    use_broad_window_for_background=use_broad_window_for_background)\r\n  File \"/home/cc16956/ChromTime/ChromTime.py\", line 112, in call_peaks\r\n    pseudo_one_read = float(min_expected_reads * total_background_reads) / total_foreground_reads\r\nZeroDivisionError: float division by zero\r\n```\r\n\r\nIs there something wrong with my data? I had originally prepared them from bamfiles with the command `bamtobed` from the 'bedtools' software... the output is as shown above.... do I not have sufficient coverage or something?"},"comment":{"url":"https://api.github.com/repos/ernstlab/ChromTime/issues/comments/439626276","html_url":"https://github.com/ernstlab/ChromTime/issues/4#issuecomment-439626276","issue_url":"https://api.github.com/repos/ernstlab/ChromTime/issues/4","id":439626276,"node_id":"MDEyOklzc3VlQ29tbWVudDQzOTYyNjI3Ng==","user":{"login":"chrisclarkson","id":26774207,"node_id":"MDQ6VXNlcjI2Nzc0MjA3","avatar_url":"https://avatars3.githubusercontent.com/u/26774207?v=4","gravatar_id":"","url":"https://api.github.com/users/chrisclarkson","html_url":"https://github.com/chrisclarkson","followers_url":"https://api.github.com/users/chrisclarkson/followers","following_url":"https://api.github.com/users/chrisclarkson/following{/other_user}","gists_url":"https://api.github.com/users/chrisclarkson/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisclarkson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisclarkson/subscriptions","organizations_url":"https://api.github.com/users/chrisclarkson/orgs","repos_url":"https://api.github.com/users/chrisclarkson/repos","events_url":"https://api.github.com/users/chrisclarkson/events{/privacy}","received_events_url":"https://api.github.com/users/chrisclarkson/received_events","type":"User","site_admin":false},"created_at":"2018-11-17T15:43:26Z","updated_at":"2018-11-17T15:43:26Z","author_association":"NONE","body":"based on the above I have done the following:\r\n\r\nI changed your ChromTime.py script as follows:\r\n\r\nI changed your `call_peaks` function-\r\n\r\n```\r\nprint(min_expected_reads, 'min_expected_reads')\r\nprint(total_background_reads,'total_background_reads')\r\nprint(total_foreground_reads,'total_foreground_reads')\r\nprint(float(min_expected_reads * total_background_reads), 'ratio')\r\npseudo_one_read = float(min_expected_reads * total_background_reads) / float(total_foreground_reads)\r\n```\r\nthe output of which is:\r\n\r\n```\r\n(1, 'min_expected_reads')\r\n(0, 'total_background_reads')\r\n(0, 'total_foreground_reads')\r\n(0.0, 'ratio')\r\n```\r\n\r\nfollowed by the same error....\r\n\r\nI checked the number of lines in each of the files I'm using- this produces numbers like: 122529570\r\nHowever your script says it skips reads that fall outside the given mapped genome- your script is skipping portions large numbers of reads: \r\n\r\n`Skipped reads outside of chromosome boundaries: 104676202`\r\n\r\nI am sure that the data I'm using are from mm9 which I have specified in the command....\r\n\r\nCould this be the source of the problem?\r\n"}}
{"actor":{"display_login":"chrisclarkson"}}