diff --git a/src/PyPop/_deprecations.py b/src/PyPop/_deprecations.py index c75fc1b6..2042ae16 100644 --- a/src/PyPop/_deprecations.py +++ b/src/PyPop/_deprecations.py @@ -64,10 +64,8 @@ deprecated_modules = { "PyPop.datatypes.AlleleCounts": { - "new": "", "reason": "The :class:`~PyPop.datatypes.Genotypes` class now holds allele count data as pseudo-genotype matrix.", - "deprecated": "0.6.0", - "removal": "1.4.2", + "removed": "1.4.2", }, "PyPop.Arlequin": { "new": "PyPop.arlequin", diff --git a/src/PyPop/datatypes.py b/src/PyPop/datatypes.py index 10a538f4..18f47a84 100644 --- a/src/PyPop/datatypes.py +++ b/src/PyPop/datatypes.py @@ -361,72 +361,6 @@ def getIndividualsData(self): return self.matrix -class AlleleCounts: - """Deprecated class to store information in allele count form. - - .. deprecated:: 0.6.0 - this class is now obsolete, the :class:`Genotypes` class - now holds allele count data as pseudo-genotype matrix. - """ - - def __init__(self, alleleTable=None, locusName=None): - self.alleleTable = alleleTable - self.locusName = locusName - self._genDataStructures() - - def _genDataStructures(self): - total = 0 - self.freqcount = {} - - for allele in self.alleleTable: - total += self.alleleTable[allele] - - # store in an iVar for the moment - self.totalAlleleCount = total - - logger.debug("alleleTable", self.alleleTable) - - # simply reconstruct the 3-tuple as generated in - # ParseGenotypeFile: alleleTable (a map of counts keyed by - # allele), total allele count and the number of untyped - # individuals (in this case, by definition it is zero). - # then store in the same data structure as ParseGenotypeFile - - # even though we only have a single locus, this will make it - # easy to generalize later - - self.freqcount[self.locusName] = self.alleleTable, self.totalAlleleCount, 0, 0 - - def serializeSubclassMetadataTo(self, stream): - """Serialize subclass-specific metadata. - - Specifically, total number of alleles and loci. - """ - stream.opentag("summaryinfo") - stream.writeln() - stream.tagContents("allelecount", f"{self.totalAlleleCount}") - stream.writeln() - stream.tagContents("locuscount", f"{1}") - stream.writeln() - stream.closetag("summaryinfo") - stream.writeln() - - def serializeAlleleCountDataAt(self, stream, locus): - # call the class-independent function... - - alleleTable, total, untypedIndividuals, unsequencedSites = self.freqcount[locus] - _serializeAlleleCountDataAt( - stream, alleleTable, total, untypedIndividuals, unsequencedSites - ) - - def getAlleleCount(self): - return self.freqcount[self.locusName] - - def getLocusName(self): - # the first key is the name of the locus - return self.locusName - - def _serializeAlleleCountDataAt( stream, alleleTable, total, untypedIndividuals, unsequencedSites ):