def mean_depth_and_length_from_minos_vcf(infile):
    """Gets mean depth and max read length from header of VCF file made by minos"""
    max_length = None
    mean_depth = None

    with open(infile) as f:
        for line in f:
            if line.startswith("##minosMeanReadDepth"):
                mean_depth = float(line.rstrip().split("=")[-1])
            elif line.startswith("##minos_max_read_length"):
                max_length = float(line.rstrip().split("=")[-1])
            elif line.startswith("#CHROM"):
                break

    if max_length is not None and mean_depth is not None:
        return mean_depth, max_length
    else:
        raise RuntimeError(
            f"Error getting minos mean read depth and/or length from VCF file {infile}"
        )