Package: pyghdet
GHDet: Global Hybridization Detection using Phylogenetic InvariantsGHDet is a python package that can detect if there is any hybridization
event given a set of taxa. The main module of this package is calledpyghdet(Pythonic Global Hybridization Detection). Using this package,
we can test whether there has been any hybridization event among a set of taxa,
helping us decide whether or not to perform tree or network analysis.InstallationRequirements:Python 3.6 or abovePython Modules:CythonNumpyMatplotlibSeabornMultiprocessmathscipyphydepandasitertoolstypingC++ compiler# To install dependenciespipinstallcythonnumpymatplotlibseabornmultiprocessmathscipyphydepandasitertoolstyping# To install GHDetpipinstallpyghdetUsagesThe package has two main modules:comb_speciesandcomb_indiv.
Thecomb_speciesmodule performs global hypothesis test to detect if
any of the species is a hybrid or not. Similarly,comb_indivmodule
performs global hypothesis test to detect if there is any hybrid
individual in the data. Thecomb_speciesandcomb_indivmodules
has the following arguments:Arguments----------infile<string>:nameoftheDNAsequencedatafile.-mapfile<string>:nameofthetaxonmapfile.-outgroup<string>:nameoftheoutgroup.-nindiv<int>:numberofsampledindividuals.-ntaxa<int>:numberofsampledtaxa/populations.-nsites<int>:numberofsampledsites.-sus_hyb<string>:listofsuspectedhybridspecies.-alpha<float>:intendedlevelofsignificance.-ignore_amb_sites<flag>:ignoremissing/ambiguoussites.ExamplesDetect if any species is hybrid:## No suspected hybrid:importpyghdetasghdres=ghd.comb_speices("data.txt","map.txt","out",16,4,50000)res.p_valueres.detailed## with suspected hybrid:importpyghdetasghdres=ghd.comb_species("data.txt","map.txt","out",16,4,50000,['sp1','sp2'])res.p_valueres.detailedDetect if any individual is hybrid:## No suspected hybrid:importpyghdetasghdres=ghd.comb_indiv("data.txt","map.txt","out",16,4,50000)res.p_valueres.detailed## with suspected hybrid:importpyghdetasghdres=ghd.comb_indiv("data.txt","map.txt","out",16,4,50000,['sp1','sp2'])res.p_valueres.detailedRunning GHDet from command lineTo facilitate analyses using the Python module, two scripts are provided
to conduct hybridization detection analyses directly from the command
line:hdet_species.py: runs a standard hybridization detection analysis
on all the species in the data. The output is the p-value of the
global test. The script also produce results on individual tests if
the global test is significant. One can also provide a list of
suspected hybrid, which only test if any of the suspected hybrid
species is actually hybrid species or not. evidence for
hybridization.hdet_indiv.py: tests if any of the individuals in the data is
hybrid or not. It is possible to provide a list of suspected hybrid
species, then the test will only detect individuals from the provided
suspected hybrid species are hybrid or not.Examples## species levelhdet_species.py-idata.txt-mmap.txt-oout-n16-t4-s50000## individual levelhdet_indiv.py-idata.txt-mmap.txt-oout-n16-t4-s50000Performing Combination testsThe package can also be used to perform Combination tests. Three
different combination tests have been implemented in the package. The
tests are:Cauchy Combination test
(CCT),MinP-CCT-MinP (MCM)
test, andCCT-MinP-CCT-(CMC)
test. These
tests can be performed as follows:importpyghdetasghd## CCT with different weightsghd.cct([0.01,0.05,0.10,0.53],[1,1,2,1])## CCT with equal weightsghd.cct([0.01,0.10,0.05,0.54])## CMC testghd.cmc([0.01,0.05,0.10,0.45])## MCM testghd.mcm([0.01,0.05,0.40,0.33])