def filter_contigs(all_contigs, ancient_contigs):
    """Filter contigs if in ancient contigs

    Args:
        all_contigs(dict): fasta dict of contigs, seqname as key, sequence as value
        ancient contigs(list): list of ancient contigs names
    Returns:
        (dict): ancient contigs, seqname as key, sequence as value
    """
    a_contigs = {}
    for c in all_contigs:
        cname = c.split()[0][1:]
        if cname in ancient_contigs:
            a_contigs[c] = all_contigs[c]
    return(a_contigs)