def get_dict_from_fasta(args):
    """
    The fasta is read and stored in a dictionary with the IDs as keys and
    the sequence as values. It also returns a list with all the chains id.
    """
    fasta_file = open(args.inputfasta)
    list_ID = []
    fasta_dic = {}
    cur_id = ''
    cur_seq = []
    for line in fasta_file:
        line = line.strip()
        if line.startswith('>') and cur_id == '':
            cur_id = line.split(' ')[0][1:]
            list_ID.append(cur_id)
        elif line.startswith('>') and cur_id != '':
            fasta_dic[cur_id] = ''.join(cur_seq)
            cur_id = line.split(' ')[0][1:]
            list_ID.append(cur_id)
            cur_seq = []
        else:
            cur_seq.append(line.rstrip())
    fasta_dic[cur_id] = ''.join(cur_seq)
    return fasta_dic, list_ID
