Skip to content

Commit

Permalink
End-user warning that undocumented module [Haplostats] is not yet s…
Browse files Browse the repository at this point in the history
…upported (#118)

* remove deprecated from `[Emhaplofreq]` config

move unsupported warning to `[Haplostats]`.
cleanup some of the LOG messages and line-feeds

* remove release notes about Haplostats from NEWS, put in DEV_NOTES for the time being

* add Changelog link to `NEWS.rst`: add to project_urls
  • Loading branch information
alexlancaster authored Sep 10, 2023
1 parent e946e2f commit 9d9edf5
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 14 deletions.
11 changes: 9 additions & 2 deletions DEV_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Developer notes

## Release notes for in-progress features not yet officially documented or supported

* New wrapper module `Haplostats`. This wraps a portion of the
`haplo.stats` R package `haplo-stats` for haplotype
estimation. [Implementation in alpha-phase].


## External dependencies

* ```swig``` (Simple Wrapper Interface Generator) (build-time only)
Expand Down Expand Up @@ -40,8 +47,8 @@ the) it then runs the specified modules (outlined below).
"wxPython":http://www.wxpython.org GUI toolkit. wxPython is a set of
Python bindings to "wxWindows":http://www.wxwindows.org, which is an
open-source cross-platform GUI widget toolkit which has a native look
under GNU/Linux (GTK), Windows (MFC) and MacOS X (Aqua). [as of 2017,
this is deprecated]
under GNU/Linux (GTK), Windows (MFC) and MacOS X (Aqua). [as of 2023,
this was removed]

* 'ParseFile' is a base class which has most of the common functionality
for reading files.
Expand Down
3 changes: 0 additions & 3 deletions NEWS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ New features
^^^^^^^^^^^^^^
* Updated to Python 3
* Implement new assymetric LD (ALD) measure
* New wrapper module ``Haplostats``. This wraps a portion of the
``haplo.stats`` R package ``haplo-stats`` for haplotype
estimation. [Implementation in alpha-phase].
* ``popmeta``: now accepts the ``-o``/``--outputdir`` option for saving
generated files.
* ``pypop``: renamed ``--generate-tsv`` to ``--enable-tsv``
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ def path_to_src(source_path_list):
url = "http://www.pypop.org/",
project_urls={
'Documentation': 'http://pypop.org/docs/',
'Changelog': 'https://github.com/alexlancaster/pypop/blob/main/NEWS.rst',
'Source': 'https://github.com/alexlancaster/pypop/',
'Tracker': 'https://github.com/alexlancaster/pypop/issues',
},
Expand Down
18 changes: 9 additions & 9 deletions src/PyPop/Main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1017,6 +1017,9 @@ def _doGenotypeFile(self):

if self.config.has_section("Haplostats"):

print ("WARNING: The [Haplostats] module is still currently in ALPHA-MODE ONLY and and should not be used in production.")
print ("Please use the [Emhaplofreq] module in the meantime.")

try:
numInitCond = self.config.getint("Haplostats",
"numInitCond")
Expand Down Expand Up @@ -1076,9 +1079,6 @@ def _doGenotypeFile(self):

if self.config.has_section("Emhaplofreq"):

print ("WARNING: The [Emhaplofreq] module is officially DEPRECATED and may be removed in coming releases.")
print ("Please transition to using the new [Haplostats] module.")

# create object to generate haplotype and LD statistics
# a wrapper around the emhaplofreq module
haplo = Emhaplofreq(self.input.getIndividualsData(),
Expand Down Expand Up @@ -1148,11 +1148,11 @@ def _doGenotypeFile(self):


if allPairwiseLD:
print("LOG: estimating all pairwise LD:"),
print("LOG: estimating all pairwise LD:", end=" "),
if allPairwiseLDWithPermu:
print("with %d permutations and %d initial conditions for each permutation" % (allPairwiseLDWithPermu, numPermuInitCond)),
print("with %d permutations and %d initial conditions for each permutation" % (allPairwiseLDWithPermu, numPermuInitCond), end=" "),
if permutationPrintFlag:
print("and each permutation output will be logged to XML")
print("and each permutation output will be logged to XML", end=" ")
else:
print()
else:
Expand All @@ -1166,15 +1166,15 @@ def _doGenotypeFile(self):
locusKeys=self.config.get("Emhaplofreq", "lociToEstHaplo")

if locusKeys == '*':
print("wildcard '*' given for lociToEstHaplo, assume entire data set")
print("LOG: wildcard '*' given for lociToEstHaplo, assume entire data set")
locusKeys=":".join(self.input.getIndividualsData().colList)
print("LOG: estimating haplotype frequencies for"),
print("LOG: estimating haplotype frequencies for", end=" "),

# if we will be running allPairwise*, then exclude any two-locus
# haplotypes, since we will estimate them as part of 'all pairwise'
if allPairwiseLD:

print("all two locus haplotypes,"),
print("all two locus haplotypes,", end=" "),
modLocusKeys = []
for group in locusKeys.split(','):

Expand Down

0 comments on commit 9d9edf5

Please sign in to comment.