Skip to content

Commit

Permalink
enable sci notation format extension by default
Browse files Browse the repository at this point in the history
* update all unit test output and MD5 where appropriate

* pad the HW tables by an additional space in each cell to account for
  scientific notation
  • Loading branch information
alexlancaster committed Feb 8, 2024
1 parent 277d6eb commit f751537
Show file tree
Hide file tree
Showing 14 changed files with 601 additions and 582 deletions.
6 changes: 4 additions & 2 deletions src/PyPop/xslt/hardyweinberg.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -482,9 +482,11 @@ MODIFICATIONS.
</xsl:variable>

<!-- calculate the width required for each cell, this twice the maximum -->
<!-- length of the "observed" cell 'XXX' plus space needed for chars -->
<!-- length of the "observed" cell 'XXX' plus a space for scientific notation in expected -->
<!-- plus space needed for chars -->
<!-- e.g.: XXX/XXX.0 and a padding space -->
<xsl:variable name="cell-width-max" select="$observed-max * 2 + 4"/>
<!-- FIXME: this is a big kludgy, really should also compute the expected-max including sci notation -->
<xsl:variable name="cell-width-max" select="$observed-max * 2 + 1 + 4"/>

<!-- choose the greater of the allele name or cell-width-max for the -->
<!-- standard width -->
Expand Down
2 changes: 1 addition & 1 deletion src/PyPop/xslt/lib.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ MODIFICATIONS.
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:es="http://pypop.org/lxml/functions">

<xsl:param name="use-python-extensions" select="0"/>
<xsl:param name="use-python-extensions" select="1"/>

<!-- contains a library of named templates not specific to any DTD or
XML schema -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ Total 1.00000 16 | Total 1.00000 16
----------------------
Table of genotypes, format of each cell is: observed/expected.

01:01 0/0.0
02:01 0/0.3 1/0.5
02:10 0/0.1 0/0.5 0/0.1
02:18 1/0.1 0/0.3 0/0.1 0/0.0
03:01 0/0.1 0/0.5 1/0.3 0/0.1 0/0.1
25:01 0/0.1 1/0.5 0/0.3 0/0.1 0/0.3 0/0.1
32:04 0/0.2 0/0.8 1/0.4 0/0.2 1/0.4 1/0.4 0/0.3
68:14 0/0.1 1/0.3 0/0.1 0/0.1 0/0.1 0/0.1 0/0.2 0/0.0
01:01 02:01 02:10 02:18 03:01 25:01 32:04 68:14
01:01 0/3e-2
02:01 0/0.2 1/0.5
02:10 0/0.1 0/0.5 0/0.1
02:18 1/6e-2 0/0.2 0/0.1 0/3e-2
03:01 0/0.1 0/0.5 1/0.2 0/0.1 0/0.1
25:01 0/0.1 1/0.5 0/0.2 0/0.1 0/0.2 0/0.1
32:04 0/0.2 0/0.8 1/0.4 0/0.2 1/0.4 1/0.4 0/0.3
68:14 0/6e-2 1/0.2 0/0.1 0/6e-2 0/0.1 0/0.1 0/0.2 0/3e-2
01:01 02:01 02:10 02:18 03:01 25:01 32:04 68:14
[Cols: 1 to 8]

Observed Expected Chi-square DoF p-value
Expand All @@ -85,7 +85,7 @@ Table of genotypes, format of each cell is: observed/expected.
Common + lumped Value not calculated.

------------------------------------------------------------------------------------------
All heterozygotes 7 6.75 0.01 1 0.9233
All heterozygotes 7 6.75 9e-3 1 0.9233
------------------------------------------------------------------------------------------
Common heterozygotes by allele

Expand Down Expand Up @@ -124,16 +124,16 @@ Total 1.00000 20 | Total 1.00000 20
----------------------
Table of genotypes, format of each cell is: observed/expected.

