PyPop.RandomBinning#

Generating randomized sets allele counts for statistical analyses.

Classes#

RandomBinsForHomozygosity

Generate randomized sets of bins for homozygosity analysis.

Module Contents#

class RandomBinsForHomozygosity(logFile=None, untypedAllele='****', filename=None, numReplicates=10000, binningReplicates=100, locus=None, xmlfile=None, debug=0, randomResultsFileName=None)#

Generate randomized sets of bins for homozygosity analysis.

Parameters:
  • logFile (str) – output log file

  • untypedAllele (str, optional) – untyped allele (default ****)

  • filename (str) – input filename

  • numReplicates (int, optional) – replicates (default 10000)

  • binningReplicates (int, optional) – replicates for binning (default 100)

  • locus (str) – locus name

  • xmlfile (XMLOutputStream, optional) – output stream

  • debug (int, optional) – enable debugging with 1, default is 0

  • randomResultsFileName (str) – output file for the randomized results

randomMethod(alleleCountsBefore=None, alleleCountsAfter=None)#

Do binning replicates with random-based method.

Parameters:
  • alleleCountsBefore (list) – allele counts before binning

  • alleleCountsAfter (list) – allele counts after binning

sequenceMethod(alleleCountsBefore=None, alleleCountsAfter=None, polyseq=None, polyseqpos=None)#

Do binning replicates with sequence-based method.

Parameters:
  • alleleCountsBefore (list) – allele counts before binning

  • alleleCountsAfter (list) – allele counts after binning

  • polyseq (dict) – Keyed on locus*allele of all allele sequences, containing ONLY the polymorphic positions.

  • polyseqpos (dict) – Keyed on locus of the positions of the polymorphic residues which you find in polyseq.