allele.py

I don’t know how useful this will be, but it allows visualization on a terminal of the differences between two alleles. I used it in testing haploh.Haplotyper.

allele.compare_allele_files(AF, BF, stream=None, verbose=False)[source]

Visualize two files, AF and BF, representing alleles, printing dots where they are homozygous.

allele.compare_allele_streams(A, B, stream=None, verbose=False)[source]

For two input streams, A and B, visualize their comparison on the output stream, printing dots where they are homozygous. If verbose, print the original streams as well.

allele.printDot(alleleA, alleleB)[source]

Print a dot if alleleA and alleleB are the same, otherwise print alleleA

allele.visual_compare_alleles(alleleA, alleleB, label='')[source]

Return a line with dots for homozygous loci and alleleA otherwise. Prefix the line with label if given.