{"action":"created","issue":{"url":"https://api.github.com/repos/tfwillems/HipSTR/issues/13","repository_url":"https://api.github.com/repos/tfwillems/HipSTR","labels_url":"https://api.github.com/repos/tfwillems/HipSTR/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/tfwillems/HipSTR/issues/13/comments","events_url":"https://api.github.com/repos/tfwillems/HipSTR/issues/13/events","html_url":"https://github.com/tfwillems/HipSTR/issues/13","id":161964507,"number":13,"title":"SIGFPE on downsampled data","user":{"login":"holtgrewe","id":521780,"avatar_url":"https://avatars.githubusercontent.com/u/521780?v=3","gravatar_id":"","url":"https://api.github.com/users/holtgrewe","html_url":"https://github.com/holtgrewe","followers_url":"https://api.github.com/users/holtgrewe/followers","following_url":"https://api.github.com/users/holtgrewe/following{/other_user}","gists_url":"https://api.github.com/users/holtgrewe/gists{/gist_id}","starred_url":"https://api.github.com/users/holtgrewe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/holtgrewe/subscriptions","organizations_url":"https://api.github.com/users/holtgrewe/orgs","repos_url":"https://api.github.com/users/holtgrewe/repos","events_url":"https://api.github.com/users/holtgrewe/events{/privacy}","received_events_url":"https://api.github.com/users/holtgrewe/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-06-23T16:20:09Z","updated_at":"2016-06-24T16:23:30Z","closed_at":null,"body":"I sampled down the data to 10 STRs and I'm seeting the following\r\n\r\n```\r\nProgram received signal SIGFPE, Arithmetic exception.\r\n```\r\n\r\nOpening gdb shows me that a `0 % 0` division takes place\r\n\r\n```\r\n#0  0x0000000000441c70 in StutterModel::log_stutter_pmf (this=0x1e70d80, sample_bps=0, read_bps=0) at stutter_model.cpp:32\r\n32\t  if (bp_diff % motif_len_ != 0){\r\n(gdb) p bp_diff\r\n$1 = 0\r\n(gdb) p motif_len_\r\n$2 = 0\r\n(gdb) l\r\n27\t  Returns the read's log-likeliood given that it contains exactly the provided number of base pairs\r\n28\t*/\r\n29\tdouble StutterModel::log_stutter_pmf(int sample_bps, int read_bps){\r\n30\t  double log_pmf;\r\n31\t  int bp_diff = read_bps - sample_bps;\r\n32\t  if (bp_diff % motif_len_ != 0){\r\n33\t    int eff_diff = bp_diff - (bp_diff/motif_len_);\r\n34\t    if (eff_diff < 0)\r\n35\t      log_pmf = out_log_down_ + out_log_nostep_ + out_log_step_*(-eff_diff-1);\r\n36\t    else\r\n```"},"comment":{"url":"https://api.github.com/repos/tfwillems/HipSTR/issues/comments/228391927","html_url":"https://github.com/tfwillems/HipSTR/issues/13#issuecomment-228391927","issue_url":"https://api.github.com/repos/tfwillems/HipSTR/issues/13","id":228391927,"user":{"login":"tfwillems","id":4562953,"avatar_url":"https://avatars.githubusercontent.com/u/4562953?v=3","gravatar_id":"","url":"https://api.github.com/users/tfwillems","html_url":"https://github.com/tfwillems","followers_url":"https://api.github.com/users/tfwillems/followers","following_url":"https://api.github.com/users/tfwillems/following{/other_user}","gists_url":"https://api.github.com/users/tfwillems/gists{/gist_id}","starred_url":"https://api.github.com/users/tfwillems/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tfwillems/subscriptions","organizations_url":"https://api.github.com/users/tfwillems/orgs","repos_url":"https://api.github.com/users/tfwillems/repos","events_url":"https://api.github.com/users/tfwillems/events{/privacy}","received_events_url":"https://api.github.com/users/tfwillems/received_events","type":"User","site_admin":false},"created_at":"2016-06-24T16:23:30Z","updated_at":"2016-06-24T16:23:30Z","body":"It looks like this issue is arising because you have an STR with a period/motif length of 0. As a result, this results in a % 0 operation on line 32.  I don't believe it is due to a trailing \",\", as I tested this and it doesn't seem to have an effect. Can you attach a copy of the region file you're using to run HipSTR?"}}
{"actor":{"display_login":"tfwillems"}}