01:02 0/0.4
02:025 1/0.4 0/0.1
03:07 0/0.8 0/0.4 1/0.4
06:05 0/0.4 0/0.2 1/0.4 0/0.1
07:12 2/0.4 0/0.2 0/0.4 0/0.2 0/0.1
08:04 0/0.2 0/0.1 0/0.2 0/0.1 0/0.1 0/0.0
12:02 0/0.4 1/0.2 0/0.4 0/0.2 0/0.2 1/0.1 0/0.1
15:07 0/0.4 0/0.2 1/0.4 1/0.2 0/0.2 0/0.1 0/0.2 0/0.1
18:01 1/0.2 0/0.1 0/0.2 0/0.1 0/0.1 0/0.1 0/0.1 0/0.1 0/0.0
01:0202:025 03:07 06:05 07:12 08:04 12:02 15:07 18:01
01:02 0/0.4
02:025 1/0.4 0/0.1
03:07 0/0.8 0/0.4 1/0.4
06:05 0/0.4 0/0.2 1/0.4 0/0.1
07:12 2/0.4 0/0.2 0/0.4 0/0.2 0/0.1
08:04 0/0.2 0/0.1 0/0.2 0/0.1 0/0.1 0/3e-2
12:02 0/0.4 1/0.2 0/0.4 0/0.2 0/0.2 1/0.1 0/0.1
15:07 0/0.4 0/0.2 1/0.4 1/0.2 0/0.2 0/0.1 0/0.2 0/0.1
18:01 1/0.2 0/0.1 0/0.2 0/0.1 0/0.1 0/5e-2 0/0.1 0/0.1 0/3e-2
01:02 02:025 03:07 06:05 07:12 08:04 12:02 15:07 18:01
[Cols: 1 to 9]

Observed Expected Chi-square DoF p-value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ Total1.00000 16 | Total1.00000 16
----------------------
Table of genotypes, format of each cell is: observed/expected.

01 0/0.0
02 1/0.4 1/1.5
03 0/0.1 1/0.9 0/0.1
25 0/0.1 1/0.9 0/0.3 0/0.1
32 0/0.2 1/1.3 1/0.4 1/0.4 0/0.3
68 0/0.1 1/0.4 0/0.1 0/0.1 0/0.2 0/0.0
01 02 03 25 32 68
01 0/3e-2
02 1/0.4 1/1.5
03 0/0.1 1/0.9 0/0.1
25 0/0.1 1/0.9 0/0.2 0/0.1
32 0/0.2 1/1.3 1/0.4 1/0.4 0/0.3
68 0/6e-2 1/0.4 0/0.1 0/0.1 0/0.2 0/3e-2
01 02 03 25 32 68
[Cols: 1 to 6]

Observed Expected Chi-square DoF p-value
Expand Down Expand Up @@ -120,16 +120,16 @@ Total1.00000 20 | Total1.00000 20
----------------------
Table of genotypes, format of each cell is: observed/expected.

01 0/0.4
02 1/0.4 0/0.1
03 0/0.8 0/0.4 1/0.4
06 0/0.4 0/0.2 1/0.4 0/0.1
07 2/0.4 0/0.2 0/0.4 0/0.2 0/0.1
08 0/0.2 0/0.1 0/0.2 0/0.1 0/0.1 0/0.0
12 0/0.4 1/0.2 0/0.4 0/0.2 0/0.2 1/0.1 0/0.1
15 0/0.4 0/0.2 1/0.4 1/0.2 0/0.2 0/0.1 0/0.2 0/0.1
18 1/0.2 0/0.1 0/0.2 0/0.1 0/0.1 0/0.1 0/0.1 0/0.1 0/0.0
01 02 03 06 07 08 12 15 18
01 0/0.4
02 1/0.4 0/0.1
03 0/0.8 0/0.4 1/0.4
06 0/0.4 0/0.2 1/0.4 0/0.1
07 2/0.4 0/0.2 0/0.4 0/0.2 0/0.1
08 0/0.2 0/0.1 0/0.2 0/0.1 0/0.1 0/3e-2
12 0/0.4 1/0.2 0/0.4 0/0.2 0/0.2 1/0.1 0/0.1
15 0/0.4 0/0.2 1/0.4 1/0.2 0/0.2 0/0.1 0/0.2 0/0.1
18 1/0.2 0/0.1 0/0.2 0/0.1 0/0.1 0/5e-2 0/0.1 0/0.1 0/3e-2
01 02 03 06 07 08 12 15 18
[Cols: 1 to 9]

