Update: Instead of the python module (scipy.stats.chi2_contingency), the general formula is used for G-statistic calculation in the new version of the script. The function based on this formula takes four one-dimensional numpy arrays or four Pandas series as input, which increases the speed of the script by a few hundred times.
BSA-Seq data analysis - Python implementation of the G-statistic method
This is the Python implementation of the G-statistic method for BSA-Seq data analysis. The script can be tested by issuing the command python PyGStatistic.py in a terminal. The file snp_final.tsv.bz2 needs to be uncompressed to the working directory before testing. Options as in PyBSASeq are needed to use the script for your own SNP datasets.