Testing a hypothesis – non-stationary or time-reversible#
We test the hypothesis that the GTR model is sufficient for a data set, compared with the GN (non-stationary general nucleotide model).
result is a hypothesis_result object. The repr() displays the likelihood ratio test statistic, degrees of freedom and associated p-value>
In this case, we accept the null given the p-value is > 0.05. We use this object to demonstrate the properties of a hypothesis_result.
hypothesis_result has attributes and keys#
Accessing the test statistics#
The null hypothesis#
This model is accessed via the null attribute.
The alternate hypothesis#
Saving hypothesis results#
You are advised to save these results as serialised data since this provides maximum flexibility for downstream analyses.
The following would write the result into a sqlitedb.
from cogent3 import get_app, open_data_store
output = open_data_store("path/to/myresults.sqlitedb", mode="w")
writer = get_app("write_db", data_store=output)
writer(result)