{"id":4534,"date":"2019-03-05T14:22:34","date_gmt":"2019-03-05T14:22:34","guid":{"rendered":"https:\/\/www.blopig.com\/blog\/?p=4534"},"modified":"2019-04-29T00:54:43","modified_gmt":"2019-04-28T23:54:43","slug":"some-useful-tools","status":"publish","type":"post","link":"https:\/\/www.blopig.com\/blog\/2019\/03\/some-useful-tools\/","title":{"rendered":"Some useful tools"},"content":{"rendered":"\n<p>For my blog post this week, I thought I would share, as the title suggests, a small collection of tools and packages that I found to make my work a bit easier over the last few months (mainly python based). I might add to this list as I find new tools that I think deserve a shout-out.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Biopandas<\/strong><\/h3>\n\n\n\n<p>Reading in .pdb files for processing and writing your own parser (while being a good exercise to familiarize yourself with the format) is a pain and clutters your code with boilerplate.<\/p>\n\n\n\n<p>Luckily for us, Sebastian Raschka has written a neat package called biopandas [1] which enables quick I\/O of .pdb files via the pandas DataFrame class. <\/p>\n\n\n\n<!--more-->\n\n\n\n<p>The best feature of this package: You do not have to look up the column numbers of the .pdb entry categories anymore.<\/p>\n\n\n\n<p>Example usage (from the package github page: <a href=\"https:\/\/rasbt.github.io\/biopandas\/\">https:\/\/rasbt.github.io\/biopandas\/<\/a>)<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># Initialize a new PandasPdb object\n# and fetch the PDB file from rcsb.org\nfrom biopandas.pdb import PandasPdb\nppdb = PandasPdb().fetch_pdb('3eiy')\nprint(ppdb.df['ATOM'].head())<\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"576\" height=\"181\" loading=\"lazy\" src=\"https:\/\/i0.wp.com\/www.blopig.com\/blog\/wp-content\/uploads\/2019\/03\/3eiy_head.png?resize=576%2C181&#038;ssl=1\" alt=\"\" class=\"wp-image-4536\" srcset=\"https:\/\/i0.wp.com\/www.blopig.com\/blog\/wp-content\/uploads\/2019\/03\/3eiy_head.png?w=576&amp;ssl=1 576w, https:\/\/i0.wp.com\/www.blopig.com\/blog\/wp-content\/uploads\/2019\/03\/3eiy_head.png?resize=300%2C94&amp;ssl=1 300w\" sizes=\"auto, (max-width: 576px) 100vw, 576px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Joblib<\/h3>\n\n\n\n<p>Joblib is a python package that wraps around the python multiprocessing package, providing a much more readable code layout for multiprocessing alongside with meaningful progression information printed to stdout.<\/p>\n\n\n\n<p>Example usage:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">#!\/usr\/bin\/env python\n\ndef foo(arg1, arg2):\n    return arg1, arg2\n \nlist_of_args = [...]\noutput = []\n\nfor i in range(len(list_of_args)):\n    output.append(foo(list_of_args[i], 'some_other_argument')\n<\/pre>\n\n\n\n<p>becomes<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">#!\/usr\/bin\/env python\n\nfrom joblib import Parallel, delayed\n\ndef foo(arg1, arg2):\n    return arg1, arg2\n\nlist_of_args = [...]\n\nwith Parallel(n_jobs=n) as parallel:\n    output = parallel(delayed(foo)(arg2='some_other_argument') for item in list_of_args)<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Jupyter Lab<\/strong><\/h3>\n\n\n\n<p>Not quite as well known (yet) as its predecessor (jupyer notebook), jupyter lab is in my opinion an essential tool for anyone using ipython or jupyter notebooks in their data processing workflow. With the addition of a filebrowser, an easy overview of running kernels and maybe most importantly, a separate tab-bar for your notebooks so they do not crowd your browser anymore, it improves pretty much every aspect of using jupyter notebooks on their own, upgrading them to a browser-based IDE.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"625\" height=\"360\" loading=\"lazy\" src=\"https:\/\/i0.wp.com\/www.blopig.com\/blog\/wp-content\/uploads\/2019\/03\/jl.png?resize=625%2C360&#038;ssl=1\" alt=\"\" class=\"wp-image-4539\" srcset=\"https:\/\/i0.wp.com\/www.blopig.com\/blog\/wp-content\/uploads\/2019\/03\/jl.png?resize=1024%2C590&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.blopig.com\/blog\/wp-content\/uploads\/2019\/03\/jl.png?resize=300%2C173&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.blopig.com\/blog\/wp-content\/uploads\/2019\/03\/jl.png?resize=768%2C442&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.blopig.com\/blog\/wp-content\/uploads\/2019\/03\/jl.png?resize=624%2C359&amp;ssl=1 624w, https:\/\/i0.wp.com\/www.blopig.com\/blog\/wp-content\/uploads\/2019\/03\/jl.png?w=1320&amp;ssl=1 1320w, https:\/\/i0.wp.com\/www.blopig.com\/blog\/wp-content\/uploads\/2019\/03\/jl.png?w=1250&amp;ssl=1 1250w\" sizes=\"auto, (max-width: 625px) 100vw, 625px\" \/><figcaption>image taken from https:\/\/blog.jupyter.org\/jupyterlab-is-ready-for-users-5a6f039b8906<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Spotify<\/strong><\/h3>\n\n\n\n<p>Because Apple Music does not have a Linux or a web-browser application.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Looyat off-brand nerf darts<\/strong><\/h3>\n\n\n\n<p>They are much cheaper than Nerf brand darts.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">References<\/h3>\n\n\n\n<p>[1] Sebastian Raschka. Biopandas: Working with molecular structures in pandas dataframes. <em>The Journal of Open Source Software<\/em>, 2(14), jun 2017. doi: 10.21105\/joss.00279. URL <a href=\"http:\/\/dx.doi.org\/10.21105\/joss.00279\">http:\/\/dx.doi.org\/10.21105\/joss.00279<\/a>.<\/p>\n\n\n","protected":false},"excerpt":{"rendered":"<p>For my blog post this week, I thought I would share, as the title suggests, a small collection of tools and packages that I found to make my work a bit easier over the last few months (mainly python based). I might add to this list as I find new tools that I think deserve [&hellip;]<\/p>\n","protected":false},"author":54,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","wikipediapreview_detectlinks":true,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"ngg_post_thumbnail":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[29,14,46,227,15],"tags":[],"ppma_author":[536],"class_list":["post-4534","post","type-post","status-publish","format-standard","hentry","category-code","category-howto","category-humour","category-python-code","category-technical"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"authors":[{"term_id":536,"user_id":54,"is_guest":0,"slug":"constantin","display_name":"Constantin Schneider","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/a5a52b2568c59d46723b7a77f296dbd5cb9d683382a754d869cad2aa2d6d5c6b?s=96&d=mm&r=g","0":null,"1":"","2":"","3":"","4":"","5":"","6":"","7":"","8":""}],"_links":{"self":[{"href":"https:\/\/www.blopig.com\/blog\/wp-json\/wp\/v2\/posts\/4534","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.blopig.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.blopig.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.blopig.com\/blog\/wp-json\/wp\/v2\/users\/54"}],"replies":[{"embeddable":true,"href":"https:\/\/www.blopig.com\/blog\/wp-json\/wp\/v2\/comments?post=4534"}],"version-history":[{"count":5,"href":"https:\/\/www.blopig.com\/blog\/wp-json\/wp\/v2\/posts\/4534\/revisions"}],"predecessor-version":[{"id":4642,"href":"https:\/\/www.blopig.com\/blog\/wp-json\/wp\/v2\/posts\/4534\/revisions\/4642"}],"wp:attachment":[{"href":"https:\/\/www.blopig.com\/blog\/wp-json\/wp\/v2\/media?parent=4534"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.blopig.com\/blog\/wp-json\/wp\/v2\/categories?post=4534"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.blopig.com\/blog\/wp-json\/wp\/v2\/tags?post=4534"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.blopig.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=4534"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}