def main(argv=sys.argv):

    parser = E.OptionParser(version="%prog version: $Id$",
                            usage=globals()["__doc__"])

    parser.add_option(
        "--method", dest="methods", type="choice", action="append",
        choices=("reorder-samples",),
        help="method to apply [default=%default]")

    parser.add_option(
        "--sort-order", dest="sort_order",
        help="sort order for sample names. Give column names as "
        "comma-separated list or specify ``alphabetical`` "
        "[default=%default]")

    parser.set_defaults(
        methods=[],
        sort_order="alphabetical",
    )

    (options, args) = E.Start(parser, add_pipe_options=True)

    if not options.methods:
        raise ValueError("no method specified")

    infile = VCF.VCFFile(options.stdin)

    sort_order = False
    if options.methods in "reorder-samples":
        if options.sort_order:
            sort_order = options.sort_order.split(",")
            if "alphabetical" in sort_order:
                sort_order = sorted(infile.samples)

    infile.writeHeader(options.stdout, order=sort_order)

    for vcf in infile:
        if sort_order:
            vcf.order = sort_order
        options.stdout.write(str(vcf) + "\n")

    E.Stop()
dataset/ETHPy150Open CGATOxford/cgat/scripts/vcf2vcf.py/main/swapped operands of `in`