Observed Expected Chi-square DoF p-value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ Total 1.00000 16 | Total 1.00000 16
----------------------
Table of genotypes, format of each cell is: observed/expected.

01:01 0/0.0
02:01 0/0.3 1/0.5
02:10 0/0.1 0/0.5 0/0.1
02:18 1/0.1 0/0.3 0/0.1 0/0.0
03:012 0/0.1 0/0.5 1/0.3 0/0.1 0/0.1
25:01 0/0.1 1/0.5 0/0.3 0/0.1 0/0.3 0/0.1
32:04 0/0.2 0/0.8 1/0.4 0/0.2 1/0.4 1/0.4 0/0.3
68:14 0/0.1 1/0.3 0/0.1 0/0.1 0/0.1 0/0.1 0/0.2 0/0.0
01:01 02:01 02:10 02:1803:012 25:01 32:04 68:14
01:01 0/3e-2
02:01 0/0.2 1/0.5
02:10 0/0.1 0/0.5 0/0.1
02:18 1/6e-2 0/0.2 0/0.1 0/3e-2
03:012 0/0.1 0/0.5 1/0.2 0/0.1 0/0.1
25:01 0/0.1 1/0.5 0/0.2 0/0.1 0/0.2 0/0.1
32:04 0/0.2 0/0.8 1/0.4 0/0.2 1/0.4 1/0.4 0/0.3
68:14 0/6e-2 1/0.2 0/0.1 0/6e-2 0/0.1 0/0.1 0/0.2 0/3e-2
01:01 02:01 02:10 02:18 03:012 25:01 32:04 68:14
[Cols: 1 to 8]

Observed Expected Chi-square DoF p-value
Expand All @@ -85,7 +85,7 @@ Table of genotypes, format of each cell is: observed/expected.
Common + lumped Value not calculated.

------------------------------------------------------------------------------------------
All heterozygotes 7 6.75 0.01 1 0.9233
All heterozygotes 7 6.75 9e-3 1 0.9233
------------------------------------------------------------------------------------------
Common heterozygotes by allele

Expand Down Expand Up @@ -124,16 +124,16 @@ Total 1.00000 20 | Total 1.00000 20
----------------------
Table of genotypes, format of each cell is: observed/expected.

01:02 0/0.4
02:025 1/0.4 0/0.1
03:07 0/0.8 0/0.4 1/0.4
06:05 0/0.4 0/0.2 1/0.4 0/0.1
07:12 2/0.4 0/0.2 0/0.4 0/0.2 0/0.1
08:04 0/0.2 0/0.1 0/0.2 0/0.1 0/0.1 0/0.0
12:02 0/0.4 1/0.2 0/0.4 0/0.2 0/0.2 1/0.1 0/0.1
15:07 0/0.4 0/0.2 1/0.4 1/0.2 0/0.2 0/0.1 0/0.2 0/0.1
18:01 1/0.2 0/0.1 0/0.2 0/0.1 0/0.1 0/0.1 0/0.1 0/0.1 0/0.0
01:0202:025 03:07 06:05 07:12 08:04 12:02 15:07 18:01
01:02 0/0.4
02:025 1/0.4 0/0.1
03:07 0/0.8 0/0.4 1/0.4
06:05 0/0.4 0/0.2 1/0.4 0/0.1
07:12 2/0.4 0/0.2 0/0.4 0/0.2 0/0.1
08:04 0/0.2 0/0.1 0/0.2 0/0.1 0/0.1 0/3e-2
12:02 0/0.4 1/0.2 0/0.4 0/0.2 0/0.2 1/0.1 0/0.1
15:07 0/0.4 0/0.2 1/0.4 1/0.2 0/0.2 0/0.1 0/0.2 0/0.1
18:01 1/0.2 0/0.1 0/0.2 0/0.1 0/0.1 0/5e-2 0/0.1 0/0.1 0/3e-2
01:02 02:025 03:07 06:05 07:12 08:04 12:02 15:07 18:01
[Cols: 1 to 9]

