As the doctor gone rogue

February 20, 2014

A note on getting start with samtools on Mac OsX 10.8.5 Mountain Lion

Filed under: NGS — Tags: , , , , — hypotheses @ 9:50 pm

samtools is a handy tool for sequence alignment and mapping (

For more information, please refer to the original article here:

  • Li H.*, Handsaker B.*, Wysoker A., Fennell T., Ruan J., Homer N., Marth G., Abecasis G., Durbin R. and 1000 Genome Project Data Processing Subgroup (2009) The Sequence alignment/map (SAM) format and SAMtools. Bioinformatics, 25, 2078-9. [PMID: 19505943]

To get it to work on mac, I’ve decided to compile it.

First, get the sourcecode from

Then, decompress the files in ~/bin

Compile it as usual

make install

You might need to have administrative right to write to system folder as well.

Next, we'll need to add a path to ~/.bash_profile

Include this in ~/.bash_profile to point to SAMTOOLS_HOME

export SAMTOOLS_HOME=~/bin/samtools-0.1.19
export PATH=$SAMTOOLS_HOME/bcftools/:$PATH

Now, samtools should be ready for you to use.

Download files from a webpage with wget.

Filed under: bash — Tags: , , — hypotheses @ 9:15 pm

Recently phylotree just release another update of mitochndrial phylogentic trees (19Feb2014). Besides the updated tree, a very nice feature of website is that they have a great curation of mitochondrial sequences publicly available for download. You can check out their website here

If you have a curious mind, you may want to download all the sequences, construct your own trees or use the data to do something else creatively.

In this case wget might be your best friends, although you might be able to write a python script to do something similar.

 wget -r --accept "*.ext" --level 2

As a reminder, if you are behind a proxy firewall, take a look at my previous post


February 6, 2014

Converting virtual machine raw image .img to vmdk

Filed under: bash, Virtual Machine — Tags: , — hypotheses @ 11:26 am

OK, you got “.img” virtual machine image. Now what?
Diving in VMWare, Oracle Virutal Machine, etc, etc, there is not a shadow of the option to choose “new virutal machine” from .img image.

What should I do?

1. Download Qemu (ported version for OSX)

2. After installing it on Mac (works fine for me on Maverick),

cd /Application/
./qemu-img convert -f raw -O vmdk /Volumes/xxx/rawdisk200gb.img /Volumes/xxx/vdisk200gb.vmdk

3. Next, open up vmware to create a new virtual machine.
4. Choose continue without disk > choose an existing virtual disk
5. Follow the instruction to start up your new machine 🙂

Thanks to for written up the solution for mac.

Create a free website or blog at