def is_gvcf_file(in_file):
    """Check if an input file is raw gVCF
    """
    to_check = 100
    n = 0
    with utils.open_gzipsafe(in_file) as in_handle:
        for line in in_handle:
            if not line.startswith("##"):
                if n > to_check:
                    break
                n += 1
                parts = line.split("\t")
                # GATK
                if parts[4] == "<NON_REF>":
                    return True
                # strelka2
                if parts[4] == "." and parts[7].startswith("BLOCKAVG"):
                    return True
                # freebayes
                if parts[4] == "<*>":
                    return True
                # platypue
                if parts[4] == "N" and parts[6] == "REFCALL":
                    return True
def is_gvcf_file ( in_file ) : to_check = 100 n = 0 with utils . open_gzipsafe ( in_file ) as in_handle : for line in in_handle : if not line . startswith ( "##" ) : if n > to_check : break n += 1 parts = line . split ( "\t" ) if parts [ 4 ] == "<NON_REF>" : return True if parts [ 4 ] == "." and parts [ 7 ] . startswith ( "BLOCKAVG" ) : return True if parts [ 4 ] == "<*>" : return True if parts [ 4 ] == "N" and parts [ 6 ] == "REFCALL" : return True
Check if an input file is raw gVCF