Observed Expected Chi-square DoF p-value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ Total 1.00000 16 | Total 1.00000 16
----------------------
Table of genotypes, format of each cell is: observed/expected.

01:01 0/0.0
02:01 0/0.3 1/0.5
02:10 0/0.1 0/0.5 0/0.1
02:18 1/0.1 0/0.3 0/0.1 0/0.0
03:012 0/0.1 0/0.5 1/0.3 0/0.1 0/0.1
25:01 0/0.1 1/0.5 0/0.3 0/0.1 0/0.3 0/0.1
32:04 0/0.2 0/0.8 1/0.4 0/0.2 1/0.4 1/0.4 0/0.3
68:14 0/0.1 1/0.3 0/0.1 0/0.1 0/0.1 0/0.1 0/0.2 0/0.0
01:01 02:01 02:10 02:1803:012 25:01 32:04 68:14
01:01 0/3e-2
02:01 0/0.2 1/0.5
02:10 0/0.1 0/0.5 0/0.1
02:18 1/6e-2 0/0.2 0/0.1 0/3e-2
03:012 0/0.1 0/0.5 1/0.2 0/0.1 0/0.1
25:01 0/0.1 1/0.5 0/0.2 0/0.1 0/0.2 0/0.1
32:04 0/0.2 0/0.8 1/0.4 0/0.2 1/0.4 1/0.4 0/0.3
68:14 0/6e-2 1/0.2 0/0.1 0/6e-2 0/0.1 0/0.1 0/0.2 0/3e-2
01:01 02:01 02:10 02:18 03:012 25:01 32:04 68:14
[Cols: 1 to 8]

Observed Expected Chi-square DoF p-value
Expand All @@ -85,7 +85,7 @@ Table of genotypes, format of each cell is: observed/expected.
Common + lumped Value not calculated.

------------------------------------------------------------------------------------------
All heterozygotes 7 6.75 0.01 1 0.9233
All heterozygotes 7 6.75 9e-3 1 0.9233
------------------------------------------------------------------------------------------
Common heterozygotes by allele

Expand Down Expand Up @@ -129,16 +129,16 @@ Total 1.00000 20 | Total 1.00000 20
----------------------
Table of genotypes, format of each cell is: observed/expected.

01:02 0/0.4
02:025 1/0.4 0/0.1
03:07 0/0.8 0/0.4 1/0.4
06:05 0/0.4 0/0.2 1/0.4 0/0.1
07:12 2/0.4 0/0.2 0/0.4 0/0.2 0/0.1
08:04 0/0.2 0/0.1 0/0.2 0/0.1 0/0.1 0/0.0
12:02 0/0.4 1/0.2 0/0.4 0/0.2 0/0.2 1/0.1 0/0.1
15:07 0/0.4 0/0.2 1/0.4 1/0.2 0/0.2 0/0.1 0/0.2 0/0.1
18:01 1/0.2 0/0.1 0/0.2 0/0.1 0/0.1 0/0.1 0/0.1 0/0.1 0/0.0
01:0202:025 03:07 06:05 07:12 08:04 12:02 15:07 18:01
01:02 0/0.4
02:025 1/0.4 0/0.1
03:07 0/0.8 0/0.4 1/0.4
06:05 0/0.4 0/0.2 1/0.4 0/0.1
07:12 2/0.4 0/0.2 0/0.4 0/0.2 0/0.1
08:04 0/0.2 0/0.1 0/0.2 0/0.1 0/0.1 0/3e-2
12:02 0/0.4 1/0.2 0/0.4 0/0.2 0/0.2 1/0.1 0/0.1
15:07 0/0.4 0/0.2 1/0.4 1/0.2 0/0.2 0/0.1 0/0.2 0/0.1
18:01 1/0.2 0/0.1 0/0.2 0/0.1 0/0.1 0/5e-2 0/0.1 0/0.1 0/3e-2
01:02 02:025 03:07 06:05 07:12 08:04 12:02 15:07 18:01
[Cols: 1 to 9]

