Thursday, September 27, 2012

How to create symbolic links to files in UNIX

If you have files in a distant folder and you don't want to type their path in terminal when you want to call them make their symbolic links in the current folder:

E.g. for the file /Users/mpjanic/Documents/mm9 genome - Illumina iGenome/Mus_musculus/UCSC/mm9/Annotation/Genes/genes.gtf

use the command ln -s to make the symbolic link
type the path of the file and the file name
and the . to mark the current folder where you want to make the link (or path to any other folder where you want the link to be created)

ln -s /Users/mpjanic/Documents/mm9\ genome\ -\ Illumina\ iGenome/Mus_musculus/UCSC/mm9/Annotation/Genes/genes.gtf .

You can also do the following if you want to make links to multiple files:
 ln -s /Users/mpjanic/Documents/mm9\ genome\ -\ Illumina\ iGenome/Mus_musculus/UCSC/mm9/Sequence/BowtieIndex/genome.* .

All the genome.* files will be linked to the current folder.

Wednesday, September 26, 2012

How to add colors to terminal in Mac OS 10

Open terminal
nano profile 

Paste the following text:
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced


CTRL X to exit Nano, Y to save
source profile

Type source profile every time you open terminal.

How to quickly download Illumina iGenomes

To use Tophat/Cufflinks/Cuffdiff/Cummerbund you might need to download iGenomes from Illumina.
They can be found on the Tophat website http://tophat.cbcb.umd.edu/igenomes.html

But if you try to download human or mouse iGenomes (approximately 20Gb and 15Gb, respectively) through a browser the downloaded will start and then most probably it will block after some time.

Connect to the Illumina ftp server:

Either use terminal (Type in what is in bold, example: I downloaded mouse genome mm9):

C02HQ105DHJQ:~ mpjanic$ ftp
ftp> open ussd-ftp.illumina.com
Connected to ussd-ftp.illumina.com.
220 EFT Server 6.4.1 Build 12.19.2011.1
Name (ussd-ftp.illumina.com:mpjanic): igenome
331 Password required for igenome.
Password: G3nom3s4u
230 Login OK. Proceed.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> pwd
Remote directory: /
ftp> cd Mus_musculus
250 Folder changed to "/Mus_musculus".
ftp> ls
229 Entering Extended Passive Mode (|||56930|).
150 Opening ASCII mode data connection for file list.
dr-xr--r--   1 user     group           0 May 11 14:00 Ensembl
dr-xr--r--   1 user     group           0 May 11 14:34 NCBI
dr-xr--r--   1 user     group           0 May 24 11:09 UCSC
226 Transfer complete. 186 bytes transferred. 186 bps.
ftp> cd UCSC
250 Folder changed to "/Mus_musculus/UCSC".
ftp> ls
229 Entering Extended Passive Mode (|||56960|).
150 Opening ASCII mode data connection for file list.
dr-xr--r--   1 user     group           0 May 16 16:44 mm9
dr-xr--r--   1 user     group           0 Jun 14 17:03 mm10
226 Transfer complete. 121 bytes transferred. 121 bps.
ftp> cd mm9
250 Folder changed to "/Mus_musculus/UCSC/mm9".
ftp> ls
229 Entering Extended Passive Mode (|||56962|).
150 Opening ASCII mode data connection for file list.
-r--r--r--   1 user     group 15244063347 May 14 21:12 Mus_musculus_UCSC_mm9.tar.gz
226 Transfer complete. 85 bytes transferred. 85 bps.
ftp> get Mus_musculus_UCSC_mm9.tar.gz
local: Mus_musculus_UCSC_mm9.tar.gz remote: Mus_musculus_UCSC_mm9.tar.gz
229 Entering Extended Passive Mode (|||56986|).
150 Opening BINARY mode data connection for Mus_musculus_UCSC_mm9.tar.gz.
  1% |*                                                                                                                  |   180 MiB  590.63 KiB/s  6:54:51 ETA^Z

So the speed was around 500 KB/s 
However, much faster way is to use Filezilla.

Install Filezilla
Host: ussd-ftp.illumina.com
Username: igenome
Password: G3nom3s4u

Navigate to the local folder in left where you want to download.
Navigate to the folder where mm9 genome is (or the genome of your interest).

Right click, Download 

The speed was in a range 2-3 Mb/s!

Tuesday, September 25, 2012

How to make 'make' command working in Mac OS 10.8

In Mac OS 10.8 I tried to use 'make' command in terminal but it didn't work, I got: 'command not found'.

How to make 'make' work on Mac OS:

Go to the App store,
Login,
Install XCode 4.5

After this go to Xcode/Preferences/Downloads/Components
Install Command line tools

Open Terminal
type make -v
If it works you will get the output:


GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.