def get_subtype_reference_alignment_entropy(region, subtype='B', VERBOSE=0, refname='HXB2', type='nuc'): '''Get the entropy of a large subtype reference alignment''' import numpy as np fn = get_subtype_reference_alignment_entropy_filename(region, subtype=subtype, refname=refname, type=type, VERBOSE=VERBOSE) return np.load(fn)
VERBOSE=VERBOSE) if VERBOSE >= 2: print 'Compute entropy' if alitype == 'nuc': alphabet = alpha[:4] else: alphabet = alphaa[:-3] S = get_ali_entropy(ali, alpha=alphabet, VERBOSE=VERBOSE) if VERBOSE >= 2: print 'Store to file' fn_out = get_subtype_reference_alignment_entropy_filename(region, subtype=subtype, refname=refname, type=alitype, VERBOSE=VERBOSE) S.dump(fn_out) else: if VERBOSE >= 2: print 'Get entropy from file' S = get_subtype_reference_alignment_entropy(region, subtype=subtype, refname=refname, type=alitype, VERBOSE=VERBOSE) Ss[region] = S
VERBOSE=VERBOSE) if VERBOSE >= 2: print 'Compute entropy' if alitype == 'nuc': alphabet = alpha[:4] else: alphabet = alphaa[:-3] S = get_ali_entropy(ali, alpha=alphabet, VERBOSE=VERBOSE) if VERBOSE >= 2: print 'Store to file' fn_out = get_subtype_reference_alignment_entropy_filename( region, subtype=subtype, refname=refname, type=alitype, VERBOSE=VERBOSE) S.dump(fn_out) else: if VERBOSE >= 2: print 'Get entropy from file' S = get_subtype_reference_alignment_entropy(region, subtype=subtype, refname=refname, type=alitype, VERBOSE=VERBOSE) Ss[region] = S