Observed Expected Chi-square DoF p-value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ Total 1.00000 16 | Total 1.00000 16
----------------------
Table of genotypes, format of each cell is: observed/expected.

01:01 0/0.0
02:01 0/0.3 1/0.5
02:10 0/0.1 0/0.5 0/0.1
02:18 1/0.1 0/0.3 0/0.1 0/0.0
03:012 0/0.1 0/0.5 1/0.3 0/0.1 0/0.1
25:01 0/0.1 1/0.5 0/0.3 0/0.1 0/0.3 0/0.1
32:04 0/0.2 0/0.8 1/0.4 0/0.2 1/0.4 1/0.4 0/0.3
68:14 0/0.1 1/0.3 0/0.1 0/0.1 0/0.1 0/0.1 0/0.2 0/0.0
01:01 02:01 02:10 02:1803:012 25:01 32:04 68:14
01:01 0/3e-2
02:01 0/0.2 1/0.5
02:10 0/0.1 0/0.5 0/0.1
02:18 1/6e-2 0/0.2 0/0.1 0/3e-2
03:012 0/0.1 0/0.5 1/0.2 0/0.1 0/0.1
25:01 0/0.1 1/0.5 0/0.2 0/0.1 0/0.2 0/0.1
32:04 0/0.2 0/0.8 1/0.4 0/0.2 1/0.4 1/0.4 0/0.3
68:14 0/6e-2 1/0.2 0/0.1 0/6e-2 0/0.1 0/0.1 0/0.2 0/3e-2
01:01 02:01 02:10 02:18 03:012 25:01 32:04 68:14
[Cols: 1 to 8]

Observed Expected Chi-square DoF p-value
Expand All @@ -85,7 +85,7 @@ Table of genotypes, format of each cell is: observed/expected.
Common + lumped Value not calculated.

------------------------------------------------------------------------------------------
All heterozygotes 7 6.75 0.01 1 0.9233
All heterozygotes 7 6.75 9e-3 1 0.9233
------------------------------------------------------------------------------------------
Common heterozygotes by allele

Expand Down Expand Up @@ -138,16 +138,16 @@ Total 1.00000 20 | Total 1.00000 20
----------------------
Table of genotypes, format of each cell is: observed/expected.

01:02 0/0.4
02:025 1/0.4 0/0.1
03:07 0/0.8 0/0.4 1/0.4
06:05 0/0.4 0/0.2 1/0.4 0/0.1
07:12 2/0.4 0/0.2 0/0.4 0/0.2 0/0.1
08:04 0/0.2 0/0.1 0/0.2 0/0.1 0/0.1 0/0.0
12:02 0/0.4 1/0.2 0/0.4 0/0.2 0/0.2 1/0.1 0/0.1
15:07 0/0.4 0/0.2 1/0.4 1/0.2 0/0.2 0/0.1 0/0.2 0/0.1
18:01 1/0.2 0/0.1 0/0.2 0/0.1 0/0.1 0/0.1 0/0.1 0/0.1 0/0.0
01:0202:025 03:07 06:05 07:12 08:04 12:02 15:07 18:01
01:02 0/0.4
02:025 1/0.4 0/0.1
03:07 0/0.8 0/0.4 1/0.4
06:05 0/0.4 0/0.2 1/0.4 0/0.1
07:12 2/0.4 0/0.2 0/0.4 0/0.2 0/0.1
08:04 0/0.2 0/0.1 0/0.2 0/0.1 0/0.1 0/3e-2
12:02 0/0.4 1/0.2 0/0.4 0/0.2 0/0.2 1/0.1 0/0.1
15:07 0/0.4 0/0.2 1/0.4 1/0.2 0/0.2 0/0.1 0/0.2 0/0.1
18:01 1/0.2 0/0.1 0/0.2 0/0.1 0/0.1 0/5e-2 0/0.1 0/0.1 0/3e-2
01:02 02:025 03:07 06:05 07:12 08:04 12:02 15:07 18:01
[Cols: 1 to 9]

