Breaking BAM

It’s fun to mess with our bioinformatics tools and laugh at ourselves. The BAM format carries a query name string. In an idle moment I wondered, how long a string can I put here before bad things happen to the BAM? Generally this string carries information related to the device that produced the read, lane… Read More Breaking BAM

The logging overhead.

Python makes printing logger messages, and adjusting the logger level (which messages to print when) very easy. However, it seems, that the logger code comes with a higher overhead than if you used simple ‘if’ statements to control what messages to print. Logger messages are very, very useful. Two typical uses of logger messages is… Read More The logging overhead.

Python: passing a mix of keyword arguments and dictionary arguments to a function

So Python is cool because of keyword arguments: def foo(a=1,b=2,c=3): print a,b,cfoo(a=1) # -> 1 2 3 Python is cool because you can pass a dictionary whose keys match the argument names: def foo(a=1,b=2,c=3): print a,b,cargs = {‘a’: 1, ‘b’:2}foo(**args) # -> 1 2 3 But, can you mix the two? Yes, yes you can!… Read More Python: passing a mix of keyword arguments and dictionary arguments to a function