Skip to content

Instantly share code, notes, and snippets.

@martijnvermaat
martijnvermaat / trim_common_suffix.py
Created December 28, 2011 16:11
Trim common suffix from sequences
def trim_common_suffix(sequences):
"""
Trim a list of sequences by removing the longest common suffix while
leaving all of them at least one character in length.
"""
@martijnvermaat
martijnvermaat / gist:1717830
Created February 1, 2012 16:23
GitHub mirror of the LOVD3 Subversion repository

This documents how to setup and maintain a GitHub mirror of the official LOVD3 Subversion repository. It is synchronized automatically with the LOVD3 Subversion repository every hour. The mirror only contains SNV trunk (Git master branch), so no branches or tags.

The Git repository was setup using the following commands:

mkdir LOVD3.git
cd LOVD3.git

git init

@martijnvermaat
martijnvermaat / variants_by_region.py
Created February 23, 2012 08:38
Get variants from our in-house database by region
#!/usr/bin/env python
"""
Get variants from our in-house database by region.
Query our in-house variant database for population study variants (e.g. GoNL
or 1KG) contained in the provided region(s) and show their respective
frequencies. The region(s) must be provided in a BED file [1].
[1] http://genome.ucsc.edu/FAQ/FAQformat.html#format1
@martijnvermaat
martijnvermaat / qmake-non-default-project.markdown
Created September 13, 2012 13:05
Set non-default project name for qmake jobs

Set non-default project name for qmake jobs

This is a hack to run jobs on an SGE cluster using qmake under another project than your default project.

Most of the SGE job runners have the -P option. Unfortunately, as the manpage mentions, the option is not available for qmake:

-P project_name
       Available for qsub, qsh, qrsh, qlogin and qalter only.

Specifies the project to which this job is assigned.

@martijnvermaat
martijnvermaat / gonl_freqs.py
Created October 22, 2015 14:09
CSV with allele frequencies from GoNL VCF
#!/usr/bin/env python
#
# CSV with allele frequencies from GoNL VCF.
#
# https://molgenis26.target.rug.nl/downloads/gonl_public/variants/release5/
import sys
from vcf import Reader
@martijnvermaat
martijnvermaat / mutalyzer-webservice.ipynb
Created February 26, 2013 14:14
Using the Mutalyzer webservice
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@martijnvermaat
martijnvermaat / README.md
Last active December 19, 2015 12:29
IPython nbconvert to HTML and LaTeX escaping

Export to HTML with LaTeX

It looks like some escaping is not handled properly.

Steps to reproduce

  1. Open the notebook with IPython notebook and observe that all looks fine:
@martijnvermaat
martijnvermaat / README.md
Last active December 19, 2015 12:38
IPython nbconvert to reveal.js scrollbar

Export to reveal.js introduces a scrollbar

Exporting a notebook with one simple slide to reveal.js introduces a vertical scrollbar (but only if the browser window is wide enough, like over 800px).

This is on current IPython master and was not the case for older nbconvert versions, but I'm unsure which versions exactly.

I also have no clue what the problem is, it must have something to do with the reveal template.

@martijnvermaat
martijnvermaat / postmkvirtualenv
Last active December 20, 2015 09:49
Link PyGTK/Pycairo/PyQt/wxPython from system packages in virtual environment
#!/bin/bash
# This hook is run after a new virtualenv is activated.
#
# For use with virtualenvwrapper [1], based on [2].
#
# This script makes it possible to use PyGTK/Pycairo/PyQt/wxPython in Python
# virtual environments from the corresponding system packages. It is tested on
# Debian wheezy and Ubuntu 12.04.
#
# Copy this script to `~/.virtualenvs/postmkvirtualenv` (make it executable)
@martijnvermaat
martijnvermaat / .gitignore
Last active December 21, 2015 06:48
Benchmark: CyVCF versus PyVCF
*.vcf.gz