def validate_sequence(sequence, sequence_type):
    """
    This method is used to evalute the string passed to the Sequence constructor
         
    I used this https://blast.ncbi.nlm.nih.gov/Blast.cgi?CMD=Web&PAGE_TYPE=BlastDocs&DOC_TYPE=BlastHelp as reference
    for which bases and aminoacids representation are valid in FASTA files  
    
    Parameters
    -------------

    sequence : str 
        The DNA/RNA/Protein sequence
    sequence_type : str 
        The sequence type, it can be either 'DNA', 'RNA' or 'Protein' 

    """

    legal_values = []

    if sequence_type == 'DNA':
        legal_values = ['A', 'G', 'C', 'W', 'S', 'M', 'K', 'R', 'Y', '-', 'B', 'V', 'D', 'H', 'N', 'T'] #list of possible Bases
    elif sequence_type == 'RNA':
        legal_values = ['A', 'G', 'C', 'W', 'S', 'M', 'K', 'R', 'Y', '-', 'B', 'V', 'D', 'H', 'N', 'U']
    elif sequence_type == 'Protein':
        legal_values = [chr(i) for i in range(65, 91)] #again, this is based on the way in which aminoacids are represented in FASTA files
        legal_values.remove('J')
        legal_values.append('-')
        legal_values.append('*')
    
    for base in sequence:
        if base not in legal_values: return False
    return True