importsam.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:hgvm-builder 作者: BD2KGenomics 项目源码 文件源码
def parse_args(args):
    """
    Takes in the command-line arguments list (args), and returns a nice argparse
    result with fields for all the options.

    Borrows heavily from the argparse documentation examples:
    <http://docs.python.org/library/argparse.html>
    """

    # Construct the parser (which is stored in parser)
    # Module docstring lives in __doc__
    # See http://python-forum.com/pythonforum/viewtopic.php?f=3&t=36847
    # And a formatter class so our examples in the docstring look good. Isn't it
    # convenient how we already wrapped it to 80 characters?
    # See http://docs.python.org/library/argparse.html#formatter-class
    parser = argparse.ArgumentParser(description=__doc__, 
        formatter_class=argparse.RawDescriptionHelpFormatter)

    # Add all the toil-vg options
    toilvgfacade.add_options(parser)

    # Add the Toil options so the job store is the first argument
    Job.Runner.addToilOptions(parser)

    parser.add_argument("--contig", default=None,
        help="download just pairs touching this contig or its alts/randoms")

    parser.add_argument("--sam_url", default=[], action="append",
        help="URL to download reads from, accessible from Toil nodes")

    # Output
    parser.add_argument("out_url",
        help="file: or other Toil-supported URL to place results in")

    # The command line arguments start with the program name, which we don't
    # want to treat as an argument for argparse. So we remove it.
    args = args[1:]

    return parser.parse_args(args)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号