@@ -1561,6 +1561,10 @@ def __init__(
1561
1561
np .logical_and (mean_x0 == mean_x1 , self ._mean > 0 ),
1562
1562
np .logical_not (self ._var_geq_zero )
1563
1563
))[0 ]] = 1.0
1564
+ # Depening on user choice via is_sig_zerovar:
1565
+ # Set p-value to 0 if LFC was non-zero and variances are zero,
1566
+ # this causes division by zero in the test statistic. This
1567
+ # is a highly significant result if one believes the variance estimate.
1564
1568
if is_sig_zerovar :
1565
1569
pval [np .where (np .logical_and (
1566
1570
mean_x0 != mean_x1 ,
@@ -1573,28 +1577,6 @@ def __init__(
1573
1577
self ._logfc = mean_x1 - mean_x0
1574
1578
else :
1575
1579
self ._logfc = np .log (mean_x1 ) - np .log (mean_x0 )
1576
- # Return 0 if LFC was non-zero and variances are zero,
1577
- # this causes division by zero in the test statistic. This
1578
- # is a highly significant result if one believes the variance estimate.
1579
- # This is the default which can be changed and can be changed
1580
- # via DIFFXPY_TREAT_ZEROVAR_TT_AS_SIG.
1581
- pval [np .where (np .logical_and (np .logical_and (
1582
- np .logical_not (self ._var_geq_zero ),
1583
- self ._ave_nonzero ),
1584
- np .abs (self ._logfc ) < np .nextafter (0 , 1 )
1585
- ))] = 0
1586
- if pkg_constants .DE_TREAT_ZEROVAR_TT_AS_SIG :
1587
- pval [np .where (np .logical_and (np .logical_and (
1588
- np .logical_not (self ._var_geq_zero ),
1589
- self ._ave_nonzero ),
1590
- np .abs (self ._logfc ) >= np .nextafter (0 , 1 )
1591
- ))] = 1
1592
- else :
1593
- pval [np .where (np .logical_and (np .logical_and (
1594
- np .logical_not (self ._var_geq_zero ),
1595
- self ._ave_nonzero ),
1596
- np .abs (self ._logfc ) >= np .nextafter (0 , 1 )
1597
- ))] = 0
1598
1580
1599
1581
@property
1600
1582
def gene_ids (self ) -> np .ndarray :
@@ -1695,6 +1677,10 @@ def __init__(
1695
1677
np .logical_and (mean_x0 == mean_x1 , self ._mean > 0 ),
1696
1678
np .logical_not (self ._var_geq_zero )
1697
1679
))[0 ]] = 1.0
1680
+ # Depening on user choice via is_sig_zerovar:
1681
+ # Set p-value to 0 if LFC was non-zero and variances are zero,
1682
+ # this causes division by zero in the test statistic. This
1683
+ # is a highly significant result if one believes the variance estimate.
1698
1684
if is_sig_zerovar :
1699
1685
pval [np .where (np .logical_and (
1700
1686
mean_x0 != mean_x1 ,
0 commit comments