{"id":14,"date":"2016-05-23T15:11:11","date_gmt":"2016-05-23T14:11:11","guid":{"rendered":"http:\/\/staff.um.edu.mt\/jebej02\/blog\/?p=14"},"modified":"2020-08-25T11:00:14","modified_gmt":"2020-08-25T09:00:14","slug":"installing-cufflinks-rnaseq-on-ubuntu","status":"publish","type":"post","link":"https:\/\/bitsilla.com\/blog\/2016\/05\/installing-cufflinks-rnaseq-on-ubuntu\/","title":{"rendered":"Installing Cufflinks (RNA-Seq) on Ubuntu"},"content":{"rendered":"<p>So, you have a ton of hard-disks spinning with RNA Seq data you need to analyse? Excellent. But first you need some software to do that. This post follows the nature protocol described by Trapnell et el. described <a href=\"http:\/\/www.nature.com\/nprot\/journal\/v7\/n3\/full\/nprot.2012.016.html\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a> (something freely accessible from nature publishing group &#8211; must be my lucky day today).<\/p>\n<p><!--more--><\/p>\n<h1>Boost Libraries<\/h1>\n<p>First, you will need boost libraries installed. \u00a0You might be tempted to do this via <code>sudo apt-install libboost-all-dev<\/code>, you lazy&#8230; That is a terrible idea in this instance. You may miss this little note of relevance: <strong>WARNING: Due to a serious issue with Boost Serlialization [sic] library introduced in version 1.56, Cufflinks currently can Boost Librariesonly be built with Boost version 1.55 or lower. The issue is expected to be fixed in the upcoming Boost v1.59.<\/strong>. Guess what version is installed by apt-get in Ubuntu 16.04 LTS? Yeah, 1.58. Bad luck bro.<\/p>\n<p>Download the latest version of the boost libraries from <a href=\"https:\/\/sourceforge.net\/projects\/boost\/files\/boost\/\" target=\"_blank\" rel=\"noopener noreferrer\">sourceforge<\/a> (sourceforge in 2016!, wait let me send a Fax with a complaint). Installing this is relatively straightforward nowadays. Here is what you should do (<code>$<\/code> is the bash prompt, you don&#8217;t need that)<\/p>\n<pre class=\"toolbar:2 lang:sh decode:true\">$ tar zxvf boost_1_61_0.tar.gz\n$ cd boost_1_61_0\n$ .\/bootstrap.sh --prefix=\/opt\/boost_1_61_0\n$ .\/b2                                     \n$ sudo .\/b2 install<\/pre>\n<p>The prefix will define where to install the boost libraries. It is critical to define this, so all the installations are contained (and easily removed\/updated). Also, you will need to add these to lines to <code>~\/.profile<\/code>.<\/p>\n<pre class=\"toolbar:2 lang:sh decode:true\">export BOOST_ROOT=\/opt\/boost_1_61_0\nexport LD_LIBRARY_PATH=$BOOST_ROOT\/lib:$LD_LIBRARY_PATH<\/pre>\n<p>Make sure to re-source the file after you make these changes (either reopen the terminal or <code>source ~\/.profile<\/code>)<\/p>\n<h1>Bowtie2<\/h1>\n<p>Next in our install list, is bowtie2 &#8211; a short sequence aligner. Download the latest version from <a href=\"https:\/\/sourceforge.net\/projects\/bowtie-bio\/files\/bowtie2\/2.2.9\/\" target=\"_blank\" rel=\"noopener noreferrer\">sourceforge<\/a> (arrgghhh what is wrong with you bioinf people?!). Note that you need to download the <strong>source<\/strong> version (as we are going to build the binaries ourselves).<\/p>\n<pre class=\"toolbar:2 lang:sh decode:true \">$ unzip bowtie2-2.2.9-source.zip\n$ sudo apt-get install libtbb-dev\n$ cd bowtie2-2.2.9\n$ make WITH_TBB=1\n$ cd ..\n$ sudo mv bowtie2-2.2.9 \/opt<\/pre>\n<p>The tbb library is a threading library which offers shorter running times on multi-core architectures. <code>make WITH_TBB=1<\/code> will compile binaries which make use of this library. Some more detailed instructions can be found in the user <a href=\"http:\/\/bowtie-bio.sourceforge.net\/bowtie2\/manual.shtml#building-from-source\" target=\"_blank\" rel=\"noopener noreferrer\">manual<\/a>.<\/p>\n<h1>TopHat<\/h1>\n<p>TopHat uses Bowtie for read alignment but adds the ability to align spliced juctions. Nowadays TopHat is superseded by (more efficient and accurate) HiSat2, but the protocol described by Trapnell et al. still uses this. Download the latest release of <a href=\"https:\/\/ccb.jhu.edu\/software\/tophat\/downloads\/tophat-2.1.1.tar.gz\" target=\"_blank\" rel=\"noopener noreferrer\">TopHat<\/a> (presently version 2.1.1).<\/p>\n<pre class=\"toolbar:2 lang:sh decode:true\">$ tar xzvf tophat-2.1.1.tar.gz\n$ cd tophat-2.1.1\n$ .\/configure --prefix \/opt\/tophat-2.1.1 --with-boost=\/opt\/boost_1_61_0\n$ make\n$ sudo make install<\/pre>\n<h2>Testing TopHat\/Bowtie<\/h2>\n<p>Download the <a href=\"https:\/\/ccb.jhu.edu\/software\/tophat\/downloads\/test_data.tar.gz\" target=\"_blank\" rel=\"noopener noreferrer\">test data<\/a> and execute the following commands:<\/p>\n<pre class=\"toolbar:2 lang:sh decode:true\">$ tar zxvf test_data.tar.gz\n$ cd test_data\n$ tophat -r 20 test_ref reads_1.fq reads_2.fq<\/pre>\n<p>You should see the words <em>Run complete: 00:00:00 elapsed<\/em> if the test case ran successfully.<\/p>\n<h1>SAM tools<\/h1>\n<p>Cufflinks requires <a href=\"http:\/\/samtools.sourceforge.net\/\" target=\"_blank\" rel=\"noopener noreferrer\">SAM tools<\/a> to be installed (yet another dependency, and sourceforge once again). This requires some tinkering around to get it to work. <strong>Warning: Do not go for the latest version (from github) of SAMTools as this will not work with the current version of cufflinks.<\/strong> Version 0.1.19 works with cufflinks 2.2.1. Also, there is a note that htslib is now more accurate and efficient, please ignore.<\/p>\n<pre class=\"toolbar:2 lang:sh decode:true\">$ tar xjvf samtools-0.1.19.tar.bz2\n$ cd samtools-0.1.19\n$ make\n$ sudo mkdir -p \/opt\/samtools-0.1.19\/bin \/opt\/samtools-0.1.19\/include\/bam \/opt\/samtools-0.1.19\/lib\n$ sudo cp libbam.a \/opt\/samtools-0.1.19\/lib\n$ sudo cp *.h \/opt\/samtools-0.1.19\/include\/bam<\/pre>\n<h1>Cufflinks<\/h1>\n<p>First you need to install the Eigen library. \u00a0You may be again tempted to do this via <code>apt-get install<\/code>. This didn&#8217;t work for me (building cufflinks comet vomits on Eigen). My installation works with version Eigen v3.2.8. Safe to download from <a href=\"https:\/\/gitlab.com\/libeigen\/eigen\/-\/archive\/3.2.8\/eigen-3.2.8.zip\" target=\"_blank\" rel=\"noopener noreferrer\">the Eigen repo<\/a> and install it in the following manner.<\/p>\n<pre class=\"toolbar:2 lang:sh decode:true\">$ tar xjvf 3.2.8.tar.bz2\n$ cd eigen-eigen-07105f7124f9\n$ sudo mkdir \/opt\/eigen3\n$ sudo cp -rv .\/Eigen \/opt\/eigen3\n$ export EIGEN_CPPFLAGS=\"-I\/opt\/eigen3\"<\/pre>\n<p>The <code>--with-eigen=<\/code> configure option does not work (annoyingly) which is why you need to set <code>EIGEN_CPPFLAGS<\/code> to the Eigen3 location.<\/p>\n<p>Download the latest version of Cufflinks (from <a href=\"http:\/\/cole-trapnell-lab.github.io\/cufflinks\/install\/\" target=\"_blank\" rel=\"noopener noreferrer\">github<\/a>, finally). The current version is 2.2.1. Then:<\/p>\n<pre class=\"toolbar:2 lang:sh decode:true\">$ tar xzvf cufflinks-2.2.1.tar.gz\n$ cd cufflinks-2.2.1\n$ .\/configure --prefix=\/opt\/cufflinks-2.2.1 --with-boost=\/opt\/boost_1_61_0 --with-bam=\/opt\/samtools-0.1.19\n$ make \n$ sudo make install<\/pre>\n<p>This will take a while. After it finishes you now need to set some more environment variables in your <code>~\/.profile<\/code>. <code>BOOST_ROOT<\/code> should have already been set in a previous step (somewhere above).<\/p>\n<pre class=\"toolbar:2 lang:sh decode:true\">export BOOST_ROOT=\/opt\/boost_1_61_0\nexport SAMTOOLS=\/opt\/samtools-0.1.19\nexport LD_LIBRARY_PATH=$BOOST_ROOT\/lib:$SAMTOOLS\/lib:$LD_LIBRARY_PATH\nexport RNA_SEQ_TOOLS=\/opt\/bowtie2-2.2.9:\/opt\/tophat-2.1.1\/bin:$SAMTOOLS\/bin:\/opt\/cufflinks-2.2.1\/bin\nexport PATH=.:$RNA_SEQ_TOOLS:$PATH<\/pre>\n<p>Remember you need to <code>source ~\/.profile<\/code> after these changes.<\/p>\n<h2>Testing Cufflinks<\/h2>\n<p>Download the cufflinks <a href=\"https:\/\/raw.githubusercontent.com\/cole-trapnell-lab\/cufflinks\/master\/doc\/html\/downloads\/test_data.sam\" target=\"_blank\" rel=\"noopener noreferrer\">test file<\/a>. Now from the directory where you saved the file run <code>cufflinks .\/test_data.sam<\/code>. This will create some console output and a file called <code>transcripts.gtf<\/code> (this should have some exons if you <code>cat transcripts.gtf<\/code>).<\/p>\n<p>Hope you made it this far in considerable less time than myself. \u00a0It took me close to two days to set me up with cufflinks &#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So, you have a ton of hard-disks spinning with RNA Seq data you need to analyse? Excellent. But first you need some software to do that. This post follows the nature protocol described by Trapnell et el. described here (something freely accessible from nature publishing group &#8211; must be my lucky day today).<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-14","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pap6Kd-e","_links":{"self":[{"href":"https:\/\/bitsilla.com\/blog\/wp-json\/wp\/v2\/posts\/14","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bitsilla.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bitsilla.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bitsilla.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bitsilla.com\/blog\/wp-json\/wp\/v2\/comments?post=14"}],"version-history":[{"count":1,"href":"https:\/\/bitsilla.com\/blog\/wp-json\/wp\/v2\/posts\/14\/revisions"}],"predecessor-version":[{"id":602,"href":"https:\/\/bitsilla.com\/blog\/wp-json\/wp\/v2\/posts\/14\/revisions\/602"}],"wp:attachment":[{"href":"https:\/\/bitsilla.com\/blog\/wp-json\/wp\/v2\/media?parent=14"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bitsilla.com\/blog\/wp-json\/wp\/v2\/categories?post=14"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bitsilla.com\/blog\/wp-json\/wp\/v2\/tags?post=14"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}