def taxonomy_dict(metadata, input_metadata=None):
    """
    Read metadata from dataset and input_metadata.
    input: metadata file, input metadata file (optional)
    return: dictionary with taxon: group; dictionary with
    full names 
    """
    tax_g = {}
    full_names = {}
    for line_ in open(metadata):
        line_ = line_.strip()
        if 'Full Name' not in line_:
            sline = line_.split('\t')
            tax = sline[0].strip()
            group = sline[2].strip()
            full_name = sline[1].strip()
            tax_g[tax] = group
            full_names[tax] = full_name
    if input_metadata:
        for line in open(input_metadata):
            line = line.strip()
            if 'Long name' not in line:
                metadata_input = line.split('\t')
                tax = metadata_input[2].strip()
                group = metadata_input[3].strip()
                full_name = metadata_input[6].strip()
                tax_g[tax] = group
                full_names[tax] = full_name
    return tax_g, full_names
