Package: pypop-genomics
PyPop: Python for Population GenomicsPyPop is a framework for processing genotype and allele data and
running population genetic analyses, including conformity to
Hardy-Weinberg expectations; tests for balancing or directional
selection; estimates of haplotype frequencies and measures and tests
of significance for linkage disequilibrium (LD). Full documentation is
available in thePyPop User Guide.How to cite PyPopIf you write a paper that uses PyPop in your analysis, please citeboth:our 2024 article, currently in review, available as aZenodo
preprint:Lancaster AK, Single RM, Mack SJ, Sochat V, Mariani MP, Webster
GD. (2024) “PyPop: A mature open-source software pipeline for
population genomics” (Preprint v1). Zenodo.
DOI:10.5281/zenodo.10602940.andtheZenodo recordfor the software. To cite the correct version, follow these steps:First visit the DOI for the overall Zenodo record:10.5281/zenodo.10080667. This DOI
representsall versions, and will always resolve to the
latest one.When you are viewing the record, look for theVersionsbox
in the right-sidebar. Here are listed all versions (including
older versions).Select and click the version-specific DOI that matches the
specific version of PyPop that you used for your analysis.Once you are visiting the Zenodo record for the specific version,
under theCitationbox in the right-sidebar, select the
citation format you wish to use and click to copy the citation.
It will contain link to the version-specific DOI, and be of the
form:Lancaster, AK et al. (YYYY) “PyPop: Python for Population
Genomics” (Version X.Y.Z) [Computer
software]. Zenodo.https://doi.org/10.5281/zenodo.XXXXXNote that citation metadata for the current Zenodo record is also
stored inCITATION.cffAttention!The package name for installation purposes ispypop-genomics- to avoid
conflicting with an unrelated package with the namepypopalready onPyPI.Quickstart GuideInstallingpypop-genomicsIf you already have Python andpipinstalled, install using the following:pipinstallpypop-genomicsOtherwise, followthese instructionsto install Python 3 and pip.Oncepypop-genomicsis installed, depending on your platform, you may also
need toadjustyourPATHenvironment variable.Upgradingpypop-genomicspipinstall-Upypop-genomicsUninstallingpypop-genomicspipuninstallpypop-genomicsFor more, including handling common installation issues, see thedetailed installation instructions.Once you have installedpypop-genomics, you can move on to try someexample runs.ExamplesThese are examples of how to check that the program is installed and
some minimal use cases.Checking version and installationpypop--versionThis simply reports the version number and other information about
PyPop, and indirectly checks that the program is installed. If all is
well, you should see something like:pypop 1.0.0
[Python 3.10.9 | Linux.x86_64-x86_64 | x86_64]
Copyright (C) 2003-2006 Regents of the University of California.
Copyright (C) 2007-2023 PyPop team.
This is free software.  There is NO warranty; not even for
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.You can also runpypop--helpto see a full list and explanation
of all the options available.Run a minimal dataset:Download test.iniand.popfiles:minimal.iniandUSAFEL-UchiTelle-small.pop.
You can then run thempypop-cminimal.iniUSAFEL-UchiTelle-small.popIf you have already cloned the git repository and it is your working
directory, you can simply runpypop-ctests/data/minimal.initests/data/USAFEL-UchiTelle-small.popThis will generate the following two files, an XML output file and a
plain text version:USAFEL-UchiTelle-small-out.xml
USAFEL-UchiTelle-small-out.txtDetailed installation instructionsThere are three main steps:install Python andpipinstall package from Test PyPIadjusting yourPATHvariable after installationInstall Python 3 andpipA full description of installing Python andpipon your system is
beyond the scope of this guide, we recommend starting here:https://wiki.python.org/moin/BeginnersGuide/DownloadHere are some additional platform-specific notes that may be helpful:Most Linux distributions come with Python 3 preinstalled. On most
modern systems,pipandpythonwill default to Python 3.MacOS 10.9 (Jaguar) up until 12.3 (Catalina), used to ship with
Python 2 pre-installed, but it now has to be manually installed.
See theMacOS quick-start guidein the official
documentation for how to install Python 3. (Note that if Python is
installed on Mac via the MacOS developer tools, it may include the
version3suffix on commands, e.g.python3andpip3, so
modify the below, accordingly).For Windows, see also theWindows quick-start guidein the official
documentation. Runningpythonin the Windows command terminal
in Windows 11 and later will launch the installer for the
Microsoft-maintained Windows package of Python 3.Install package from PyPIOnce you have both python andpipinstalled, you can usepipto install pre-compiled binary “wheels” ofpypop-genomicsdirectly fromPyPI.pipinstallpypop-genomicsNoteIf, for whatever reason, you cannot use the these binaries
(e.g. the pre-compiled binaries are not available for your
platform), you may need to follow thedeveloper installation
instructionsin the contributors
guide.Upgrade an existing PyPop installationTo update an existing installation to a newer version, use the same
command as above, but add the--upgrade(short version:-U)
flag, i.e.pipinstall-Upypop-genomicsInstalling from Test PyPIFrom time to time, we may make available packages on theTest PyPIinstance, rather than the through the main
instance. The above installation and updating instructions can be
used, by appending the following:--extra-index-urlhttps://test.pypi.org/simple/to the abovepipcommands.Issues with installation permissionBy default,pipwill attempt to install thepypop-genomicspackage wherever the current Python installation is installed.  This
location may be a user-specific virtual environment (likeconda,
see below), or a system-wide installation. On many Unix-based systems,
Python will generally already be pre-installed in a “system-wide”
location (e.g. under/usr/lib) which is read-only for regular
users. (This can also be true for system-installed versions of Python
on Windows and MacOS.)Whenpip installcannot install in a read-only system-wide
location ,pipwill gracefully “fall-back” to installing just for
you in your home directory (typically~/.local/lib/python<VER>where<VER>is the version number of your current Python). In
general, this is what is wanted, so the above instructions are
normally sufficient.However, you can also explicitly set installation to be in the user
directory, by adding the--usercommand-line option to thepip installcommand, i.e.:pipinstallpypop-genomics--userThis may be necessary in certain cases wherepip installdoesn’t
install into the expected user directory.Installing within acondaenvironmentIn the special case that you installing from within an activated
user-specificcondavirtual environment that provides Python,
then you shouldnotadd the--userbecause it will install
it in~/.local/lib/rather than under the user-specific conda
virtual environment in~/.conda/envs/.Post-installPATHadjustmentsYou may need to adjust thePATHsettings (especially on Windows)
for thepypopscripts to be visible when run from your console
application, without having to supply the full path to thepypopexecutable file.WarningPay close attention to the “WARNINGS” that are shown during thepipinstallation, they will often note which directories need to
be added to thePATH.On Linux and MacOS, systems this is normally fairly simple and only
requires edit of the shell.profile, or similar and addition of
the$HOME/.local/binto thePATHvariable, followed by a
restart of the terminal.For Windows, however, as noted in most onlineinstructions, this may need
additional help from your system administrator if your user doesn’t
have the right permissions, and also require a system reboot.Uninstalling PyPopTo uninstall the current version ofpypop-genomics:pipuninstallpypop-genomicsSupport and developmentPlease submit any bug reports, feature requests or questions, via our
GitHub issue tracker (see ourbug reporting guidelinesfor more details on how to file a good bug report):https://github.com/alexlancaster/pypop/issuesPlease do not report bugs via private email to developers.The development of the code for PyPop is via our GitHub project:https://github.com/alexlancaster/pypopFor a detailed description on bug reporting as well as how to
contribute to PyPop, please consult ourCONTRIBUTING.rstguide. For reporting security vulnerabilities visitSECURITY.md.We also have additional notes and background relevant for developers
inDEV_NOTES.md. Source
for the website and the documentation is located in thewebsitesubdirectory.Copyright and LicensePyPop is Copyright (C) 2003-2006. The Regents of the University of
California (Regents)Copyright (C) 2007-2023 PyPop team.PyPop is distributed under the terms of GPLv2