Moving to the Dark Side

Leaving the Pipette for a Keyboard.

Clone all repositories from a user (bitbucket) - API2.0

My post about cloning all bitbucket, originally posted on my old wordpress blog, got some attention over the internet. Well, three or four mentions. Sadly the information in there has been outdated due to Bitbucket’s API changes. That added to the shocking decision by Bitbucket to stop supporting mercurial repos and delete them (!) pushed me to finally download all my repos (again) and eventually move to gitlab. Maybe in a follow up post I will detail how I converted all hg repos to git.

Read More

How style your R code from sublime text

Let’s face it: we all write ugly R code. Either because we are in a hurry, or we copy pasted from stackoverflow, or our coding style just changed over the course of time, it doesn’t really matter: my code is not well formatted and barely adheres to any formatting convention no matter how much I tell myself otherwise. I could do it from an R console or in Rstudio. However the command-line option is too much of an hassle and I use Sublime Text.

Read More

My first R package - some notes

I have been toying with the idea of making an R package for sometime. To me this is the natural step after been an R user for some years now. Though I had some ideas they all sounded either a bit too over-complicated for a starting package, or not useful enough. In ideal world, and for me personally, I would write a package with a single function, that I could use, to learn the ropes.

Read More

How to compile R in a specific location

Issue

Read More

How big is my baby?

updated on 2017-08-28 to include 1 year measurements

Read More

Filter overlapping features in bed file

I was doing something that should be easy but I couldn’t find a solution online: remove overlapping coordinates in a single bed file and these must be within a certain distance. In this example:

Read More

Function to find maximal coverage in multiple bigwigs II

[This is an updated version of this post with improved functions and a reproducible example]

Read More

Function to find maximal coverage in multiple bigwigs

I really like the package Gviz to prepare figures for presentations and publications (I have used it in B with some tidying up in inskape).

Read More

Sublime Text 3 set-up

I am a big fan of Sublime Text! It is a lightweight text editor, inexpensive license, and with contributions by hundreds of users, highly extensible and customizable. From a practical perspective, I prefer to use it instead of IDEs, such as Jupyter or RStudio, because I also write a lot of little bash/shell scripts or just one-liners embedded in markdown (my projects notebooks). Also, the pipeline I am using is based on groovy. Sometimes I write code in all 4 languages in a single day, and thus it is easy to see why I prefer a single development environment instead of having to memorize different shortcuts/layouts. Personally it makes my life easier. Also, I love the multi-line editing features of sublime text and the ability to search within projects, etc.

Read More

Custom chromosome sizes for pybedtools

I use pybetools a lot in my little script. One issue that I have encountered recentely was when using those scripts with a custom genome, in this case mapping to the transcriptome. One of my scripts calculates using genome_coverage(bg=True, genome=genome) and the argument genome, is an input from the command line.

Read More