{ "info": { "author": "Brent Pedersen, Joe Brown", "author_email": "bpederse@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Utilities" ], "description": "bsub\n====\n\npython wrapper to submit jobs to bsub (and later qsub)\n\nAuthors\n------\n@brentp, @brwnj\n\n\nExample\n-------\n\n```python\n>>> from bsub import bsub\n>>> sub = bsub(\"some_job\", R=\"rusage[mem=1]\", verbose=True)\n\n# submit a job via call'ing the sub object with the command to run.\n# the return value is the numeric job id.\n>>> print sub(\"date\").job_id.isdigit()\nTrue\n\n# 2nd argument can be a shell script, in which case\n# the call() is empty.\n#>>> bsub(\"somejob\", \"run.sh\", verbose=True)()\n\n# dependencies:\n>>> job_id = bsub(\"sleeper\", verbose=True)(\"sleep 2\").job_id\n>>> bsub.poll(job_id)\nTrue\n\n```\n\nSugar\n-----\n\nFor file jobs, we can emulate shell syntax:\n\n```Python\n\njob = bsub('my-job') < 'run.sh'\n```\n\nSame for text commands:\n\n```Python\n\n\"echo hello\" | bsub('other-job')\n\n```\n\nChaining\n--------\n\nIt's possible to specify dependencies to LSF using a flag like:\n\n bsub -w 'done(\"other-name\")' < myjob\n\nWe make this more pythonic with:\n\n```Python\n\n>>> j = sub('sleep 1').then('sleep 2')\n\n```\nwhich will wait for the first job `sleep 1` to complete\nbefore running the second job `sleep 2`. These can be chained as:\n\n```Python\n\nj = sub('myjob')\nj2 = j('sleep 1')\nj3 = j2.then('echo \"hello\"')\nj4 = j3.then('echo \"world\"')\nj5 = j4.then('my scripts.p')\n\n# or:\n\nj('sleep 1').then('echo \"hello\"').then('echo \"world\"')\n\n```\nWhere each job in `.then()` is not run until the preceding job\nis `done()` according to LSF.\n\n\nBioinformatics example of chaining:\n\nThis would submit jobs for positive and negative strand coverage in parallel.\nEach strand submitting jobs that run serially.\n\n```Python\n\nfrom bsub import bsub\n\nsubmit = bsub(\"bam2bg\", verbose=verbose)\n\n# convert bam to stranded bg then bw\nsample = \"subject_1\"\nchrom_sizes = \"chrom_sizes.txt\"\n\n# submit jobs by strand for parallel processing\nfor symbol, strand in zip([\"+\", \"-\"], [\"pos\", \"neg\"]):\n\n bigwig = \"%s_%s.bw\" % (sample, strand)\n bedgraph = \"%s_%s.bedgraph\" % (sample, strand)\n\n bam_to_bg = (\"bedtools genomecov -strand %s -bg \"\n \"-ibam %s | bedtools sort -i - > %s\") % (symbol, bam, bedgraph)\n bg_to_bw = \"bedGraphToBigWig %s %s %s\" % (bedgraph, chrom_sizes, bigwig)\n gzip_bg = \"gzip -f %s\" % bedgraph\n\n # process strand-based steps serially\n # submit first 2 jobs to default queue; final job to 'gzip' queue\n submit(bam_to_bg).then(bg_to_bw, job_name=\"bg2bw\").then(gzip_bg, \"gzipbg\", q='gzip')\n\n```\n\n\nCommand-Line\n------------\n\nuse the command-line to run jobs with auto-specified err and log files:\n\n\n```Shell\necho \"hello\" | python -m bsub -J \"fake\" \nbsub -J fake -e fake.%J.err -o fake.%J.out < /tmp/tmp3vFDwn.sh\n```\nIf a log/ directory exists, the logs will be placed there.\n\nthe shell script is automatically created and cleaned up after use.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/brentp/bsub", "keywords": "cluster lsf bsub", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "bsub", "package_url": "https://pypi.org/project/bsub/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/bsub/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/brentp/bsub" }, "release_url": "https://pypi.org/project/bsub/0.3.5/", "requires_dist": null, "requires_python": null, "summary": "submit jobs to LSF with python", "version": "0.3.5" }, "last_serial": 1316197, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "2fa6e731d811368beb9f711614f7217e", "sha256": "9926fbdbb697b15fc2ac28c27a690a0384b4f595c04da8900b664e1d85a1bdaa" }, "downloads": -1, "filename": "bsub-0.0.1.tar.gz", "has_sig": false, "md5_digest": "2fa6e731d811368beb9f711614f7217e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2813, "upload_time": "2013-03-06T19:26:28", "url": "https://files.pythonhosted.org/packages/71/18/b152e5623795095ac6cc390c18a6003a5df3afa1651cbe75337f2cfc2404/bsub-0.0.1.tar.gz" } ], "0.1": [ { "comment_text": "", "digests": { "md5": "505a5d9cd456f00dc961ee4996d44962", "sha256": "bc8bcfd9367ad65505fd7b4a69560c88915d5cf7aef37ba270c27ce29f8452d5" }, "downloads": -1, "filename": "bsub-0.1.tar.gz", "has_sig": false, "md5_digest": "505a5d9cd456f00dc961ee4996d44962", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2995, "upload_time": "2013-03-26T02:10:22", "url": "https://files.pythonhosted.org/packages/da/07/f00ba6e55c33a88a0165c5d921f83b723a7f830ecefe80307201eaa20bec/bsub-0.1.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "9139f8b3b71d5fe18e7e52f7579eebae", "sha256": "bc8d6821852d001482b48f023ec948a4f5263b66473aef8e909f6f734ae2618a" }, "downloads": -1, "filename": "bsub-0.3.tar.gz", "has_sig": false, "md5_digest": "9139f8b3b71d5fe18e7e52f7579eebae", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3836, "upload_time": "2014-01-10T16:49:12", "url": "https://files.pythonhosted.org/packages/36/8a/34a41775b081256c5380a62ce746397efa4c769764ac2c12435cd33ac221/bsub-0.3.tar.gz" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "ac3d9f7c9150589829c567ab043c03d7", "sha256": "ac4ede5084f2dd2c429b9eac640d937899f4e5a347fd6eff9f49fab036d24582" }, "downloads": -1, "filename": "bsub-0.3.2.tar.gz", "has_sig": false, "md5_digest": "ac3d9f7c9150589829c567ab043c03d7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6227, "upload_time": "2014-05-02T16:14:26", "url": "https://files.pythonhosted.org/packages/af/40/709973f7771a0797d79670742bbef46b0f1c1f18a49c12e46c8fd3f062e2/bsub-0.3.2.tar.gz" } ], "0.3.3": [ { "comment_text": "", "digests": { "md5": "6a2057c0e04711d6119dc6ec82b873c0", "sha256": "6f7e14fe4875d3cb4ffc426b85a4d5a22f9577f9389298936741997208478152" }, "downloads": -1, "filename": "bsub-0.3.3.tar.gz", "has_sig": false, "md5_digest": "6a2057c0e04711d6119dc6ec82b873c0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6317, "upload_time": "2014-06-09T22:32:33", "url": "https://files.pythonhosted.org/packages/b5/b5/2812aceb5ff4989e9df47f0cb22120b770230cb9ccdcdd7fd5dda10ba98d/bsub-0.3.3.tar.gz" } ], "0.3.4": [ { "comment_text": "", "digests": { "md5": "68e7b8fae8578e4e6451509e33c93cb9", "sha256": "58c60ffb2cfc37736e726a65ede7d1314e0d22a29eaf6cac6bd36034f5001906" }, "downloads": -1, "filename": "bsub-0.3.4.tar.gz", "has_sig": false, "md5_digest": "68e7b8fae8578e4e6451509e33c93cb9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6677, "upload_time": "2014-08-05T19:05:33", "url": "https://files.pythonhosted.org/packages/9f/5c/b4f856dddca6b4d21b1d8aa950800b9e4aa347aa878e09a44afa71d54e55/bsub-0.3.4.tar.gz" } ], "0.3.5": [ { "comment_text": "", "digests": { "md5": "aee3e858abf38ad9489c09f3ada2d542", "sha256": "2a5f3c9ab67e5aa00549e32ffdd3e781fc614eebd808440ec86571594aebf9fe" }, "downloads": -1, "filename": "bsub-0.3.5.tar.gz", "has_sig": false, "md5_digest": "aee3e858abf38ad9489c09f3ada2d542", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7011, "upload_time": "2014-11-21T16:22:45", "url": "https://files.pythonhosted.org/packages/9b/a1/03a20c3d854474896753332206bdc8dbee0f0736315ebc31caefbd8a4d05/bsub-0.3.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "aee3e858abf38ad9489c09f3ada2d542", "sha256": "2a5f3c9ab67e5aa00549e32ffdd3e781fc614eebd808440ec86571594aebf9fe" }, "downloads": -1, "filename": "bsub-0.3.5.tar.gz", "has_sig": false, "md5_digest": "aee3e858abf38ad9489c09f3ada2d542", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7011, "upload_time": "2014-11-21T16:22:45", "url": "https://files.pythonhosted.org/packages/9b/a1/03a20c3d854474896753332206bdc8dbee0f0736315ebc31caefbd8a4d05/bsub-0.3.5.tar.gz" } ] }