{"action":"created","issue":{"url":"https://api.github.com/repos/alexlancaster/pypop/issues/17","repository_url":"https://api.github.com/repos/alexlancaster/pypop","labels_url":"https://api.github.com/repos/alexlancaster/pypop/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/alexlancaster/pypop/issues/17/comments","events_url":"https://api.github.com/repos/alexlancaster/pypop/issues/17/events","html_url":"https://github.com/alexlancaster/pypop/issues/17","id":241112619,"number":17,"title":"HWP output issues: missing common genotypes and incorrect Guo & Thompson stats","user":{"login":"alexlancaster","id":5281946,"avatar_url":"https://avatars0.githubusercontent.com/u/5281946?v=3","gravatar_id":"","url":"https://api.github.com/users/alexlancaster","html_url":"https://github.com/alexlancaster","followers_url":"https://api.github.com/users/alexlancaster/followers","following_url":"https://api.github.com/users/alexlancaster/following{/other_user}","gists_url":"https://api.github.com/users/alexlancaster/gists{/gist_id}","starred_url":"https://api.github.com/users/alexlancaster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexlancaster/subscriptions","organizations_url":"https://api.github.com/users/alexlancaster/orgs","repos_url":"https://api.github.com/users/alexlancaster/repos","events_url":"https://api.github.com/users/alexlancaster/events{/privacy}","received_events_url":"https://api.github.com/users/alexlancaster/received_events","type":"User","site_admin":false},"labels":[{"id":62032289,"url":"https://api.github.com/repos/alexlancaster/pypop/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/alexlancaster/pypop/milestones/1","html_url":"https://github.com/alexlancaster/pypop/milestone/1","labels_url":"https://api.github.com/repos/alexlancaster/pypop/milestones/1/labels","id":2591353,"number":1,"title":"High","description":null,"creator":{"login":"alexlancaster","id":5281946,"avatar_url":"https://avatars0.githubusercontent.com/u/5281946?v=3","gravatar_id":"","url":"https://api.github.com/users/alexlancaster","html_url":"https://github.com/alexlancaster","followers_url":"https://api.github.com/users/alexlancaster/followers","following_url":"https://api.github.com/users/alexlancaster/following{/other_user}","gists_url":"https://api.github.com/users/alexlancaster/gists{/gist_id}","starred_url":"https://api.github.com/users/alexlancaster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexlancaster/subscriptions","organizations_url":"https://api.github.com/users/alexlancaster/orgs","repos_url":"https://api.github.com/users/alexlancaster/repos","events_url":"https://api.github.com/users/alexlancaster/events{/privacy}","received_events_url":"https://api.github.com/users/alexlancaster/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":0,"state":"open","created_at":"2017-06-19T16:28:02Z","updated_at":"2017-07-06T23:15:59Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2017-07-06T23:12:50Z","updated_at":"2017-07-11T21:08:00Z","closed_at":null,"body":"Transferring from issue #4 comment https://github.com/alexlancaster/pypop/issues/4#issuecomment-313516210 originally by @sjmack:\r\n\r\n\r\n\r\nHowever, I have constructed a test data file (the controls from the [BIGDAWG](https://github.com/IgDAWG/BIGDAWG) synthetic datafile) that reveals several issues with the current HW implementations (vs version 0.7.0). \r\n\r\nI'm attaching two versions of this test file: \r\n[BIGDAWG_SynthControl_Data.pop.txt](https://github.com/alexlancaster/pypop/files/1129192/BIGDAWG_SynthControl_Data.pop.txt)\r\nand\r\n[BIGDAWG_SynthControl_Data_dash.pop.txt](https://github.com/alexlancaster/pypop/files/1129193/BIGDAWG_SynthControl_Data_dash.pop.txt)\r\nAnd the associated .ini file: \r\n[WS_BDCtrl_Test_HW.ini.txt](https://github.com/alexlancaster/pypop/files/1129198/WS_BDCtrl_Test_HW.ini.txt)\r\nBe sure to remove the .txt suffices. \r\n\r\nThe difference between the two datasets is that the *_dash.pop file has the colons converted to dashes. I did this so that I could compare the current developmental version of PyPop on my Mac to v0.7.0 running on my PC. I could only run the *_dash.pop file on my PC.\r\n\r\nI have three set of results. The *git.* versions were generated using this development version of PyPop, and the *070.* versions with the current release version. \r\n\r\nFirst of all, you will notice that there are no Common Genotypes being generated with the development version. The results below show the dash datasets, but the same happens when colons are included for the developmental version. \r\n\r\nCompare (Git): \r\n```\r\n------------------------------------------------------------------------------\r\nCommon heterozygotes by allele\r\n       01-01-01-01         152      152.25        0.00        0.9839      \r\n       02-01-01-01          56       56.32        0.00        0.9658      \r\n          02-05-01         132      131.94        0.00        0.9957      \r\n       03-01-01-01         135      134.51        0.00        0.9662      \r\n          03-01-03         102      102.18        0.00        0.9858      \r\n       11-01-01-01          57       57.26        0.00        0.9723      \r\n       11-01-01-02          57       57.26        0.00        0.9723      \r\n          23-01-01          43       43.99        0.02        0.8814      \r\n       24-02-01-01         145      144.70        0.00        0.9801      \r\n          24-02-04          56       56.32        0.00        0.9658      \r\n          25-01-01          38       37.28        0.01        0.9061      \r\n          26-01-01          92       91.40        0.00        0.9501      \r\n             26-08         105      104.85        0.00        0.9885      \r\n       29-01-01-01          56       56.32        0.00        0.9658      \r\n       29-02-01-02         102      102.18        0.00        0.9858      \r\n       31-01-02-01          92       91.40        0.00        0.9501      \r\n       31-01-02-02           9        8.96        0.00        0.9892      \r\n          32-01-01          30       29.55        0.01        0.9342      \r\n             32-02         183      182.44        0.00        0.9667      \r\n          33-01-01           9        8.96        0.00        0.9892      \r\n          68-01-01          76       76.81        0.01        0.9267      \r\n             68-06         155      154.75        0.00        0.9838      \r\n\r\n------------------------------------------------------------------------------\r\nCommon genotypes\r\n             Total           0        0.00\r\n------------------------------------------------------------------------------\r\n```\r\n\r\nWith (v0.7.0):\r\n```\r\n------------------------------------------------------------------------------\r\nCommon heterozygotes by allele\r\n       01-01-01-01         152      152.25        0.00        0.9839      \r\n       02-01-01-01          56       56.32        0.00        0.9658      \r\n          02-05-01         132      131.94        0.00        0.9957      \r\n       03-01-01-01         135      134.51        0.00        0.9662      \r\n          03-01-03         102      102.18        0.00        0.9858      \r\n       11-01-01-01          57       57.26        0.00        0.9723      \r\n       11-01-01-02          57       57.26        0.00        0.9723      \r\n          23-01-01          43       43.99        0.02        0.8814      \r\n       24-02-01-01         145      144.70        0.00        0.9801      \r\n          24-02-04          56       56.32        0.00        0.9658      \r\n          25-01-01          38       37.28        0.01        0.9061      \r\n          26-01-01          92       91.40        0.00        0.9501      \r\n             26-08         105      104.85        0.00        0.9885      \r\n       29-01-01-01          56       56.32        0.00        0.9658      \r\n       29-02-01-02         102      102.18        0.00        0.9858      \r\n       31-01-02-01          92       91.40        0.00        0.9501      \r\n       31-01-02-02           9        8.96        0.00        0.9892      \r\n          32-01-01          30       29.55        0.01        0.9342      \r\n             32-02         183      182.44        0.00        0.9667      \r\n          33-01-01           9        8.96        0.00        0.9892      \r\n          68-01-01          76       76.81        0.01        0.9267      \r\n             68-06         155      154.75        0.00        0.9838      \r\n\r\n------------------------------------------------------------------------------\r\nCommon genotypes\r\n-01-01:01-01-01-01           7        6.88        0.00        0.9621      \r\n-01-01-01:02-05-01          11       11.76        0.05        0.8241      \r\n-01-01:03-01-01-01          12       12.01        0.00        0.9975      \r\n-01-01-01:03-01-03           9        8.95        0.00        0.9856      \r\n-01-01:24-02-01-01          13       13.00        0.00        0.9989      \r\n-01-01-01:26-01-01           8        7.95        0.00        0.9864      \r\n 01-01-01-01:26-08           9        9.19        0.00        0.9488      \r\n-01-01:29-02-01-02           9        8.95        0.00        0.9856      \r\n-01-01:31-01-02-01           8        7.95        0.00        0.9864      \r\n 01-01-01-01:32-02          16       16.82        0.04        0.8424      \r\n-01-01-01:68-01-01           7        6.63        0.02        0.8847      \r\n 01-01-01-01:68-06          14       14.00        0.00        0.9998      \r\n 02-01-01-01:32-02           6        5.88        0.00        0.9590      \r\n 02-05-01:02-05-01           5        5.03        0.00        0.9890      \r\n-05-01:03-01-01-01          10       10.27        0.01        0.9318      \r\n 02-05-01:03-01-03           8        7.65        0.02        0.9001      \r\n-05-01:24-02-01-01          11       11.12        0.00        0.9702      \r\n 02-05-01:26-01-01           7        6.80        0.01        0.9396      \r\n    02-05-01:26-08           8        7.87        0.00        0.9617      \r\n-05-01:29-02-01-02           8        7.65        0.02        0.9001      \r\n-05-01:31-01-02-01           7        6.80        0.01        0.9396      \r\n    02-05-01:32-02          14       14.38        0.01        0.9193      \r\n 02-05-01:68-01-01           6        5.67        0.02        0.8893      \r\n    02-05-01:68-06          12       11.98        0.00        0.9942      \r\n-01-01:03-01-01-01           5        5.25        0.01        0.9146      \r\n-01-01-01:03-01-03           8        7.81        0.00        0.9471      \r\n-01-01:24-02-01-01          12       11.36        0.04        0.8493      \r\n-01-01-01:26-01-01           7        6.95        0.00        0.9837      \r\n 03-01-01-01:26-08           8        8.03        0.00        0.9911      \r\n-01-01:29-02-01-02           8        7.81        0.00        0.9471      \r\n-01-01:31-01-02-01           7        6.95        0.00        0.9837      \r\n 03-01-01-01:32-02          15       14.69        0.01        0.9351      \r\n-01-01-01:68-01-01           6        5.79        0.01        0.9299      \r\n 03-01-01-01:68-06          12       12.23        0.00        0.9480      \r\n-01-03:24-02-01-01           8        8.46        0.03        0.8741      \r\n 03-01-03:26-01-01           5        5.17        0.01        0.9391      \r\n    03-01-03:26-08           6        5.98        0.00        0.9941      \r\n-01-03:29-02-01-02           6        5.82        0.01        0.9406      \r\n-01-03:31-01-02-01           5        5.17        0.01        0.9391      \r\n    03-01-03:32-02          11       10.94        0.00        0.9856      \r\n    03-01-03:68-06           9        9.11        0.00        0.9715      \r\n 11-01-01-01:32-02           6        5.98        0.00        0.9923      \r\n 11-01-01-02:32-02           6        5.98        0.00        0.9923      \r\n-01-01:24-02-01-01           6        6.15        0.00        0.9518      \r\n-02-01-01:26-01-01           8        7.52        0.03        0.8613      \r\n 24-02-01-01:26-08           9        8.70        0.01        0.9179      \r\n-01-01:29-02-01-02           8        8.46        0.03        0.8741      \r\n-01-01:31-01-02-01           8        7.52        0.03        0.8613      \r\n 24-02-01-01:32-02          16       15.90        0.00        0.9807      \r\n-02-01-01:68-01-01           6        6.27        0.01        0.9149      \r\n 24-02-01-01:68-06          13       13.24        0.00        0.9474      \r\n    24-02-04:32-02           6        5.88        0.00        0.9590      \r\n    26-01-01:26-08           5        5.32        0.02        0.8905      \r\n-01-01:29-02-01-02           5        5.17        0.01        0.9391      \r\n    26-01-01:32-02          10        9.72        0.01        0.9296      \r\n    26-01-01:68-06           8        8.10        0.00        0.9731      \r\n 26-08:29-02-01-02           6        5.98        0.00        0.9941      \r\n 26-08:31-01-02-01           5        5.32        0.02        0.8905      \r\n       26-08:32-02          11       11.24        0.01        0.9420      \r\n       26-08:68-06           9        9.36        0.01        0.9061      \r\n 29-01-01-01:32-02           6        5.88        0.00        0.9590      \r\n-01-02:31-01-02-01           5        5.17        0.01        0.9391      \r\n 29-02-01-02:32-02          11       10.94        0.00        0.9856      \r\n 29-02-01-02:68-06           9        9.11        0.00        0.9715      \r\n 31-01-02-01:32-02          10        9.72        0.01        0.9296      \r\n 31-01-02-01:68-06           8        8.10        0.00        0.9731      \r\n       32-02:32-02          10       10.28        0.01        0.9300      \r\n    32-02:68-01-01           8        8.10        0.00        0.9709      \r\n       32-02:68-06          17       17.12        0.00        0.9770      \r\n    68-01-01:68-06           7        6.75        0.01        0.9223      \r\n       68-06:68-06           7        7.13        0.00        0.9624      \r\n             Total         612      612.81\r\n------------------------------------------------------------------------------\r\n```\r\nIn addition, the stats being reported for the developmental version include errors; especially for the Chen and Diff tests, where obs and exp values are 0. The differences in the p-values for the mcmc results probably stem from the Markov-Chain, but I only did each one once, so I'm not certain.\r\n\r\nCompare (Git): \r\n```\r\n3.3. Guo and Thompson HardyWeinberg output (mcmc) [DQB1]\r\n--------------------------------------------------------\r\nTotal steps in MCMC: 1000000\r\nDememorization steps: 2000\r\nNumber of Markov chain samples: 1000\r\nMarkov chain sample size: 1000\r\nStd. error:       0\r\np-value (overall): 0.0000*****\r\n\r\nIndividual genotype p-values found to be significant\r\nGenotype (observed/expected) [Chen's pval] [diff pval]\r\n03-02-12+03-02-12 (0/0.000000) 0.0007*** 0.0007***\r\n05-03-01-01+03-02-12 (0/0.000000) 0.0000***** 0.0000*****\r\n05-03-01-01+05-03-01-01 (0/0.000000) 0.0000***** 0.0000*****\r\n06-02-01+05-03-01-01 (0/0.000000) 0.0000***** 0.0000*****\r\n06-02-01+06-02-01 (0/0.000000) 0.0001*** 0.0001***\r\n06-03-01+04-02-01 (0/0.000000) 0.0000***** 0.0000*****\r\n06-05-01+05-03-01-01 (0/0.000000) 0.0000**** 0.0000*****\r\n06-05-01+06-05-01 (0/0.000000) 0.0049** 0.0049**\r\n\r\n\r\n3.4. Guo and Thompson HardyWeinberg output (monte-carlo) [DQB1]\r\n---------------------------------------------------------------\r\nSteps in Monte-Carlo randomization: 100000\r\np-value (overall): 0.0000*****\r\n\r\nIndividual genotype p-values found to be significant\r\nGenotype (observed/expected) [Chen's pval] [diff pval]\r\n03-02-12+03-02-12 (0/0.000000) 0.0017** 0.0017**\r\n05-03-01-01+03-02-12 (0/0.000000) 0.0000***** 0.0000*****\r\n05-03-01-01+05-03-01-01 (0/0.000000) 0.0000***** 0.0000*****\r\n06-02-01+05-03-01-01 (0/0.000000) 0.0000***** 0.0000*****\r\n06-02-01+06-02-01 (0/0.000000) 0.0007*** 0.0007***\r\n06-03-01+04-02-01 (0/0.000000) 0.0000***** 0.0000*****\r\n06-05-01+05-03-01-01 (0/0.000000) 0.0000**** 0.0000****\r\n06-05-01+06-05-01 (0/0.000000) 0.0016** 0.0016**\r\n```\r\n\r\nto (version 0.7.0): \r\n```\r\n3.3. Guo and Thompson HardyWeinberg output (mcmc) [DQB1]\r\n--------------------------------------------------------\r\nTotal steps in MCMC: 1000000\r\nDememorization steps: 2000\r\nNumber of Markov chain samples: 1000\r\nMarkov chain sample size: 1000\r\nStd. error:       0\r\np-value (overall): 0.0000*****\r\n\r\nIndividual genotype p-values found to be significant\r\nGenotype (observed/expected) [Chen's pval] [diff pval]\r\n03-02-12:03-02-12:  (18/8.818363) 0.0017** 0.0017**\r\n05-03-01-01:03-02-12:  (0/18.105788) 0.0000***** 0.0000*****\r\n05-03-01-01:05-03-01-01:  (39/9.293663) 0.0000***** 0.0000*****\r\n06-02-01:05-03-01-01:  (0/23.499002) 0.0000***** 0.0000*****\r\n06-02-01:06-02-01:  (27/14.854291) 0.0000***** 0.0000*****\r\n06-03-01:04-02-01:  (8/0.287425) 0.0000***** 0.0000*****\r\n06-05-01:05-03-01-01:  (0/18.105788) 0.0000***** 0.0000*****\r\n06-05-01:06-05-01:  (18/8.818363) 0.0011** 0.0011**\r\n\r\n\r\n3.4. Guo and Thompson HardyWeinberg output (monte-carlo) [DQB1]\r\n---------------------------------------------------------------\r\nSteps in Monte-Carlo randomization: 100000\r\np-value (overall): 0.0000*****\r\n\r\nIndividual genotype p-values found to be significant\r\nGenotype (observed/expected) [Chen's pval] [diff pval]\r\n03-02-12:03-02-12:  (18/8.818363) 0.0017** 0.0017**\r\n05-03-01-01:03-02-12:  (0/18.105788) 0.0000***** 0.0000*****\r\n05-03-01-01:05-03-01-01:  (39/9.293663) 0.0000***** 0.0000*****\r\n06-02-01:05-03-01-01:  (0/23.499002) 0.0000***** 0.0000*****\r\n06-02-01:06-02-01:  (27/14.854291) 0.0007*** 0.0007***\r\n06-03-01:04-02-01:  (8/0.287425) 0.0000***** 0.0000*****\r\n06-05-01:05-03-01-01:  (0/18.105788) 0.0000**** 0.0000****\r\n06-05-01:06-05-01:  (18/8.818363) 0.0016** 0.0016**\r\n\r\n```\r\n\r\nHere are the results: \r\n\r\n[BIGDAWG_SynthControl_Data-out.git.txt](https://github.com/alexlancaster/pypop/files/1129218/BIGDAWG_SynthControl_Data-out.git.txt)\r\n[BIGDAWG_SynthControl_Data-out.git.xml.txt](https://github.com/alexlancaster/pypop/files/1129220/BIGDAWG_SynthControl_Data-out.git.xml.txt)\r\n[BIGDAWG_SynthControl_Data_dash-out.git.txt](https://github.com/alexlancaster/pypop/files/1129222/BIGDAWG_SynthControl_Data_dash-out.git.txt)\r\n[BIGDAWG_SynthControl_Data_dash-out.git.xml.txt](https://github.com/alexlancaster/pypop/files/1129221/BIGDAWG_SynthControl_Data_dash-out.git.xml.txt)\r\n[BIGDAWG_SynthControl_Data_dash-out.070.txt](https://github.com/alexlancaster/pypop/files/1129225/BIGDAWG_SynthControl_Data_dash-out.070.txt)\r\n[BIGDAWG_SynthControl_Data_dash-out.070.xml.txt](https://github.com/alexlancaster/pypop/files/1129226/BIGDAWG_SynthControl_Data_dash-out.070.xml.txt)\r\n\r\nAgain, remove the .txt from the .XML filenames."},"comment":{"url":"https://api.github.com/repos/alexlancaster/pypop/issues/comments/314572381","html_url":"https://github.com/alexlancaster/pypop/issues/17#issuecomment-314572381","issue_url":"https://api.github.com/repos/alexlancaster/pypop/issues/17","id":314572381,"user":{"login":"alexlancaster","id":5281946,"avatar_url":"https://avatars0.githubusercontent.com/u/5281946?v=3","gravatar_id":"","url":"https://api.github.com/users/alexlancaster","html_url":"https://github.com/alexlancaster","followers_url":"https://api.github.com/users/alexlancaster/followers","following_url":"https://api.github.com/users/alexlancaster/following{/other_user}","gists_url":"https://api.github.com/users/alexlancaster/gists{/gist_id}","starred_url":"https://api.github.com/users/alexlancaster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexlancaster/subscriptions","organizations_url":"https://api.github.com/users/alexlancaster/orgs","repos_url":"https://api.github.com/users/alexlancaster/repos","events_url":"https://api.github.com/users/alexlancaster/events{/privacy}","received_events_url":"https://api.github.com/users/alexlancaster/received_events","type":"User","site_admin":false},"created_at":"2017-07-11T21:08:00Z","updated_at":"2017-07-11T21:08:00Z","body":"@sjmack: the problem had a common origin: generating the genotype output table, the fix I just pushed to ```master``` (i.e. just ```git pull``` and ```./setup.py build``` again) should fix both the common genotype as well as the output in the Guo & Thompson.  I added one of your files (the non-dash one) to the test suite (can you re-run ```py.test -s -v```?).  Is it worth also adding the dash version as well?"}}
{"actor":{"display_login":"alexlancaster"}}