1, 1, 3, 1.21, 2.31
`)
c.Check(glmPvalueFunc(samples, npca)(onehot), check.Equals, 0.002789665435066107)
+
+ samples, onehot, npca = csv2test(`
+# case=1, onehot=1, pca1, pca2, pca3
+0, 1, 1, 1.21, 2.37
+0, 1, 2, 1.22, 2.38
+0, 1, 3, 1.23, 2.39
+0, 1, 1, 1.24, 2.33
+0, 1, 2, 1.25, 2.34
+1, 1, 3, 1.26, 2.35
+1, 1, 1, 1.23, 2.36
+1, 1, 2, 1.22, 2.32
+1, 1, 3, 1.21, 2.31
+`)
+ c.Check(math.IsNaN(glmPvalueFunc(samples, npca)(onehot)), check.Equals, true)
}
var benchSamples, benchOnehot = func() ([]sampleInfo, []bool) {
}
if len(cmd.samples[0].pcaComponents) > 0 {
cmd.pvalue = glmPvalueFunc(cmd.samples, cmd.pcaComponents)
+ // Unfortunately, statsmodel/glm lib logs
+ // stuff to os.Stdout when it panics on an
+ // unsolvable problem. We recover() from the
+ // panic in glm.go, but we also need to
+ // commandeer os.Stdout to avoid producing
+ // large quantities of logs.
+ stdoutWas := os.Stdout
+ defer func() { os.Stdout = stdoutWas }()
+ os.Stdout, err = os.Open(os.DevNull)
+ if err != nil {
+ return err
+ }
}
} else if *caseControlOnly {
return fmt.Errorf("-case-control-only does not make sense without -samples")