from typing import Dict
import gzip


def read_fasta(filename: str) -> Dict[str, str]:
    """
    Reads a file containing multiple FASTA sequences and returns a dictionary of the header: sequence
    :param str filename: should be the name of the open file to be read
    :return: dict containing the header: the sequence
    """
    seq_dict = {}
    with gzip.open(filename, 'rt') as fc:
        all_lines = str(fc.read())
        seqs = all_lines.split('>')
        for seq in seqs[1:]:
            seq = seq.strip('"').split('\n')
            ref_id, prot_name = seq[0].replace(' [Homo sapiens]', '').split(' ', 1)
            if "NP_" in ref_id:
                seq_dict[ref_id] = ''.join(seq[1:])
        return seq_dict