Wednesday, October 31, 2012

How to compile PeakSplitter on Mac OS10

If you try to run MACS by typing macs14 command into the terminal with the --call-subpeaks option you will get an output that you need to install the PeakSplitter first:

ERROR:root:PeakSplitter can not be accessed through the command line!
ERROR:root:OS gave me this error message: [Errno 2]: No such file or directory
ERROR:root:Please download PeakSplitter from <http://www.ebi.ac.uk/bertone/software/PeakSplitter_Cpp.tar.gz>.
ERROR:root:After you download and unzip it, read the instruction at <http://www.ebi.ac.uk/bertone/software/PeakSplitter_Cpp_usage.txt>
ERROR:root:Install PeakSplitter so that you can access it through typing 'PeakSplitter' under the command line.


So Download the PeakSplitter from http://www.ebi.ac.uk/bertone/software/PeakSplitter_Cpp.tar.gz

However on Mac OS 10.8 if you try to follow the instructions from the readme file:

1. Open up a command terminal, go to the directory "PeakSplitter_v1" where you have uncompressed PeakSplitter.

2. Within this directory, go to "SFL/Release" directory and run the makefile using
make (or make -f makefile)

3. Return to the directory "PeakSplitter_v1", then go to the "Zlib/Release" directory and run the makefile
make (or make -f makefile)

4. Now you are ready to install PeakSplitter. Return to the directory "PeakSplitter_v1", and run the makefile
make (or make -f makefile)
An executable file named "PeakSplitter" will be generated in this folder.


You will find that Zlib will be compiled, but SFL cannot be compiled. The outcoming message will be:

Building file: ../sflbits.c
Invoking: GCC C Compiler
gcc -D__UNIX__ -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"sflbits.d" -MT"sflbits.d" -o"sflbits.o" "../sflbits.c"
In file included from ../sflbits.c:16:
../prelude.h:401:9: error: #error "Cannot compile: must change definition of 'qbyte'."
make: *** [sflbits.o] Error 1


I found on MACS announcments google group the following solution to the problem:
https://groups.google.com/forum/?fromgroups=#!topic/macs-announcement/V2d8HdCJmRA

So, download the three files, sfl.h, prelude.h and sflprint.h and replace them (they are located in SFL folder).
Then:
make clean
make

Now if you try to compile PeakSplitter in the PeakSplitter_v1 folder you will get the error message:

Building file: SplitPeaks/BedGraphParser.cpp
Invoking: GCC C++ Compiler
g++ -D__UNIX__ -I./SplitPeaks -I./SFL -I./Zlib -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"BedGraphParser.d" -MT"BedGraphParser.d" -o"BedGraphParser.o" "SplitPeaks/BedGraphParser.cpp"
In file included from SplitPeaks/BedGraphParser.h:2,
                 from SplitPeaks/BedGraphParser.cpp:1:
SplitPeaks/Shared.h:3:1: warning: "__UNIX__" redefined
<command-line>: warning: this is the location of the previous definition
In file included from /usr/include/c++/4.2.1/backward/iostream.h:31,
                 from ./SFL/sfl.h:236,
                 from SplitPeaks/Shared.h:17,
                 from SplitPeaks/BedGraphParser.h:2,
                 from SplitPeaks/BedGraphParser.cpp:1:
/usr/include/c++/4.2.1/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <iostream> instead of the deprecated header <iostream.h>. To disable this warning use -Wno-deprecated.
In file included from SplitPeaks/BedGraphParser.cpp:1:
SplitPeaks/BedGraphParser.h:12: error: extra qualification ‘BedGraphParser::’ on member ‘nextPosition’
make: *** [BedGraphParser.o] Error 1


So, open the BedGraphParser.h file:
nano BedGraphParser.h

and delete the BedGraphParser::
from the line
wigPosition* BedGraphParser::nextPosition();

so that it looks like:
wigPosition* nextPosition();

Now if you try to compile it should work fine.

Tuesday, October 30, 2012

How to make Bowtie read gziped files

Unlike Bowtie2,  Bowtie cannot read gzip files. So if you are not using Bowtie2, but Bowtie, use mkfifo so Bowtie can read gz files:

mkfifo file1.fifo
mkfifo file2.fifo
gunzip -c file1.gz > file1.fifo &
gunzip -c file2.gz > file2.fifo &
bowtie -1 file1.fifo -2 file2.fifo

Monday, October 29, 2012

Lets store our photos in our DNA

In the future we will translate our data, our notes, diaries, and most importantly our favorite photos and videos into the binary code and then embed it into the junk part of our DNA (which is most probably non-functional so no harm to the cell). T and G = 1, A and C = 0 (from the article, shouldn't it be A and T vs G and C as these are the base pairs). Thus if we lose the hard disk with our photos, we will just extract the DNA from our cell/s and sequence it and get our data back.
Even better we will transfer this data to our offspring (if we modify our germ cells), thus the future generations will have our photos/videos in their DNA.

Researches embedded 700 terabytes of data into DNA

Link:
http://www.extremetech.com/extreme/134672-harvard-cracks-dna-storage-crams-700-terabytes-of-data-into-a-single-gram

Thursday, October 25, 2012

How to open Lacie external drive (Design Sam Hecht)

I have a Lacie external hard drive that stopped working recently. When I plugged it in it couldn't mount. I suspected the cable that you could pull out got damaged.

How to open it.

Take thin and flat knife. Slide the knife into the case just above the sign Design Sam Hecht.

There are two plastic tabs, one above the Sam Hecht sign and another on the opposite side, that are glued in place and you have brake these bonds with a knife but try not to damage the drive in the interior of the casing.

Pull out the interior of the casing.


















Take the screws out and release the SATA 2.5 inches hard drive that you can put in another casing or in
your laptop.








As you can see on the photo the internal cable was damaged but the drive itself was ok.



Thursday, October 4, 2012

How to checksum a file

If you need to submit sequencing or array raw or processed files to the GEO database (or some other database) you will be asked to provide checksum for the files you are uploading. This is needed to be sure that the files are transmitted correctly since if there was an error in the transmission the transmitted files will give a different checksum than the one you provided.

Open terminal.
Type md5 
followed by the name of the file

e.g.
md5 assemblies.txt
you will get an output like this:
MD5 (assemblies.txt) = c70fe79c7688ca69742c5ba4e11c3de0
Copy the code.

Wednesday, October 3, 2012

Problem with loading data into CummeRbund in R

If you have performed RNA-Seq pipeline using Topahat/Bowtie, Cufflinks, Cuffmerge, Cuffdiff and you are trying to load your data into CummeRbund package for R for visualization, you may get the following output:

> library(cummeRbund)
Loading required package: RSQLite
Loading required package: DBI
Loading required package: ggplot2
Loading required package: reshape2
 

> cuff_data <- readCufflinks('diff_out')
Creating database diff_out/cuffData.db
Error in sqliteNewConnection(drv, ...) :
  RS-DBI driver: (could not connect to dbname:
unable to open database file
)


The problem may seem difficult to solve but actually you haven't set the correct working directory.
Do:
getwd()
to get the working directory,
and the setwd() 
to set the working directory.

You have to set the working directory where your diff_out folder is! But not the diff_out folder itself!