Author Archives: Thomas Cokelaer

How do use itertools in Python to build permutation or combination

There is a python module dedicated to permutations and combinations called itertools. import itertoolsimport itertools The permutation function allows you to get permutation of N values within a list, where order matters. For instance, selecting N=2 values with [1,2,3] is … Continue reading

Posted in Python | Tagged | 6 Comments

yum update failure: Cannot retrieve repository metadata

Sometimes, using “yum update”, the process fails with an error message similar to:: Error: Cannot retrieve repository metadata (repomd.xml) for repository: rpmfusion-free-updates. Please verify its path and try again Error: Cannot retrieve repository metadata (repomd.xml) for repository: rpmfusion-free-updates. Please verify … Continue reading

Posted in Linux | Tagged , | Leave a comment

SED: insert text at the top of a bunch of files

at a line at the top of a file Imagine, you have a set of files ending in .txt, and you want to add the statement #header at the top of each of them. Then, simply type: ls *.txt | … Continue reading

Posted in Linux | Tagged | Leave a comment

quick SVN tutorial for end-users

There are lots of resources on the web about SVN. so, this page is just a quick summary of the 4-5 commands you will need to start with. The following commands are for linux users (and therefore Mac users who … Continue reading

Posted in Computer Science | Tagged | Leave a comment

Tkinter missing dependency

Under Fedora 17, I did an import of Tkinter package but got this error in a python shell: Traceback (most recent call last): File "slider-demo-1.py", line 1, in <module> from Tkinter import * File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 39, in <module> import … Continue reading

Posted in Linux, Python | Tagged | Leave a comment

Bioconductor: first installation

Bioconductor is a website that gathers open source software for bioinformatics in the R language. You can install a Bioconductor package using their interface. As an example, let us install the RBGL package. First, start a R session, and then … Continue reading

Posted in R | Leave a comment

Installing JPype to use Java from Python

JPype is a Python package that allows you to call Java from Python. First, download the zip file (I got version 0.5.4.2). I will use a virtual environment here, so the syntax is simply: cd /home/user/Downloads # path where the … Continue reading

Posted in Linux, Python | Tagged , , , | 4 Comments

How to get processor information (linux)

Simply type cat /proc/cpuinfocat /proc/cpuinfo You can also try cat /proc/meminfocat /proc/meminfo

Posted in Linux | Tagged | Leave a comment

Fedora 17: post installation

Fedora 16 crashed after an update. Good time for a fresh installation of Fedora 17. The installation process provides most of the basic tools (browser, editor…) but some favorites are missing… Here is what I did for the post installation … Continue reading

Posted in Linux | Tagged | Leave a comment

Upgrading R and rpy2

When upgrading R version, you must recompile rpy2. Let us take a case study based on the upgrade of R2.15 to R2.15.1. First, you need to download the source from the main page http://www.r-project.org/ Once downloaded, get the source tar … Continue reading

Posted in Computer Science | Tagged , | Leave a comment