bugNumerical Library for Haploid Genetics - Bugs: bug #30720, Allele frequencies changing...

 
 

bug #30720: Allele frequencies changing without selection or mutation

Submitter:  None
Submitted:  Tue 10 Aug 2010 12:02:57 AM UTC
   
 
Category:  Library Severity:  3 - Normal
Item Group:  None Status:  In Progress
Privacy:  Public Assigned to:  trashbird1240
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Mon 06 Dec 2010 04:38:34 PM UTC, comment #17: 

-*- mode: compilation; default-directory: "~/Public/src/haploid/" -*-
Compilation started at Thu Dec  2 13:28:16

make -k check
make  sim_stop pop_ck sparse_test diseq rec_test
make[1]: Entering directory `/home/joel/Public/src/haploid'
make[1]: `pop_ck' is up to date.
make[1]: `sparse_test' is up to date.
make[1]: `diseq' is up to date.
make[1]: `rec_test' is up to date.
make[1]: Leaving directory `/home/joel/Public/src/haploid'
make  check-TESTS
make[1]: Entering directory `/home/joel/Public/src/haploid'
PASS: sim_stop
PASS: pop_ck
PASS: sparse_test
Change in allele frequency detected:
Starting frequency: p[0] = 0.50000000000000000000000000000000000000000000000000000
New frequency: p[0] = 0.50000000000001088018564132653409615159034729003906250
[...]
/bin/sh: line 5: 11068 Aborted                 (core dumped) ${dir}$tst
FAIL: rec_test
Value by hand: 0.170442
Value by ld_from_geno: 0.170442
PASS: diseq
=========================================
1 of 5 tests failed
Please report to -email is unavailable-
=========================================
make[1]: * [check-TESTS] Error 1
make[1]: Leaving directory `/home/joel/Public/src/haploid'
make: * [check-am] Error 2
make: Target `check' not remade because of errors.

Compilation exited abnormally with code 2 at Fri Dec  3 04:31:32

Joel J. Adamson <trashbird1240>
Group administrator
Thu 02 Dec 2010 06:35:59 PM UTC, comment #16: 

With 9 loci there is a difference at the ninth decimal place.  At this point it looks like a floating point error and we will have to conduct further tests to determine if it is significant.

Joel J. Adamson <trashbird1240>
Group administrator
Thu 02 Sep 2010 12:33:22 PM UTC, comment #15: 

With 9 loci (= 512 genotypes) the test failed, printing


Change in allele frequency detected:
Starting frequency: p[0] = 0.50000000
New frequency: p[0] = 0.50000000


We can conclude that this is a floating-point error.

Joel J. Adamson <trashbird1240>
Group administrator
Wed 01 Sep 2010 07:51:05 PM UTC, comment #14: 

The test as it is goes pretty close the limits of published recombination algorithms (with r = 0.5), so we may be waiting a while for the test to finish.

Joel J. Adamson <trashbird1240>
Group administrator
Wed 01 Sep 2010 07:46:20 PM UTC, comment #13: 

Changes in revision 1112 fix this.  Revision 1113 includes a thorough test.    We can close this as soon as the test finishes on my machine.

Joel J. Adamson <trashbird1240>
Group administrator
Mon 30 Aug 2010 12:15:45 AM UTC, comment #12: 

We need to track the parental genome we are starting with.  Use the branching array design to keep track of genuine branch points (true "maybes").

Joel J. Adamson <trashbird1240>
Group administrator
Tue 24 Aug 2010 12:32:18 AM UTC, comment #11: 

Test fails with three loci and r = 0.3.  Why?

Joel J. Adamson <trashbird1240>
Group administrator
Mon 23 Aug 2010 09:35:39 PM UTC, comment #10: 

Four-locus simulation chokes; my suspicion is that we are ending up with more than two expressions to sum, thereby not subtracting enough.  We need to find a way to add the expressions on the fly so we get as many as we need.

Joel J. Adamson <trashbird1240>
Group administrator
Mon 23 Aug 2010 06:55:04 PM UTC, comment #9: 

Now producing correct tables for two and three loci; we should not close this bug until we have tested larger numbers of loci.

Joel J. Adamson <trashbird1240>
Group administrator
Tue 10 Aug 2010 08:27:45 PM UTC, comment #8: 

Revising the mating table calculations for the random mating examples produces allele frequencies that do not change.  See mating.c in revision 1086.

Joel J. Adamson <trashbird1240>
Group administrator
Tue 10 Aug 2010 07:59:04 PM UTC, comment #7: 

Revision 1084 fixes the problem of not assigning to crosses that can produce certain offspring.

Joel J. Adamson <trashbird1240>
Group administrator
Tue 10 Aug 2010 06:18:06 PM UTC, comment #6: 

Rec_gen_table is producing incorrect recombination tables!

For example, the table for offspring 3 in a tlta with r = 0.5:


0.00 0.00 0.00 0.25
0.00 0.00 0.25 0.50
0.00 0.25 0.00 0.50
0.25 0.50 0.50 1.00


but instead it is


Offspring 3:
0:0.00000000 0.00000000 0.00000000 0.25000000
1:0.00000000 0.00000000 0.00000000 0.50000000
2:0.00000000 0.25000000 0.00000000 0.50000000
3:0.25000000 0.50000000 0.50000000 1.00000000


Joel J. Adamson <trashbird1240>
Group administrator
Tue 10 Aug 2010 06:17:05 PM UTC, comment #5: 

Rec_gen_table is producing incorrect recombination tables!

For example, the table for offspring 3 in a tlta with r = 0.5:


0.00 0.00 0.00 0.25
0.00 0.00 0.25 0.50
0.00 0.25 0.00 0.50
0.25 0.50 0.50 1.00
-verbatim+

but instead it is

+verbatim+
Offspring 3:
0:0.00000000 0.00000000 0.00000000 0.25000000
1:0.00000000 0.00000000 0.00000000 0.50000000
2:0.00000000 0.25000000 0.00000000 0.50000000
3:0.25000000 0.50000000 0.50000000 1.00000000


Joel J. Adamson <trashbird1240>
Group administrator
Tue 10 Aug 2010 06:15:22 PM UTC, comment #4: 

Rec_gen_table is producing incorrect recombination tables!

For example, the table for offspring 3 in a tlta with r = 0.5:


0.00 0.00 0.00 0.25
0.00 0.00 0.25 0.50
0.00 0.25 0.00 0.50
0.25 0.50 0.50 1.00
-verbatim+

but instead it is

+verbatim+
Offspring 3:
0:0.00000000 0.00000000 0.00000000 0.25000000
1:0.00000000 0.00000000 0.00000000 0.50000000
2:0.00000000 0.25000000 0.00000000 0.50000000
3:0.25000000 0.50000000 0.50000000 1.00000000


Joel J. Adamson <trashbird1240>
Group administrator
Tue 10 Aug 2010 05:11:11 PM UTC, comment #3: 

Removing the denominator from rec_mating is logical (the denominator should be taken care of in the mating table calculation).  However, small errors lead to a large deviation from frequencies that sum to 1.0:


(gdb) p 0.81000000000000005 + 0.090000000000000011 + 0.088987500000000011 + 0.0089875000000000024
$41 = 0.99797499999999983
(gdb) p 0.81000000000000 + 0.090000000000000 + 0.088987500000000 + 0.0089875000000000
$42 = 0.99797499999999983
(gdb) p 1.0 - $42
$43 = 0.0020250000000001656


Joel J. Adamson <trashbird1240>
Group administrator
Tue 10 Aug 2010 03:06:33 PM UTC, comment #2: 
  • Possible Programming Errors

 0 Uncaught errors

  1. floating point errors
  2. adding over the wrong indices


Joel J. Adamson <trashbird1240>
Group administrator
Tue 10 Aug 2010 03:04:46 PM UTC, comment #1: 

== Possible Programming Errors ==

  1. Uncaught errors


  1. floating point errors


  1. adding over the wrong indices


 

Joel J. Adamson <trashbird1240>
Group administrator
Tue 10 Aug 2010 12:02:57 AM UTC, original submission:  

See the following output of nrm:

joel@ezra: ~/Downloads/haploid-svn > ./nrm
0.01974340 0.44058534 0.02151351 0.51815775 0.00075166
0.00481892 0.42372376 0.00512739 0.56632993 0.00055650
0.00097273 0.37189410 0.00102674 0.62610643 0.00022720
0.00017616 0.28200642 0.00019377 0.71762365 0.00007177
0.00002753 0.15952647 0.00003409 0.84041191 0.00001770
0.00000337 0.05297994 0.00000520 0.94701149 0.00000292
0.00000032 0.00920273 0.00000067 0.99079628 0.00000031
0.00000003 0.00111590 0.00000008 0.99888399 0.00000003
0.00000000 0.00012535 0.00000001 0.99987464 0.00000000
0.00000000 0.00001394 0.00000000 0.99998605 0.00000000
0.00000000 0.00000155 0.00000000 0.99999845 0.00000000
0.00000000 0.00000017 0.00000000 0.99999983 0.00000000
0.00000000 0.00000002 0.00000000 0.99999998 0.00000000
0.00000000 0.00000000 0.00000000 1.00000000 0.00000000
0.00000000 0.00000000 0.00000000 1.00000000 0.00000000
0.00000000 0.00000000 0.00000000 1.00000000 0.00000000


According to Emacs calc, the frequency of the focal allele at locus 1 changes from  0.95874309 to  0.99005369.


Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by trashbird1240 (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-12-02 trashbird1240 Severity5 - Blocker 3 - Normal
        StatusReady For Test In Progress
        Open/ClosedClosed Open
    2010-09-02 trashbird1240 CategoryNone Library
        Open/ClosedOpen Closed
    2010-09-01 trashbird1240 StatusNone Ready For Test
    2010-08-10 trashbird1240 Severity3 - Normal 5 - Blocker
        Assigned toNone trashbird1240

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code