def __init__(self, data=None, Info=None, **kwargs): """Intializes BaseUsage with data, either sequence or dict of freqs. Ignores additional kwargs (e.g. to support copy). Makes the _handler for delegator accessible with the name Info. """ if Info is None: if hasattr(data, 'Info'): Info = data.Info else: Info = InfoClass() Delegator.__init__(self, Info) Freqs.__init__(self, data or [], **kwargs)
def Rna(x, Info=None): if isinstance(x, list): x = ''.join(x) if Info is None: Info = {} return RnaSequence(x.upper().replace('T','U'), Info=InfoClass(Info))