def filter_to_region(node, contig=None, coords=None):
    """Return True iff a node is within a given region (and region is specified)."""
    ((seq, coord), miss) = node
    if contig and seq != contig:
        return False
    if coords and coord < coords[0]:
        return False
    if coords and coord > coords[1]:
        return False
    return True