def passthrough(args):
    """
    %prog passthrough chrY.vcf chrY.new.vcf

    Pass through Y and MT vcf.
    """
    p = OptionParser(passthrough.__doc__)
    opts, args = p.parse_args(args)

    if len(args) != 2:
        sys.exit(not p.print_help())

    vcffile, newvcffile = args
    fp = open(vcffile)
    fw = open(newvcffile, "w")
    gg = ["0/0", "0/1", "1/1"]
    for row in fp:
        if row[0] == "#":
            print(row.strip(), file=fw)
            continue

        v = VcfLine(row)
        v.filter = "PASS"
        v.format = "GT:GP"
        probs = [0] * 3
        probs[gg.index(v.genotype)] = 1
        v.genotype = v.genotype.replace("/", "|") + \
                ":{0}".format(",".join("{0:.3f}".format(x) for x in probs))
        print(v, file=fw)
    fw.close()
def passthrough ( args ) : p = OptionParser ( passthrough . __doc__ ) opts , args = p . parse_args ( args ) if len ( args ) != 2 : sys . exit ( not p . print_help ( ) ) vcffile , newvcffile = args fp = open ( vcffile ) fw = open ( newvcffile , "w" ) gg = [ "0/0" , "0/1" , "1/1" ] for row in fp : if row [ 0 ] == "#" : print ( row . strip ( ) , file = fw ) continue v = VcfLine ( row ) v . filter = "PASS" v . format = "GT:GP" probs = [ 0 ] * 3 probs [ gg . index ( v . genotype ) ] = 1 v . genotype = v . genotype . replace ( "/" , "|" ) + ":{0}" . format ( "," . join ( "{0:.3f}" . format ( x ) for x in probs ) ) print ( v , file = fw ) fw . close ( )
%prog passthrough chrY.vcf chrY.new.vcf

    Pass through Y and MT vcf.