def __init__(self, *args, **kwargs):
        """
        Initialize Allele object

        Required arguments:
        sequence:  Short string of DNA letters (ACGT) for the allele.
                   May be empty (to represent a deletion).

        Optional arguments:
        frequency: a string representation of a float between 0 and 1
        """
        sequence = kwargs['sequence']
        if 'frequency' in kwargs:
            frequency = kwargs['frequency']
        else:
            frequency = 'Unknown'

        if not (re.match(r'^[ACGTN]*$', sequence) or
                re.match(r'^<.*>$', sequence)):
            raise ValueError("Allele sequence isn't a standard DNA sequence")
        self.sequence = sequence
        if frequency:
            try:
                if (float(frequency) < 0.0 or
                        float(frequency) > 1.0):
                    raise ValueError('Allele frequency not between 0 and 1')
            except ValueError:
                if not frequency == 'Unknown':
                    raise ValueError('Allele frequency must be a number ' +
                                     'between 0 and 1, or the string ' +
                                     '"Unknown".')
            self.frequency = frequency
def __init__ ( self , * args , ** kwargs ) : sequence = kwargs [ 'sequence' ] if 'frequency' in kwargs : frequency = kwargs [ 'frequency' ] else : frequency = 'Unknown' if not ( re . match ( r'^[ACGTN]*$' , sequence ) or re . match ( r'^<.*>$' , sequence ) ) : raise ValueError ( "Allele sequence isn't a standard DNA sequence" ) self . sequence = sequence if frequency : try : if ( float ( frequency ) < 0.0 or float ( frequency ) > 1.0 ) : raise ValueError ( 'Allele frequency not between 0 and 1' ) except ValueError : if not frequency == 'Unknown' : raise ValueError ( 'Allele frequency must be a number ' + 'between 0 and 1, or the string ' + '"Unknown".' ) self . frequency = frequency
Initialize Allele object

        Required arguments:
        sequence:  Short string of DNA letters (ACGT) for the allele.
                   May be empty (to represent a deletion).

        Optional arguments:
        frequency: a string representation of a float between 0 and 1