Observed Expected Chi-square DoF p-value
Expand Down
40 changes: 20 additions & 20 deletions tests/data/gold-output/USAFEL-UchiTelle-small-out.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ Total 1.00000 16 | Total 1.00000 16
----------------------
Table of genotypes, format of each cell is: observed/expected.

01:01 0/0.0
02:01 0/0.3 1/0.5
02:10 0/0.1 0/0.5 0/0.1
02:18 1/0.1 0/0.3 0/0.1 0/0.0
03:012 0/0.1 0/0.5 1/0.3 0/0.1 0/0.1
25:01 0/0.1 1/0.5 0/0.3 0/0.1 0/0.3 0/0.1
32:04 0/0.2 0/0.8 1/0.4 0/0.2 1/0.4 1/0.4 0/0.3
68:14 0/0.1 1/0.3 0/0.1 0/0.1 0/0.1 0/0.1 0/0.2 0/0.0
01:01 02:01 02:10 02:1803:012 25:01 32:04 68:14
01:01 0/3e-2
02:01 0/0.2 1/0.5
02:10 0/0.1 0/0.5 0/0.1
02:18 1/6e-2 0/0.2 0/0.1 0/3e-2
03:012 0/0.1 0/0.5 1/0.2 0/0.1 0/0.1
25:01 0/0.1 1/0.5 0/0.2 0/0.1 0/0.2 0/0.1
32:04 0/0.2 0/0.8 1/0.4 0/0.2 1/0.4 1/0.4 0/0.3
68:14 0/6e-2 1/0.2 0/0.1 0/6e-2 0/0.1 0/0.1 0/0.2 0/3e-2
01:01 02:01 02:10 02:18 03:012 25:01 32:04 68:14
[Cols: 1 to 8]

Observed Expected Chi-square DoF p-value
Expand All @@ -85,7 +85,7 @@ Table of genotypes, format of each cell is: observed/expected.
Common + lumped Value not calculated.

------------------------------------------------------------------------------------------
All heterozygotes 7 6.75 0.01 1 0.9233
All heterozygotes 7 6.75 9e-3 1 0.9233
------------------------------------------------------------------------------------------
Common heterozygotes by allele

Expand Down Expand Up @@ -138,16 +138,16 @@ Total 1.00000 20 | Total 1.00000 20
----------------------
Table of genotypes, format of each cell is: observed/expected.

01:02 0/0.4
02:025 1/0.4 0/0.1
03:07 0/0.8 0/0.4 1/0.4
06:05 0/0.4 0/0.2 1/0.4 0/0.1
07:12 2/0.4 0/0.2 0/0.4 0/0.2 0/0.1
08:04 0/0.2 0/0.1 0/0.2 0/0.1 0/0.1 0/0.0
12:02 0/0.4 1/0.2 0/0.4 0/0.2 0/0.2 1/0.1 0/0.1
15:07 0/0.4 0/0.2 1/0.4 1/0.2 0/0.2 0/0.1 0/0.2 0/0.1
18:01 1/0.2 0/0.1 0/0.2 0/0.1 0/0.1 0/0.1 0/0.1 0/0.1 0/0.0
01:0202:025 03:07 06:05 07:12 08:04 12:02 15:07 18:01
01:02 0/0.4
02:025 1/0.4 0/0.1
03:07 0/0.8 0/0.4 1/0.4
06:05 0/0.4 0/0.2 1/0.4 0/0.1
07:12 2/0.4 0/0.2 0/0.4 0/0.2 0/0.1
08:04 0/0.2 0/0.1 0/0.2 0/0.1 0/0.1 0/3e-2
12:02 0/0.4 1/0.2 0/0.4 0/0.2 0/0.2 1/0.1 0/0.1
15:07 0/0.4 0/0.2 1/0.4 1/0.2 0/0.2 0/0.1 0/0.2 0/0.1
18:01 1/0.2 0/0.1 0/0.2 0/0.1 0/0.1 0/5e-2 0/0.1 0/0.1 0/3e-2
01:02 02:025 03:07 06:05 07:12 08:04 12:02 15:07 18:01
[Cols: 1 to 9]

Observed Expected Chi-square DoF p-value
Expand Down
Loading

0 comments on commit f751537

Please sign in to comment.