{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# A. Introduction"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Cell growth and proliferation are two processes that should be harmonized to ensure that two daughter cells after mitosis can gain an appropriate cell mass. In healthy cells, tumor suppressors function as monitors for cell homeostasis and prevent uncontrolled proliferation and illegitimate cell survival. Excessive oncogenic signalling results in the activation of these genes which lead to senescence or apoptosis. During neoplastic transformation, however, these tumor suppressor genes are inactivated through mutations or epigenetic modifications. Consequently, oncogenes drive cells into dysregulated cell growth and proliferation, altered metabolism and invasion into adjacent tissues.\n",
    "\n",
    "p53 is a tumor suppressor which can block the growth and proliferation of malignant cells mainly via cell-cycle arrest, senescence and apoptosis, depending on the imposed stressor and its severity. Furthermore, it has been shown that p53 is sufficient to drive cells into a quiescent cell state. Cellular concentration and activity of p53 are kept low in healthy cells mainly by its E3 ubiquitin ligase MDM2. p53 stimulates the transcription of MDM2, which ubiquitylates p53 in return resulting in proteasome-mediated degradation. When cells are exposed to oncogenic stress or undergo DNA-damage, p53 is activated through post-translational modifications or binding and inactivation of MDM2 by modulator proteins. Activated p53 tetramers can function as a transcription factor that activates transcription of many genes including cell cycle and proliferation-related genes, which is supposed to be the main mechanism of p53’s tumor suppressive functions. Besides transactivation, p53 can also exert its response via transcriptional repression and interaction with other transcription factors. \n",
    "\n",
    "Cellular quiescence and senescence are two distinct cellular states. Senescence is an irreversible process, whereby cells lose their proliferative potential and cannot return to active cell cycle stages (G1, S or G2) to prepare for further divisions. Cells under oncogenic stress, undergoing DNA-damage or aging cells are kept in this stage and their degenerative character ensures a certain cell death. In contrast, quiescence ensures a reversible, non-proliferating state, whereby cells are maintained temporarily in the G0 stage. Adult stem cells and cells lacking nutrition and/or growth factor signals are arrested in this stage. They can be reactivated under particular physiological process (e.g. tissue repair) or when the stress situation is cleared.\n",
    "\n",
    "As briefly mentioned above, p53 constitutes a key protein in cell fate decision. In recent years, another important player has emerged that aids in the decision between quiescent or senescent phenotypes. Several reports have described that the status of the mechanistic target of rapamycine (mTOR) pathway, at least in part, acts as a molecular switch that determines the choice between senescence and quiescence in p53-arrested cells. In short, while maximal activation of p53 blocks mTOR and leads to quiescence, partial p53 activation causes mTOR preservation and subsequently senescence. In addition to p53 and mTOR pathways, it has been suggested that an Rb-E2F bistable switch plays a pivotal role in controlling the proliferation-quiescence balance. E2F proteins regulate a large battery of target genes involved in DNA replication and cell cycle progression.\n",
    "\n",
    "This project is based on the following paper:\n",
    "\n",
    "Loayza-Puch F, Drost J, Rooijers K, Lopes R, Elkon R, Agami R (2013) p53 induces transcriptional and translational programs to suppress cell proliferation and growth. Genome Biol. 14:R32\n",
    "\n",
    "Raw sequencing data was retrieved from the NCBI GEO database (GSE45833). Because of space restrictions we limited our downstream analyses to a single experimental condition, comparing normal proliferating cells (GSM1041191 C1.rna and GSM1041192 C2.rna) to quiescent cells (GSM1041193 Q1.rna and GSM1041194 Q2.rna) induced by serum depletion. Here we sought to define an expression signature and gene regulatory network that governs the quiescent cell state. Our main notebook as well as our notebook with an R-session that we used for differential gene expression analysis can be found under /mnt/storage/r0259859/jupyternotebooks/Exam 2016-2017.\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# B. Workflow"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<img width=\"70%\" src=\"/user/r0259859/files/Exam 2016-2017/Workflow.png\">"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# C. RNA-Seq analysis"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "All files related to this chapter can be found under /mnt/storage/r0259859/work/RNAseq."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 1. Converting SRR files to fastq files"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": []
    }
   ],
   "source": [
    "mkdir -p ~/data/work && cd ~/data/work"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": []
    }
   ],
   "source": [
    "vdb-config -s /repository/user/main/public/root=~/data/ncbi"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "total 0\r\n"
     ]
    }
   ],
   "source": [
    "mkdir -p ~/data/work/RNAseq\n",
    "cd ~/data/work/RNAseq\n",
    "ls -l"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Read 26181799 spots for SRR627536\r\n",
      "Written 26181799 spots for SRR627536\r\n"
     ]
    }
   ],
   "source": [
    "fastq-dump --split-files SRR627536"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 110,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Read 28243869 spots for SRR627537\r\n",
      "Written 28243869 spots for SRR627537\r\n"
     ]
    }
   ],
   "source": [
    "fastq-dump --split-files SRR627537"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Read 25495010 spots for SRR627538\r\n",
      "Written 25495010 spots for SRR627538\r\n"
     ]
    }
   ],
   "source": [
    "fastq-dump --split-files SRR627538"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 111,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Read 27075925 spots for SRR627539\r\n",
      "Written 27075925 spots for SRR627539\r\n"
     ]
    }
   ],
   "source": [
    "fastq-dump --split-files SRR627539"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": []
    }
   ],
   "source": [
    "mv SRR627536_1.fastq Control1_1.fastq\n",
    "mv SRR627536_2.fastq Control1_2.fastq\n",
    "mv SRR627538_1.fastq Quiescence_1.fastq\n",
    "mv SRR627538_2.fastq Quiescence_2.fastq\n",
    "mv SRR627537_1.fastq Control2_1.fastq\n",
    "mv SRR627537_2.fastq Control2_2.fastq\n",
    "mv SRR627539_1.fastq Quiescence2_1.fastq\n",
    "mv SRR627539_2.fastq Quiescence2_2.fastq"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 2. Quality control using FastQC"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Started analysis of Control1_1.fastq\r\n",
      "Approx 5% complete for Control1_1.fastq\r\n",
      "Approx 10% complete for Control1_1.fastq\r\n",
      "Approx 15% complete for Control1_1.fastq\r\n",
      "Approx 20% complete for Control1_1.fastq\r\n",
      "Approx 25% complete for Control1_1.fastq\r\n",
      "Approx 30% complete for Control1_1.fastq\r\n",
      "Approx 35% complete for Control1_1.fastq\r\n",
      "Approx 40% complete for Control1_1.fastq\r\n",
      "Approx 45% complete for Control1_1.fastq\r\n",
      "Approx 50% complete for Control1_1.fastq\r\n",
      "Approx 55% complete for Control1_1.fastq\r\n",
      "Approx 60% complete for Control1_1.fastq\r\n",
      "Approx 65% complete for Control1_1.fastq\r\n",
      "Approx 70% complete for Control1_1.fastq\r\n",
      "Approx 75% complete for Control1_1.fastq\r\n",
      "Approx 80% complete for Control1_1.fastq\r\n",
      "Approx 85% complete for Control1_1.fastq\r\n",
      "Approx 90% complete for Control1_1.fastq\r\n",
      "Approx 95% complete for Control1_1.fastq\r\n",
      "Analysis complete for Control1_1.fastq\r\n"
     ]
    }
   ],
   "source": [
    "/usr/local/bin/FastQC/fastqc Control1_1.fastq"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Started analysis of Control1_2.fastq\r\n",
      "Approx 5% complete for Control1_2.fastq\r\n",
      "Approx 10% complete for Control1_2.fastq\r\n",
      "Approx 15% complete for Control1_2.fastq\r\n",
      "Approx 20% complete for Control1_2.fastq\r\n",
      "Approx 25% complete for Control1_2.fastq\r\n",
      "Approx 30% complete for Control1_2.fastq\r\n",
      "Approx 35% complete for Control1_2.fastq\r\n",
      "Approx 40% complete for Control1_2.fastq\r\n",
      "Approx 45% complete for Control1_2.fastq\r\n",
      "Approx 50% complete for Control1_2.fastq\r\n",
      "Approx 55% complete for Control1_2.fastq\r\n",
      "Approx 60% complete for Control1_2.fastq\r\n",
      "Approx 65% complete for Control1_2.fastq\r\n",
      "Approx 70% complete for Control1_2.fastq\r\n",
      "Approx 75% complete for Control1_2.fastq\r\n",
      "Approx 80% complete for Control1_2.fastq\r\n",
      "Approx 85% complete for Control1_2.fastq\r\n",
      "Approx 90% complete for Control1_2.fastq\r\n",
      "Approx 95% complete for Control1_2.fastq\r\n",
      "Analysis complete for Control1_2.fastq\r\n"
     ]
    }
   ],
   "source": [
    "/usr/local/bin/FastQC/fastqc Control1_2.fastq"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Started analysis of Quiescence_1.fastq\r\n",
      "Approx 5% complete for Quiescence_1.fastq\r\n",
      "Approx 10% complete for Quiescence_1.fastq\r\n",
      "Approx 15% complete for Quiescence_1.fastq\r\n",
      "Approx 20% complete for Quiescence_1.fastq\r\n",
      "Approx 25% complete for Quiescence_1.fastq\r\n",
      "Approx 30% complete for Quiescence_1.fastq\r\n",
      "Approx 35% complete for Quiescence_1.fastq\r\n",
      "Approx 40% complete for Quiescence_1.fastq\r\n",
      "Approx 45% complete for Quiescence_1.fastq\r\n",
      "Approx 50% complete for Quiescence_1.fastq\r\n",
      "Approx 55% complete for Quiescence_1.fastq\r\n",
      "Approx 60% complete for Quiescence_1.fastq\r\n",
      "Approx 65% complete for Quiescence_1.fastq\r\n",
      "Approx 70% complete for Quiescence_1.fastq\r\n",
      "Approx 75% complete for Quiescence_1.fastq\r\n",
      "Approx 80% complete for Quiescence_1.fastq\r\n",
      "Approx 85% complete for Quiescence_1.fastq\r\n",
      "Approx 90% complete for Quiescence_1.fastq\r\n",
      "Approx 95% complete for Quiescence_1.fastq\r\n",
      "Approx 100% complete for Quiescence_1.fastq\r\n",
      "Analysis complete for Quiescence_1.fastq\r\n"
     ]
    }
   ],
   "source": [
    "/usr/local/bin/FastQC/fastqc Quiescence_1.fastq"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Started analysis of Quiescence_2.fastq\r\n",
      "Approx 5% complete for Quiescence_2.fastq\r\n",
      "Approx 10% complete for Quiescence_2.fastq\r\n",
      "Approx 15% complete for Quiescence_2.fastq\r\n",
      "Approx 20% complete for Quiescence_2.fastq\r\n",
      "Approx 25% complete for Quiescence_2.fastq\r\n",
      "Approx 30% complete for Quiescence_2.fastq\r\n",
      "Approx 35% complete for Quiescence_2.fastq\r\n",
      "Approx 40% complete for Quiescence_2.fastq\r\n",
      "Approx 45% complete for Quiescence_2.fastq\r\n",
      "Approx 50% complete for Quiescence_2.fastq\r\n",
      "Approx 55% complete for Quiescence_2.fastq\r\n",
      "Approx 60% complete for Quiescence_2.fastq\r\n",
      "Approx 65% complete for Quiescence_2.fastq\r\n",
      "Approx 70% complete for Quiescence_2.fastq\r\n",
      "Approx 75% complete for Quiescence_2.fastq\r\n",
      "Approx 80% complete for Quiescence_2.fastq\r\n",
      "Approx 85% complete for Quiescence_2.fastq\r\n",
      "Approx 90% complete for Quiescence_2.fastq\r\n",
      "Approx 95% complete for Quiescence_2.fastq\r\n",
      "Approx 100% complete for Quiescence_2.fastq\r\n",
      "Analysis complete for Quiescence_2.fastq\r\n"
     ]
    }
   ],
   "source": [
    "/usr/local/bin/FastQC/fastqc Quiescence_2.fastq"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 115,
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Started analysis of Control2_1.fastq\r\n",
      "Approx 5% complete for Control2_1.fastq\r\n",
      "Approx 10% complete for Control2_1.fastq\r\n",
      "Approx 15% complete for Control2_1.fastq\r\n",
      "Approx 20% complete for Control2_1.fastq\r\n",
      "Approx 25% complete for Control2_1.fastq\r\n",
      "Approx 30% complete for Control2_1.fastq\r\n",
      "Approx 35% complete for Control2_1.fastq\r\n",
      "Approx 40% complete for Control2_1.fastq\r\n",
      "Approx 45% complete for Control2_1.fastq\r\n",
      "Approx 50% complete for Control2_1.fastq\r\n",
      "Approx 55% complete for Control2_1.fastq\r\n",
      "Approx 60% complete for Control2_1.fastq\r\n",
      "Approx 65% complete for Control2_1.fastq\r\n",
      "Approx 70% complete for Control2_1.fastq\r\n",
      "Approx 75% complete for Control2_1.fastq\r\n",
      "Approx 80% complete for Control2_1.fastq\r\n",
      "Approx 85% complete for Control2_1.fastq\r\n",
      "Approx 90% complete for Control2_1.fastq\r\n",
      "Approx 95% complete for Control2_1.fastq\r\n",
      "Analysis complete for Control2_1.fastq\r\n"
     ]
    }
   ],
   "source": [
    "/usr/local/bin/FastQC/fastqc Control2_1.fastq"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 116,
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Started analysis of Control2_2.fastq\r\n",
      "Approx 5% complete for Control2_2.fastq\r\n",
      "Approx 10% complete for Control2_2.fastq\r\n",
      "Approx 15% complete for Control2_2.fastq\r\n",
      "Approx 20% complete for Control2_2.fastq\r\n",
      "Approx 25% complete for Control2_2.fastq\r\n",
      "Approx 30% complete for Control2_2.fastq\r\n",
      "Approx 35% complete for Control2_2.fastq\r\n",
      "Approx 40% complete for Control2_2.fastq\r\n",
      "Approx 45% complete for Control2_2.fastq\r\n",
      "Approx 50% complete for Control2_2.fastq\r\n",
      "Approx 55% complete for Control2_2.fastq\r\n",
      "Approx 60% complete for Control2_2.fastq\r\n",
      "Approx 65% complete for Control2_2.fastq\r\n",
      "Approx 70% complete for Control2_2.fastq\r\n",
      "Approx 75% complete for Control2_2.fastq\r\n",
      "Approx 80% complete for Control2_2.fastq\r\n",
      "Approx 85% complete for Control2_2.fastq\r\n",
      "Approx 90% complete for Control2_2.fastq\r\n",
      "Approx 95% complete for Control2_2.fastq\r\n",
      "Analysis complete for Control2_2.fastq\r\n"
     ]
    }
   ],
   "source": [
    "/usr/local/bin/FastQC/fastqc Control2_2.fastq"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 117,
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Started analysis of Quiescence2_1.fastq\r\n",
      "Approx 5% complete for Quiescence2_1.fastq\r\n",
      "Approx 10% complete for Quiescence2_1.fastq\r\n",
      "Approx 15% complete for Quiescence2_1.fastq\r\n",
      "Approx 20% complete for Quiescence2_1.fastq\r\n",
      "Approx 25% complete for Quiescence2_1.fastq\r\n",
      "Approx 30% complete for Quiescence2_1.fastq\r\n",
      "Approx 35% complete for Quiescence2_1.fastq\r\n",
      "Approx 40% complete for Quiescence2_1.fastq\r\n",
      "Approx 45% complete for Quiescence2_1.fastq\r\n",
      "Approx 50% complete for Quiescence2_1.fastq\r\n",
      "Approx 55% complete for Quiescence2_1.fastq\r\n",
      "Approx 60% complete for Quiescence2_1.fastq\r\n",
      "Approx 65% complete for Quiescence2_1.fastq\r\n",
      "Approx 70% complete for Quiescence2_1.fastq\r\n",
      "Approx 75% complete for Quiescence2_1.fastq\r\n",
      "Approx 80% complete for Quiescence2_1.fastq\r\n",
      "Approx 85% complete for Quiescence2_1.fastq\r\n",
      "Approx 90% complete for Quiescence2_1.fastq\r\n",
      "Approx 95% complete for Quiescence2_1.fastq\r\n",
      "Analysis complete for Quiescence2_1.fastq\r\n"
     ]
    }
   ],
   "source": [
    "/usr/local/bin/FastQC/fastqc Quiescence2_1.fastq"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 118,
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Started analysis of Quiescence2_2.fastq\r\n",
      "Approx 5% complete for Quiescence2_2.fastq\r\n",
      "Approx 10% complete for Quiescence2_2.fastq\r\n",
      "Approx 15% complete for Quiescence2_2.fastq\r\n",
      "Approx 20% complete for Quiescence2_2.fastq\r\n",
      "Approx 25% complete for Quiescence2_2.fastq\r\n",
      "Approx 30% complete for Quiescence2_2.fastq\r\n",
      "Approx 35% complete for Quiescence2_2.fastq\r\n",
      "Approx 40% complete for Quiescence2_2.fastq\r\n",
      "Approx 45% complete for Quiescence2_2.fastq\r\n",
      "Approx 50% complete for Quiescence2_2.fastq\r\n",
      "Approx 55% complete for Quiescence2_2.fastq\r\n",
      "Approx 60% complete for Quiescence2_2.fastq\r\n",
      "Approx 65% complete for Quiescence2_2.fastq\r\n",
      "Approx 70% complete for Quiescence2_2.fastq\r\n",
      "Approx 75% complete for Quiescence2_2.fastq\r\n",
      "Approx 80% complete for Quiescence2_2.fastq\r\n",
      "Approx 85% complete for Quiescence2_2.fastq\r\n",
      "Approx 90% complete for Quiescence2_2.fastq\r\n",
      "Approx 95% complete for Quiescence2_2.fastq\r\n",
      "Analysis complete for Quiescence2_2.fastq\r\n"
     ]
    }
   ],
   "source": [
    "/usr/local/bin/FastQC/fastqc Quiescence2_2.fastq"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 3. Mapping reads to the reference genome using STAR"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Jan 24 13:59:46 ..... started STAR run\r\n",
      "Jan 24 13:59:46 ..... loading genome\r\n",
      "Jan 24 13:59:46 ..... started mapping\r\n",
      "Jan 24 14:12:26 ..... finished successfully\r\n"
     ]
    }
   ],
   "source": [
    "STAR --genomeDir /mnt/nfs/mfiers/STAR/hg19_star_db \\\n",
    "     --genomeLoad LoadAndKeep \\\n",
    "     --runThreadN 2 \\\n",
    "     --readFilesIn Control1_1.fastq Control1_2.fastq \\\n",
    "     --outFileNamePrefix Control1."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Jan 24 14:14:53 ..... started STAR run\r\n",
      "Jan 24 14:14:53 ..... loading genome\r\n",
      "Jan 24 14:14:54 ..... started mapping\r\n",
      "Jan 24 14:28:38 ..... finished successfully\r\n"
     ]
    }
   ],
   "source": [
    "STAR --genomeDir /mnt/nfs/mfiers/STAR/hg19_star_db \\\n",
    "     --genomeLoad LoadAndKeep \\\n",
    "     --runThreadN 2 \\\n",
    "     --readFilesIn Quiescence_1.fastq Quiescence_2.fastq \\\n",
    "     --outFileNamePrefix Quiescence."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 119,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Jan 24 21:54:13 ..... started STAR run\r\n",
      "Jan 24 21:54:13 ..... loading genome\r\n",
      "Jan 24 21:54:14 ..... started mapping\r\n",
      "Jan 24 22:08:53 ..... finished successfully\r\n"
     ]
    }
   ],
   "source": [
    "STAR --genomeDir /mnt/nfs/mfiers/STAR/hg19_star_db \\\n",
    "     --genomeLoad LoadAndKeep \\\n",
    "     --runThreadN 2 \\\n",
    "     --readFilesIn Control2_1.fastq Control2_2.fastq \\\n",
    "     --outFileNamePrefix Control2."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 120,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Jan 24 22:13:55 ..... started STAR run\r\n",
      "Jan 24 22:13:55 ..... loading genome\r\n",
      "Jan 24 22:13:55 ..... started mapping\r\n",
      "Jan 24 22:28:04 ..... finished successfully\r\n"
     ]
    }
   ],
   "source": [
    "STAR --genomeDir /mnt/nfs/mfiers/STAR/hg19_star_db \\\n",
    "     --genomeLoad LoadAndKeep \\\n",
    "     --runThreadN 2 \\\n",
    "     --readFilesIn Quiescence2_1.fastq Quiescence2_2.fastq \\\n",
    "     --outFileNamePrefix Quiescence2."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 4. Conversion of SAM files to sorted BAM files and indexing"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[bam_sort_core] merging from 21 files...\r\n"
     ]
    }
   ],
   "source": [
    "samtools sort -o Control1.bam Control1.Aligned.out.sam"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": []
    }
   ],
   "source": [
    "samtools index Control1.bam"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 121,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[bam_sort_core] merging from 22 files...\r\n"
     ]
    }
   ],
   "source": [
    "samtools sort -o Control2.bam Control2.Aligned.out.sam"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 122,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": []
    }
   ],
   "source": [
    "samtools index Control2.bam"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[bam_sort_core] merging from 20 files...\r\n"
     ]
    }
   ],
   "source": [
    "samtools sort -o Quiescence.bam Quiescence.Aligned.out.sam"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": []
    }
   ],
   "source": [
    "samtools index Quiescence.bam"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 123,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[bam_sort_core] merging from 22 files...\r\n"
     ]
    }
   ],
   "source": [
    "samtools sort -o Quiescence2.bam Quiescence2.Aligned.out.sam"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 124,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": []
    }
   ],
   "source": [
    "samtools index Quiescence2.bam"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The following files were required to be able to load them in IGV:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 261,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[bam_sort_core] merging from 21 files...\r\n"
     ]
    }
   ],
   "source": [
    "samtools sort -O bam -o Quiescence.sorted.bam Quiescence.bam "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 262,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": []
    }
   ],
   "source": [
    "samtools index Quiescence.sorted.bam"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 263,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[bam_sort_core] merging from 22 files...\r\n"
     ]
    }
   ],
   "source": [
    "samtools sort -O bam -o Control1.sorted.bam Control1.bam "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 264,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": []
    }
   ],
   "source": [
    "samtools index Control1.sorted.bam"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "In the next chapter, we've included an IGV screenshot that includes both RNA-seq and ChIP-seq data."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 5. Assess quality of aligned reads (CIGAR string and Phred quality score)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 269,
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "SRR627536.165256\t99\tchrM\t1\t255\t60M\t=\t101\t149\tGATCACAGGTCTATCACCCTATTAACCACTCACGGGAGCTCTCCATGCATTTGGTATTTT\tBBCFFFFFFAFHFIJIIIJJIJIJJIIIIJJIII@HGHHIJIJJJJIJEIJJJJHGGIJJ\tNH:i:1\tHI:i:1\tAS:i:105\tnM:i:1\r\n",
      "SRR627536.268829\t163\tchrM\t1\t255\t21S39M\t=\t79\t138\tCTTAAATAAGACATCACGATGGATCACAGGTCTATCACCCTATTAACCACTCACGGGAGC\t<BBFFFFFHHHHHJJJJJJJJJIJJJJJJJHIJJJJIJJJJJJJJJJJJJHIJJJIJJJI\tNH:i:1\tHI:i:1\tAS:i:97\tnM:i:0\r\n",
      "SRR627536.31898\t163\tchrM\t1\t255\t32S28M\t=\t48\t107\tCACACGTTCCCCTTAAATAAGACATCACGATGGATCACAGGTCTATCACCCTATTAACCA\tCCCFFFFFHHHHHJJJJJJJJJJJJJJJJJJJJJJJJJJJJHIIJJIJJJHIJJJJJJJI\tNH:i:1\tHI:i:1\tAS:i:86\tnM:i:0\r\n",
      "SRR627536.128145\t163\tchrM\t1\t255\t2S58M\t=\t47\t106\tTGGATCACAGGTCTATCACCCTATTAACCACTCACGGGAGCTCTCCATGCATTTGGTATT\tCCCFFFFFHHHHHJJJJJJJJJJJJJJJJIJJJJJJJIJJJIJJJJJJJJJIJJJJFHII\tNH:i:1\tHI:i:1\tAS:i:116\tnM:i:0\r\n",
      "SRR627536.130029\t99\tchrM\t1\t255\t16S44M\t=\t84\t143\tATAAGACATCACGATGGATCACAGGTCTATCACCCTATTAACCACTCACGGGAGCTCTCC\tCCCFFFFFHHHHHJJJJJJJIJJJJHIJIJIJJJJJJJIJJJJJJJJJJJIIIJFJJJJJ\tNH:i:1\tHI:i:1\tAS:i:102\tnM:i:0\r\n",
      "SRR627536.396482\t99\tchrM\t1\t255\t30S30M\t=\t69\t128\tCACGTTCCCCTTAAATAAGACATCACGATGGATCACAGGTCTATCACCCTATTAACCACT\tCCCFFFFFHHHHHJJJJJJJJJJJJJJJJJJJJIJJJJJGHIJJJJIJJJJIJJIJJJJG\tNH:i:1\tHI:i:1\tAS:i:88\tnM:i:0\r\n",
      "SRR627536.497237\t99\tchrM\t1\t255\t24S36M\t=\t48\t107\tCCCCTTAAATAAGACATCACGATGGATCACAGGTCTATCACCCTATTAACCACTCACGGG\tCCCFFFFFHGHFHJJJIIIJJJJGIIJGHHIJJFHGGJHIJIJJIIIEHIJIJJJJJIII\tNH:i:1\tHI:i:1\tAS:i:94\tnM:i:0\r\n",
      "SRR627536.603611\t163\tchrM\t1\t255\t21S39M\t=\t65\t124\tCTTAAATAAGACATCACGATGGATCACAGGTCTATCACCCTATTAACCACTCACGGGAGC\tCCCFFFFFHHHHHJJJJJJJJJIJJJIJJJHIJJJIJJJJJJIJJIJIJJHIIJJIHHJG\tNH:i:1\tHI:i:1\tAS:i:97\tnM:i:0\r\n",
      "SRR627536.643130\t163\tchrM\t1\t255\t20S40M\t=\t71\t130\tTTAAATAAGACATCACGATGGATCACAGGTCTATCACCCTATTAACCACTCACGGGAGCT\tCCCFFFFFHHHHHJJJJJIJJJJJJJJJJGIIJJJJJJJJJJJJJJIJJJIIJJIJJJJI\tNH:i:1\tHI:i:1\tAS:i:98\tnM:i:0\r\n",
      "SRR627536.826760\t163\tchrM\t1\t255\t5S55M\t=\t100\t159\tCGATGGATCACAGGTCTATCACCCTATTAACCACTCACGGGAGCTCTCCATGCATTTGGT\tCCCFFFFFHGHHHJFHIJJJJJJJJJJIJJHJJJJJIJJJIJJJJJJJJIIIIGIJJIJC\tNH:i:1\tHI:i:1\tAS:i:107\tnM:i:3\r\n",
      "samtools view: writing to standard output failed: Broken pipe\r\n",
      "samtools view: error closing standard output: -1\r\n"
     ]
    }
   ],
   "source": [
    "samtools view Control1.bam | head -10"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 125,
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "SRR627537.179433\t99\tchrM\t1\t255\t21S39M\t=\t77\t136\tCTTAAATAAGACATCACGATGGATCACAGGTCTATCACCCTATTAACCACTCACGGGAGC\tCCCFFFFFGHHHHJJJJJJJJJIIGJJJJJHGIJJJJJJJJJJJJJJJJJJJJJJIJJJI\tNH:i:1\tHI:i:1\tAS:i:97\tnM:i:0\r\n",
      "SRR627537.309411\t99\tchrM\t1\t255\t14S46M\t=\t39\t98\tTTTTTTTCACGATGGATCACAGGTCTATCACCCTATTAACCACTCACGGGAGCTCTCCAT\tCCCFFFFFHHHHHIJFHIIJJIIHDHDHHIIJIIJGIIIJJJGIGGIIIGGIFHGHHFDF\tNH:i:1\tHI:i:1\tAS:i:104\tnM:i:0\r\n",
      "SRR627537.312161\t99\tchrM\t1\t255\t21S39M\t=\t191\t250\tCTTAAATAAGACATCACGATGGATCACAGGTCTATCACCCTATTAACCACTCACGGGAGC\tCCCFFFFFHHHHHJJJJJJJJJJJJJJJJJCGHIJJJJJJIJJJJIJJIJIJJJJJIJJJ\tNH:i:1\tHI:i:1\tAS:i:95\tnM:i:1\r\n",
      "SRR627537.351783\t163\tchrM\t1\t255\t33S27M\t=\t63\t122\tCCACACGTTCCCCTTAAATAAGACATCACGATGGATCACAGGTCTATCACCCTATTAACC\t@CCFFFFFHHHHGJJJJIIIJJIJJJIJJJJJJIIIIIJJGIDHIJJJJJIIJJJIIGI>\tNH:i:1\tHI:i:1\tAS:i:85\tnM:i:0\r\n",
      "SRR627537.408761\t163\tchrM\t1\t255\t34S26M\t=\t35\t94\tCCCACACGTTCCCCTTAAATAAGACATCACGATGGATCACAGGTCTATCACCCTATTAAC\t??@DDDFDCFHG?EFHEE@AHHB<EFCAEHBD;D:FCFABGG=HGCFFFDB@GGCEHEGH\tNH:i:1\tHI:i:1\tAS:i:84\tnM:i:0\r\n",
      "SRR627537.443695\t99\tchrM\t1\t255\t22S38M\t=\t34\t93\tCCTTAAATAAGACATCACGATGGATCACAGGTCTATCACCCTATTAACCACTCACGGGAG\tBCCFFFFFHHHHHJJJJJJIJJJHIIJGIIJGHIJJHIJJJJJJJJJJIIJJJJIJIGII\tNH:i:1\tHI:i:1\tAS:i:96\tnM:i:0\r\n",
      "SRR627537.697379\t99\tchrM\t1\t255\t30S30M\t=\t71\t130\tCACGTTCCCCTTAAATAAGACATCACGATGGATCACAGGTCTATCACCCTATTAACCACT\t@@@FFFFFHHDHFIIIIIJEGIGEG>FHHIJJIJHIIII:DBGGIIIJIJJJJIEIEHIG\tNH:i:1\tHI:i:1\tAS:i:88\tnM:i:0\r\n",
      "SRR627537.574024\t99\tchrM\t1\t255\t21S39M\t=\t55\t114\tCTTAAATAAGACATCACGATGGATCACAGGTCTATCACCCTATTAACCACTCACGGGAGC\tCCCFFFFFHHHHHJJIJJIJJJJJIJJJJJHHIJJJJJJJJJJJJGHIJJJJIJJJIJJI\tNH:i:1\tHI:i:1\tAS:i:97\tnM:i:0\r\n",
      "SRR627537.713698\t163\tchrM\t1\t255\t7S53M\t=\t73\t132\tCACGATGGATCACAGGTCTATCACCCTATTAACCACTCACGGGAGCTCTCCATGCATTTG\tCCCFFFFFHHHHHJJJGHIJJJJJJJJJJJJJJJJJJJJJJJIJJJJJJJJIJIIIJJJJ\tNH:i:1\tHI:i:1\tAS:i:111\tnM:i:0\r\n",
      "SRR627537.755175\t99\tchrM\t1\t255\t3S57M\t=\t93\t149\tATGGATCACAGGTCTATCACCCTATTAACCACTCACGGGAGCTCTCCATGCATTTGGTAT\tCCCFFFFFHHHHHHHGIIIJJJEIJIIJJJJJJJIIFIBAGGGHGGGIGGJJGGGGG6CF\tNH:i:1\tHI:i:1\tAS:i:110\tnM:i:1\r\n",
      "samtools view: writing to standard output failed: Broken pipe\r\n",
      "samtools view: error closing standard output: -1\r\n"
     ]
    }
   ],
   "source": [
    "samtools view Control2.bam | head -10"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 88,
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "SRR627538.20843\t163\tchrM\t1\t255\t23S37M\t=\t63\t122\tCCCTTAAATAAGACATCACGATGGATCACAGGTCTATCACCCTATTAACCACTCACGGGA\tCCCFFFFFHHGHHJJJIJJJJJJJJJJJIIJJGIIJJJJJJJIJIJJJJJHIJIJJJJHI\tNH:i:1\tHI:i:1\tAS:i:95\tnM:i:0\r\n",
      "SRR627538.23193\t163\tchrM\t1\t255\t5S55M\t=\t58\t117\tCGATGGATCACAGGTCTATCACCCTATTAACCACTCACGGGAGCTCTCCATGCATTTGGT\t?B@FFFFFHHHHHJHIJIJJJJJJJJJJJIJJIJJJJJJIIIIJJJJJJJHHIIJJJJJF\tNH:i:1\tHI:i:1\tAS:i:113\tnM:i:0\r\n",
      "SRR627538.277808\t99\tchrM\t1\t255\t1S59M\t=\t65\t124\tGGATCACAGGTCTATCACCCTATTAACCACTCACGGGAGCTCTCCATGCATTTGGTATTT\t@CCFFFFFHHFHHJJJIJJJIJJJJJJJFIIIJJIIHJEIJJJJJIHIIIJIIJJ=CHHH\tNH:i:1\tHI:i:1\tAS:i:117\tnM:i:0\r\n",
      "SRR627538.243274\t163\tchrM\t1\t255\t27S33M\t=\t202\t261\tGTTCCCCTTAAATAAGACATCACGATGGATCACAGGTCTATCACCCTATTAACCACTCAC\tCBCFFFFFHHHHHJJJJJJJIJJJJIJJIIJJIIJJGIIIJIJJJJJJJJGIJJIJJIJG\tNH:i:1\tHI:i:1\tAS:i:91\tnM:i:0\r\n",
      "SRR627538.557358\t99\tchrM\t1\t255\t26S34M\t=\t83\t142\tTTCCCCTTAAATAAGACATCACGATGGATCACAGGTCTATCACCCTATTAACCACTCACG\t@C@DDDEF>HHHDHIJGGEHIIHGEFEIIGIAAFGFGIGIGCCHIDCHGIIJ3E@FEGGG\tNH:i:1\tHI:i:1\tAS:i:92\tnM:i:0\r\n",
      "SRR627538.432632\t163\tchrM\t1\t255\t32S28M\t=\t47\t106\tCACACGTTCCCCTTAAATAAGACATCACGATGGATCACAGGTCTATCACCCTATTAACCA\t@@CDFDBDHHHHGIIIJIIJBHIJIGHGEHIFIIIIIJJII@FHHGIJJIHGIIGIIJGG\tNH:i:1\tHI:i:1\tAS:i:86\tnM:i:0\r\n",
      "SRR627538.527125\t99\tchrM\t1\t255\t14S46M\t=\t71\t130\tAAGACATCACGATGGATCACAGGTCTATCACCCTATTAACCACTCACGGGAGCTCTCCAT\tCCCFFFFFHHHHHJJIJJJJJJJHHIJJIIJJJJJJJJJJJJJJJJJJJIJJJIJIJJJI\tNH:i:1\tHI:i:1\tAS:i:104\tnM:i:0\r\n",
      "SRR627538.834241\t99\tchrM\t1\t255\t32S28M\t=\t77\t136\tCACACGTTCCCCTTAAATAAGACATCACGATGGATCACAGGTCTATCACCCTATTAACCA\tCCCFFFFFHHHHHJJJJJJJJJJJJIIJJJJJJJJJJJJJJGHGIJJJJJJJIJJJJJIG\tNH:i:1\tHI:i:1\tAS:i:86\tnM:i:0\r\n",
      "SRR627538.754449\t163\tchrM\t1\t255\t15S45M\t=\t71\t130\tTAAGACATCACGATGGATCACAGGTCTATCACCCTATTAACCACTCACGGGAGCTCTCCA\tCCCFFFFFHHHHGGJJJJIJJJJJHIJIIIJJJJIJJJJJJJJJJIJJJJJJIJJJJJJG\tNH:i:1\tHI:i:1\tAS:i:103\tnM:i:0\r\n",
      "SRR627538.850516\t99\tchrM\t1\t255\t30S30M\t=\t34\t93\tCACGTTCCCCTTAAATAAGACATCACGATGGATCACAGGTCTATCACCCTATTAACCACT\t?@@?:ADDFFDFFIIE@CFCH;CDHEGFICAGE@CCFC;:?BFDAB<?FBFFE@FC>FFF\tNH:i:1\tHI:i:1\tAS:i:88\tnM:i:0\r\n",
      "samtools view: writing to standard output failed: Broken pipe\r\n",
      "samtools view: error closing standard output: -1\r\n"
     ]
    }
   ],
   "source": [
    "samtools view Quiescence.bam | head -10"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 126,
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "SRR627539.30702\t99\tchrM\t1\t255\t5S55M\t=\t73\t132\tCGATGGATCACAGGTCTATCACCCTATTAACCACTCACGGGAGCTCTCCATGCATTTGGT\tCCCFFFFFHHHHHJHHJIJJJJJJIIIJJGIIJJJJJJJJGJJJJJJJJIIIJJIJJJJF\tNH:i:1\tHI:i:1\tAS:i:113\tnM:i:0\r\n",
      "SRR627539.109334\t99\tchrM\t1\t255\t27S33M\t=\t81\t140\tGTTCCCCTTAAATAAGACATCACGATGGATCACAGGTCTATCACCCTATTAACCACTCAC\tCCCFFFFFHHHHHJJJJJJJJJJJJJJJJJJJJJJJHIIJJJJJJJJIJJJJJJJJJJJI\tNH:i:1\tHI:i:1\tAS:i:91\tnM:i:0\r\n",
      "SRR627539.224118\t163\tchrM\t1\t255\t21S39M\t=\t84\t143\tCTTAAATAAGACATCACGATGGATCACAGGTCTATCACCCTATTAACCACTCACGGGAGC\t?BCFFFFFHHHHHJJJJJJJJJJJJIIJJJHHJJJJJIJJJJJJIJJJJJIIIIIIIJJJ\tNH:i:1\tHI:i:1\tAS:i:97\tnM:i:0\r\n",
      "SRR627539.274231\t163\tchrM\t1\t255\t21S39M\t=\t209\t268\tCTTAAATAAGACATCACGATGGATCACAGGTCTATCACCCTATTAACCACTCACGGGAGC\tCCCFFFFFHHHHHJJJJJJJJJIJJJGJIJFGIJJJJJJJJJJJIIIGHIHIJJJGIEIG\tNH:i:1\tHI:i:1\tAS:i:97\tnM:i:0\r\n",
      "SRR627539.297860\t99\tchrM\t1\t255\t20S40M\t=\t76\t135\tTTAAATAAGACATCACGATGGATCACAGGTCTATCACCCTATTAACCACTCACGGGAGCT\tCCCFFFFFHHHHHJJJJIIJJIJIJJJJJFHIIJJJJJIJJIJJJJJJJJJJJIJJJJJI\tNH:i:1\tHI:i:1\tAS:i:96\tnM:i:1\r\n",
      "SRR627539.307436\t99\tchrM\t1\t255\t21S39M\t=\t34\t93\tCTTAAATAAGACATCACGATGGATCACAGGTCTATCACCCTATTAACCACTCACGGGAGC\tCCCFFFFFHHHHHJJJJJIJJJJJJIJJJJJJJJJJIJJJIJJJJJJIJJJJJJIHIGJJ\tNH:i:1\tHI:i:1\tAS:i:97\tnM:i:0\r\n",
      "SRR627539.362100\t163\tchrM\t1\t255\t21S39M\t=\t82\t141\tCTTAAATAAGACATCACGATGGATCACAGGTCTATCACCCTATTAACCACTCACGGGAGC\t@@@DDADEDFBFFHHBD?FHGB@DGDHGGD9CH>FGEGAGEGHGGAHGIGFHIHA:FAEB\tNH:i:1\tHI:i:1\tAS:i:95\tnM:i:1\r\n",
      "SRR627539.465613\t163\tchrM\t1\t255\t20S40M\t=\t61\t120\tTTAAATAAGACATCACGATGGATCACAGGTCTATCACCCTATTAACCACTCACGGGAGCT\tCCCFFFFFHHHHGJJJIJIJJJJIJJJJIGHJIJJJJJJJJJJJJJJIIJHIJJJIIJJI\tNH:i:1\tHI:i:1\tAS:i:98\tnM:i:0\r\n",
      "SRR627539.719535\t99\tchrM\t1\t255\t27S33M\t=\t84\t143\tGTTCCCCTTAAATAAGACATCACGATGGATCACAGGTCTATCACCCTATTAACCACTCAC\tCCCFFFFFHHHHHJJJIJJJJJJJIIJJGIIJJJJIFHIJJFIJJJIIIGIIJGIJGIIJ\tNH:i:1\tHI:i:1\tAS:i:91\tnM:i:0\r\n",
      "SRR627539.642558\t163\tchrM\t1\t255\t32S28M\t=\t77\t136\tCACACGTTCCCCTTAAATAAGACATCACGATGGATCACAGGTCTATCACCCTATTAACCA\tCCCFFFFFHHHHHJJJJJJIIJ>GIGIJJJJJJJJJJJJJJHIJJJIJJJFHJJJJJJJG\tNH:i:1\tHI:i:1\tAS:i:86\tnM:i:0\r\n",
      "samtools view: writing to standard output failed: Broken pipe\r\n",
      "samtools view: error closing standard output: -1\r\n"
     ]
    }
   ],
   "source": [
    "samtools view Quiescence2.bam | head -10"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Most reads do not show a 100% match (60M) but several soft clipped bases have been detected. However, to the best of our knowledge, this won't effect our downstream analysis severely. Phred quality score indicated a decent quality of the mapped reads."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 6. Reads to gene counts"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 127,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\r\n",
      "       \u001b[44;37m ========== \u001b[0m\u001b[36m    _____ _    _ ____  _____  ______          _____  \r\n",
      "       \u001b[44;37m =====      \u001b[0m\u001b[36m   / ____| |  | |  _ \\|  __ \\|  ____|   /\\   |  __ \\ \r\n",
      "       \u001b[44;37m   =====    \u001b[0m\u001b[36m  | (___ | |  | | |_) | |__) | |__     /  \\  | |  | |\r\n",
      "       \u001b[44;37m     ====   \u001b[0m\u001b[36m   \\___ \\| |  | |  _ <|  _  /|  __|   / /\\ \\ | |  | |\r\n",
      "       \u001b[44;37m       ==== \u001b[0m\u001b[36m   ____) | |__| | |_) | | \\ \\| |____ / ____ \\| |__| |\r\n",
      "       \u001b[44;37m ========== \u001b[0m\u001b[36m  |_____/ \\____/|____/|_|  \\_\\______/_/    \\_\\_____/\u001b[0m\r\n",
      "\tv1.5.0-p1\r\n",
      "\r\n",
      "//==========================\u001b[36m featureCounts setting \u001b[0m===========================\\\\\r\n",
      "||  \u001b[0m                                                                          ||\r\n",
      "||             Input files : \u001b[36m4 BAM files  \u001b[0m \u001b[0m                                   ||\r\n",
      "||                           \u001b[32mP\u001b[36m Control1.bam\u001b[0m \u001b[0m                                  ||\r\n",
      "||                           \u001b[32mP\u001b[36m Control2.bam\u001b[0m \u001b[0m                                  ||\r\n",
      "||                           \u001b[32mP\u001b[36m Quiescence.bam\u001b[0m \u001b[0m                                ||\r\n",
      "||                           \u001b[32mP\u001b[36m Quiescence2.bam\u001b[0m \u001b[0m                               ||\r\n",
      "||  \u001b[0m                                                                          ||\r\n",
      "||             Output file : \u001b[36mall_CVSQ.counts\u001b[0m \u001b[0m                                 ||\r\n",
      "||             Annotations : \u001b[36m/mnt/nfs/data/RNA-seq/gencode.v19.nopseudo.p\u001b[0m ...\u001b[0m \u001b[0m||\r\n",
      "||  \u001b[0m                                                                          ||\r\n",
      "||                 Threads : \u001b[36m1\u001b[0m \u001b[0m                                               ||\r\n",
      "||                   Level : \u001b[36mmeta-feature level\u001b[0m \u001b[0m                              ||\r\n",
      "||              Paired-end : \u001b[36mno\u001b[0m \u001b[0m                                              ||\r\n",
      "||         Strand specific : \u001b[36mno\u001b[0m \u001b[0m                                              ||\r\n",
      "||      Multimapping reads : \u001b[36mnot counted\u001b[0m \u001b[0m                                     ||\r\n",
      "|| Multi-overlapping reads : \u001b[36mnot counted\u001b[0m \u001b[0m                                     ||\r\n",
      "||       Read orientations : \u001b[36mfr\u001b[0m \u001b[0m                                              ||\r\n",
      "||  \u001b[0m                                                                          ||\r\n",
      "\\\\=====================\u001b[36m http://subread.sourceforge.net/ \u001b[0m======================//\r\n",
      "\r\n",
      "//=================================\u001b[36m Running \u001b[0m==================================\\\\\r\n",
      "||  \u001b[0m                                                                          ||\r\n",
      "|| Load annotation file /mnt/nfs/data/RNA-seq/gencode.v19.nopseudo.plus.s\u001b[0m ... \u001b[0m||\r\n",
      "||    Features : \u001b[36m1156385\u001b[0m \u001b[0m                                                     ||\r\n",
      "||    Meta-features : \u001b[36m41863\u001b[0m \u001b[0m                                                  ||\r\n",
      "||    Chromosomes/contigs : \u001b[36m25\u001b[0m \u001b[0m                                               ||\r\n",
      "||  \u001b[0m                                                                          ||\r\n",
      "|| Process BAM file Control1.bam... \u001b[0m                                          ||\r\n",
      "||    Paired-end reads are included. \u001b[0m                                         ||\r\n",
      "||    Assign reads to features... \u001b[0m                                            ||\r\n",
      "||    Total reads : \u001b[36m52897542\u001b[0m \u001b[0m                                                 ||\r\n",
      "||    Successfully assigned reads : \u001b[36m39136253 (74.0%)\u001b[0m \u001b[0m                         ||\r\n",
      "||    Running time : \u001b[36m1.27 minutes\u001b[0m \u001b[0m                                            ||\r\n",
      "||  \u001b[0m                                                                          ||\r\n",
      "|| Process BAM file Control2.bam... \u001b[0m                                          ||\r\n",
      "||    Paired-end reads are included. \u001b[0m                                         ||\r\n",
      "||    Assign reads to features... \u001b[0m                                            ||\r\n",
      "||    Total reads : \u001b[36m56897168\u001b[0m \u001b[0m                                                 ||\r\n",
      "||    Successfully assigned reads : \u001b[36m42623887 (74.9%)\u001b[0m \u001b[0m                         ||\r\n",
      "||    Running time : \u001b[36m1.07 minutes\u001b[0m \u001b[0m                                            ||\r\n",
      "||  \u001b[0m                                                                          ||\r\n",
      "|| Process BAM file Quiescence.bam... \u001b[0m                                        ||\r\n",
      "||    Paired-end reads are included. \u001b[0m                                         ||\r\n",
      "||    Assign reads to features... \u001b[0m                                            ||\r\n",
      "||    Total reads : \u001b[36m52019978\u001b[0m \u001b[0m                                                 ||\r\n",
      "||    Successfully assigned reads : \u001b[36m38442905 (73.9%)\u001b[0m \u001b[0m                         ||\r\n",
      "||    Running time : \u001b[36m1.20 minutes\u001b[0m \u001b[0m                                            ||\r\n",
      "||  \u001b[0m                                                                          ||\r\n",
      "|| Process BAM file Quiescence2.bam... \u001b[0m                                       ||\r\n",
      "||    Paired-end reads are included. \u001b[0m                                         ||\r\n",
      "||    Assign reads to features... \u001b[0m                                            ||\r\n",
      "||    Total reads : \u001b[36m55184826\u001b[0m \u001b[0m                                                 ||\r\n",
      "||    Successfully assigned reads : \u001b[36m41552372 (75.3%)\u001b[0m \u001b[0m                         ||\r\n",
      "||    Running time : \u001b[36m1.03 minutes\u001b[0m \u001b[0m                                            ||\r\n",
      "||  \u001b[0m                                                                          ||\r\n",
      "||                         \u001b[36mRead assignment finished.\u001b[0m \u001b[0m                         ||\r\n",
      "||  \u001b[0m                                                                          ||\r\n",
      "\\\\=====================\u001b[36m http://subread.sourceforge.net/ \u001b[0m======================//\r\n",
      "\r\n"
     ]
    }
   ],
   "source": [
    "featureCounts \\\n",
    "    -Q 10 \\\n",
    "    -g gene_name \\\n",
    "    -a /mnt/nfs/data/RNA-seq/gencode.v19.nopseudo.plus.sort.gtf \\\n",
    "    -o all_CVSQ.counts \\\n",
    "    Control1.bam Control2.bam Quiescence.bam Quiescence2.bam"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 128,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": []
    }
   ],
   "source": [
    "cut -f-6 all_CVSQ.counts > all_CVSQ.genedata.tsv"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 129,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": []
    }
   ],
   "source": [
    "cut -f1,7- all_CVSQ.counts | grep -v '^#' > all_CVSQ.gene.counts"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "As a control, we've listed some genes which we knew would be upregulated or downregulated. As stated in the paper, transcript levels of SREBF1 and SREBF2 were induced in quiescence by 2.5 and 3.8-fold, respectively. We hypothesized that quiescent cells would exhibit higher levels of cyclin-dependent kinase inhibitors. Indeed, CDKN2B displayed an astonishing 4.0-fold induction. On the other hand, E2F1 transcript levels were decreased by 3.0-fold."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 143,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "SREBF1\t2772\t2230\t5632\t6973\r\n",
      "SREBF2\t3780\t3630\t12347\t15527\r\n",
      "CDKN2B\t193\t227\t821\t881\r\n",
      "E2F1\t3284\t3624\t1316\t1135\r\n"
     ]
    }
   ],
   "source": [
    "grep SREBF1 all_CVSQ.gene.counts\n",
    "grep SREBF2 all_CVSQ.gene.counts\n",
    "grep CDKN2B all_CVSQ.gene.counts | grep -v 'CDKN2B-AS1'\n",
    "grep E2F1 all_CVSQ.gene.counts"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 7. Differential gene expression using DESeq2 (see R notebook)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Using a cut-off of log2 fold change > 1 and an adjusted P-value ≤ 0.05, 511 genes were found to be upregulated genes, while 240 genes were found to be downregulated upon serum depletion."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 8. Gene ontology enrichment analysis using GOrilla"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "In order to gain more insight into the underlying biology of our set of differenially expressed genes, we've subjected them to gene ontology (GO) enrichment analysis using GOrilla. Two lists of unranked genes were used as input, a target set (our list of differentially upregulated or downregulated genes) and a background set (all genes identified in the RNA-seq experiment), as instructed by the software."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "- Significantly enriched GO categories among 511 differentially upregulated genes:"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<img width=\"100%\" src=\"/user/r0259859/files/Exam%202016-2017/GOrilla_genes_up.jpg\">"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<img width=\"100%\" src=\"/user/r0259859/files/Exam 2016-2017/GOrilla_genes_up2.jpg\">"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "- Significantly enriched GO categories among 240 differentially downregulated genes:"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<img width=\"100%\" src=\"/user/r0259859/files/Exam 2016-2017/GOrilla_genes_down.jpg\">"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Summarized below, we've listed a set of genes that were found to be significantly upregulated or downregulated among the enriched GO categories."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Selection of significantly upregulated genes involved in sterol biosynthesis"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "- Enzymes"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 265,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "DHCR7\t2.97225490323278\t8.1674382962288e-37\r\n",
      "DHCR24\t1.82445298238994\t4.10527089573031e-18\r\n",
      "EBP\t1.30470085760866\t6.54153161482638e-08\r\n",
      "SQLE\t2.57679182007847\t1.2564996032336e-37\r\n",
      "HMGCR\t2.78655888349546\t3.6036729379927e-49\r\n"
     ]
    }
   ],
   "source": [
    "grep DHCR7 deseq.results.tsv | cut -f1,3,7\n",
    "grep DHCR24 deseq.results.tsv | cut -f1,3,7\n",
    "grep EBP deseq.results.tsv | grep -v 'CEBPB' | grep -v 'HEBP2' | grep -v 'EIF4EBP2' | grep -v 'CEBPD' | grep -v 'CEBPG' | grep -v 'CEBPZ' | grep -v 'EBPL' | grep -v 'PEBP1' | grep -v 'AEBP1' | grep -v 'EIF4EBP1' | grep -v 'AEBP2' | grep -v 'HEBP1' | grep -v 'ANKHD1-EIF4EBP3' | grep -v 'CEBPE' | grep -v 'CEBPA' | grep -v 'CEBPA-AS1' | grep -v 'EIF4EBP3' | grep -v 'PEBP4' | cut -f1,3,7 \n",
    "grep SQLE deseq.results.tsv | cut -f1,3,7\n",
    "grep HMGCR deseq.results.tsv | cut -f1,3,7"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "- Major regulators"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 164,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "SREBF1\t1.23748921850832\t3.19349350378131e-07\r\n",
      "SREBF2\t1.80410555791312\t5.61587968398948e-18\r\n"
     ]
    }
   ],
   "source": [
    "grep SREBF1 deseq.results.tsv | cut -f1,3,7\n",
    "grep SREBF2 deseq.results.tsv | cut -f1,3,7"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Selection of significantly upregulated genes involved in regulation of cell proliferation"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 192,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "CDKN2B\t1.87427715479257\t9.51713116473467e-15\r\n",
      "TP53INP1\t1.6965440383463\t3.92982974085263e-11\r\n"
     ]
    }
   ],
   "source": [
    "grep CDKN2B deseq.results.tsv | grep -v 'CDKN2B-AS1' | cut -f1,3,7\n",
    "grep TP53INP1 deseq.results.tsv | cut -f1,3,7"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Selection of significantly downregulated genes involved in ribosome biogenesis"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 183,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "BOP1\t-1.12362629158873\t2.17310287746388e-05\r\n",
      "EBNA1BP2\t-1.24556158583923\t3.13466269722529e-09\r\n",
      "NOP56\t-1.00661853795381\t3.54599081820576e-06\r\n"
     ]
    }
   ],
   "source": [
    "grep BOP1 deseq.results.tsv | cut -f1,3,7\n",
    "grep EBNA1BP2 deseq.results.tsv | cut -f1,3,7\n",
    "grep NOP56 deseq.results.tsv | cut -f1,3,7"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Although several genes involved in ribosome biogenesis were found to be downregulated in quiescent cells, this category was not predicted to be significantly enriched by GOrilla."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Selection of significantly downregulated genes involved in cell cycle progression"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "- Cyclins and cyclin-dependent kinases"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 185,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "CCNF\t-1.3630964543749\t4.64421490938296e-08\r\n",
      "CCNB1\t-1.18855500992633\t8.94120604520044e-06\r\n",
      "CCNB2\t-1.02674832750354\t0.000561122375655863\r\n",
      "CDK2\t-1.08178945665052\t2.79984228872897e-05\r\n"
     ]
    }
   ],
   "source": [
    "grep CCNF deseq.results.tsv | cut -f1,3,7\n",
    "grep CCNB1 deseq.results.tsv | grep -v CCNB1IP1 | cut -f1,3,7\n",
    "grep CCNB2 deseq.results.tsv | cut -f1,3,7\n",
    "grep CDK2 deseq.results.tsv | grep -v CDK2AP2 | grep -v CDK20 | grep -v CDK2AP1 | cut -f1,3,7"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "- Cell division cycle proteins"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 189,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "CDCA2\t-1.04462164238869\t0.00298810623501944\r\n",
      "CDC6\t-1.07499440477595\t9.71233767982569e-06\r\n",
      "CDCA4\t-1.04237042020248\t2.44246197761126e-05\r\n",
      "CDCA5\t-1.00707997460329\t0.000174847425840663\r\n",
      "CDCA7\t-1.10241867630439\t0.000698409226899647\r\n",
      "CDCA8\t-1.46953972935939\t2.78646746961882e-08\r\n",
      "CDC20\t-1.66645547248874\t3.47585055480997e-11\r\n",
      "CDC25A\t-1.4496240985302\t9.60443767145201e-08\r\n",
      "CDC45\t-1.21646650609265\t1.41583073852778e-05\r\n"
     ]
    }
   ],
   "source": [
    "grep CDCA2 deseq.results.tsv | cut -f1,3,7\n",
    "grep CDC6 deseq.results.tsv | grep -v CCDC6 | cut -f1,3,7\n",
    "grep CDCA4 deseq.results.tsv | cut -f1,3,7\n",
    "grep CDCA5 deseq.results.tsv | cut -f1,3,7\n",
    "grep CDCA7 deseq.results.tsv | grep -v CDCA7L | cut -f1,3,7\n",
    "grep CDCA8 deseq.results.tsv | cut -f1,3,7\n",
    "grep CDC20 deseq.results.tsv | grep -v CDC20B | cut -f1,3,7\n",
    "grep CDC25A deseq.results.tsv | cut -f1,3,7\n",
    "grep CDC45 deseq.results.tsv | cut -f1,3,7"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "- Major regulators"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 190,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "EZH2\t-1.10900013233714\t0.000763779639694685\r\n",
      "E2F1\t-1.39901152758884\t8.46736845809832e-11\r\n",
      "E2F2\t-1.59036327701113\t2.96888279999908e-07\r\n"
     ]
    }
   ],
   "source": [
    "grep EZH2 deseq.results.tsv | cut -f1,3,7\n",
    "grep E2F1 deseq.results.tsv | cut -f1,3,7\n",
    "grep E2F2 deseq.results.tsv | cut -f1,3,7"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 9. Prediction of a gene regulatory network using iRegulon"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We next used iRegulon to predict master regulators underlying our set of co-expressed genes (either upregulated or downregulated)."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "- Regulatory network for a subset of 511 upregulated target genes, represented by the 3 top-scoring transcription factors:"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<img width=\"100%\" src=\"/user/r0259859/files/Exam 2016-2017/Regulatory network upregulated genes.png\">"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "iRegulon identified SREBF1, SREBF2 and FOXG1 as the master regulators in our upregulated gene set. Interestingly, SREBF2 target genes completely overlap with those of SREBF1 possibly indicating a prevalent co-factorship between the two transcription factors. A GO enrichment analysis of the predicted targets by FOXG1 identified \"negative regulation of cell proliferation\" as significantly enriched (data not shown), highlighting its role in the establishment of quiescent phenotype. Details of the analyses can be found in \"iRegulon_genes_up.xlsx\" under \"/mnt/storage/r0259859/work/RNAseq\"."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "- Regulatory network for a subset of 240 downregulated target genes, represented by the 3 top-scoring transcription factors:"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<img width=\"100%\" src=\"/user/r0259859/files/Exam 2016-2017/Regulatory network downregulated genes.png\">"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "In agreement with the existing literature on quiescence, E2F1, E2F8 and NFYC were the 3 top-scoring regulators identified among our set of downregulated genes. Details of the analyses can be found in \"iRegulon_genes_up.xlsx\" under \"/mnt/storage/r0259859/work/RNAseq\"."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# D. SREBF2 ChIP-Seq analysis"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "All files related to this chapter can be found under /mnt/storage/r0259859/work/SREBF2_ChIP-seq.\n",
    "\n",
    "Finally, we validated the predicted SREBF2 regulon using publicly available ChIP-seq data (GSM1003603). Ideally, we would use data from ChIP'ped SREBF2 in a quiescent fibroblasts. However, there is very limited ChIP-seq data available on SREBF2 and we used a \"neutral\" dataset were no specific treatment was applied. Other datasets that were available used insulin and forskolin treatment before ChIPing SREBF2 and we reasoned that a different transcriptional program might be activated under these conditions."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 1. Converting SRR files to fastq files"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 193,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "/home/luna.kuleuven.be/r0259859/data/work/p53_ChIP-seq\r\n",
      "total 0\r\n"
     ]
    }
   ],
   "source": [
    "mkdir -p ~/data/work/p53_ChIP-seq\n",
    "cd ~/data/work/p53_ChIP-seq\n",
    "pwd\n",
    "ls -l"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 197,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Read 30996678 spots for SRR568123\r\n",
      "Written 30996678 spots for SRR568123\r\n"
     ]
    }
   ],
   "source": [
    "fastq-dump SRR568123"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 198,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Read 32664733 spots for SRR568124\r\n",
      "Written 32664733 spots for SRR568124\r\n"
     ]
    }
   ],
   "source": [
    "fastq-dump SRR568124"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 199,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": []
    }
   ],
   "source": [
    "mv SRR568123.fastq SREBF2_Ab.fastq\n",
    "mv SRR568124.fastq Control_Ab.fastq"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 2. Mapping reads to the reference genome using Bowtie2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 204,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "32664733 reads; of these:\r\n",
      "  32664733 (100.00%) were unpaired; of these:\r\n",
      "    1394381 (4.27%) aligned 0 times\r\n",
      "    23144747 (70.86%) aligned exactly 1 time\r\n",
      "    8125605 (24.88%) aligned >1 times\r\n",
      "95.73% overall alignment rate\r\n"
     ]
    }
   ],
   "source": [
    "bowtie2-align -x /mnt/nfs/data/resources/bowtie2/hg19 Control_Ab.fastq -S Control_Ab.sam"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 201,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "30996678 reads; of these:\r\n",
      "  30996678 (100.00%) were unpaired; of these:\r\n",
      "    643853 (2.08%) aligned 0 times\r\n",
      "    22483173 (72.53%) aligned exactly 1 time\r\n",
      "    7869652 (25.39%) aligned >1 times\r\n",
      "97.92% overall alignment rate\r\n"
     ]
    }
   ],
   "source": [
    "bowtie2-align -x /mnt/nfs/data/resources/bowtie2/hg19 SREBF2_Ab.fastq -S SREBF2_Ab.sam"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 3. Conversion of SAM files to sorted BAM files and indexing"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 225,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": []
    }
   ],
   "source": [
    "samtools view -S -b Control_Ab.sam > Control_Ab.bam"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 207,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": []
    }
   ],
   "source": [
    "samtools view -S -b SREBF2_Ab.sam > SREBF2_Ab.bam"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 226,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": []
    }
   ],
   "source": [
    "samtools sort -O bam -o Control_Ab.sorted.bam Control_Ab.bam "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 208,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[bam_sort_core] merging from 8 files...\r\n"
     ]
    }
   ],
   "source": [
    "samtools sort -O bam -o SREBF2_Ab.sorted.bam SREBF2_Ab.bam "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 227,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[bam_sort_core] merging from 9 files...\r\n"
     ]
    }
   ],
   "source": [
    "samtools index Control_Ab.sorted.bam"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 209,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": []
    }
   ],
   "source": [
    "samtools index SREBF2_Ab.sorted.bam"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 4. Peak calling using MACS2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 237,
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "INFO  @ Fri, 27 Jan 2017 16:50:45: \r\n",
      "# Command line: callpeak -t SREBF2IgG?.sorted.bam --outdir macs2_SREBF2 -n SREBF2IgG? -g hs\r\n",
      "# ARGUMENTS LIST:\r\n",
      "# name = SREBF2IgG?\r\n",
      "# format = AUTO\r\n",
      "# ChIP-seq file = ['SREBF2IgG?.sorted.bam']\r\n",
      "# control file = None\r\n",
      "# effective genome size = 2.70e+09\r\n",
      "# band width = 300\r\n",
      "# model fold = [5, 50]\r\n",
      "# qvalue cutoff = 5.00e-02\r\n",
      "# Larger dataset will be scaled towards smaller dataset.\r\n",
      "# Range for calculating regional lambda is: 10000 bps\r\n",
      "# Broad region calling is off\r\n",
      " \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:50:45: #1 read tag files... \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:50:45: #1 read treatment tags... \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:50:45: Detected format is: BAM \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:50:45: * Input file is gzipped. \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:50:49:  1000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:50:53:  2000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:50:57:  3000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:51:01:  4000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:51:05:  5000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:51:09:  6000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:51:14:  7000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:51:18:  8000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:51:22:  9000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:51:26:  10000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:51:30:  11000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:51:34:  12000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:51:38:  13000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:51:43:  14000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:51:47:  15000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:51:51:  16000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:51:55:  17000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:51:59:  18000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:52:03:  19000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:52:07:  20000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:52:12:  21000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:52:16:  22000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:52:20:  23000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:52:24:  24000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:52:28:  25000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:52:32:  26000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:52:36:  27000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:52:41:  28000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:52:45:  29000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:52:49:  30000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:52:53:  31000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:52:56:  32000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:52:57: #1 tag size is determined as 36 bps \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:52:57: #1 tag size = 36 \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:52:57: #1  total tags in treatment: 31270352 \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:52:57: #1 user defined the maximum tags... \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:52:57: #1 filter out redundant tags at the same location and the same strand by allowing at most 1 tag(s) \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:52:58: #1  tags after filtering in treatment: 27263610 \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:52:58: #1  Redundant rate of treatment: 0.13 \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:52:58: #1 finished! \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:52:58: #2 Build Peak Model... \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:52:58: #2 looking for paired plus/minus strand peaks... \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:53:01: #2 number of paired peaks: 4866 \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:53:01: start model_add_line... \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:53:02: start X-correlation... \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:53:02: end of X-cor \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:53:02: #2 finished! \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:53:02: #2 predicted fragment length is 36 bps \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:53:02: #2 alternative fragment length(s) may be 36,520 bps \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:53:02: #2.2 Generate R script for model : macs2_SREBF2/SREBF2IgG?_model.r \r\n",
      "WARNING @ Fri, 27 Jan 2017 16:53:02: #2 Since the d (36) calculated from paired-peaks are smaller than 2*tag length, it may be influenced by unknown sequencing problem! \r\n",
      "WARNING @ Fri, 27 Jan 2017 16:53:02: #2 You may need to consider one of the other alternative d(s): 36,520 \r\n",
      "WARNING @ Fri, 27 Jan 2017 16:53:02: #2 You can restart the process with --nomodel --extsize XXX with your choice or an arbitrary number. Nontheless, MACS will continute computing. \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:53:02: #3 Call peaks... \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:53:02: #3 Pre-compute pvalue-qvalue table... \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:54:12: #3 Call peaks for each chromosome... \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:54:47: #4 Write output xls file... macs2_SREBF2/SREBF2IgG?_peaks.xls \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:54:47: #4 Write peak in narrowPeak format file... macs2_SREBF2/SREBF2IgG?_peaks.narrowPeak \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:54:47: #4 Write summits bed file... macs2_SREBF2/SREBF2IgG?_summits.bed \r\n",
      "INFO  @ Fri, 27 Jan 2017 16:54:47: Done! \r\n"
     ]
    }
   ],
   "source": [
    "macs2 callpeak -t Control_Ab.sorted.bam --outdir macs2_SREBF2 -n Control_Ab -g hs"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 221,
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "INFO  @ Fri, 27 Jan 2017 02:02:45: \r\n",
      "# Command line: callpeak -t ControlIgG?.sorted.bam --outdir macs2_SREBF2 -n ControlIgG? -g hs\r\n",
      "# ARGUMENTS LIST:\r\n",
      "# name = ControlIgG?\r\n",
      "# format = AUTO\r\n",
      "# ChIP-seq file = ['ControlIgG?.sorted.bam']\r\n",
      "# control file = None\r\n",
      "# effective genome size = 2.70e+09\r\n",
      "# band width = 300\r\n",
      "# model fold = [5, 50]\r\n",
      "# qvalue cutoff = 5.00e-02\r\n",
      "# Larger dataset will be scaled towards smaller dataset.\r\n",
      "# Range for calculating regional lambda is: 10000 bps\r\n",
      "# Broad region calling is off\r\n",
      " \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:02:45: #1 read tag files... \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:02:45: #1 read treatment tags... \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:02:45: Detected format is: BAM \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:02:45: * Input file is gzipped. \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:02:49:  1000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:02:53:  2000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:02:56:  3000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:03:00:  4000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:03:03:  5000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:03:06:  6000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:03:09:  7000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:03:13:  8000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:03:16:  9000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:03:19:  10000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:03:23:  11000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:03:26:  12000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:03:29:  13000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:03:32:  14000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:03:36:  15000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:03:39:  16000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:03:42:  17000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:03:46:  18000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:03:49:  19000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:03:52:  20000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:03:55:  21000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:03:59:  22000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:04:02:  23000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:04:05:  24000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:04:09:  25000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:04:12:  26000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:04:15:  27000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:04:18:  28000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:04:22:  29000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:04:25:  30000000 \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:04:28: #1 tag size is determined as 36 bps \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:04:28: #1 tag size = 36 \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:04:28: #1  total tags in treatment: 30352825 \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:04:28: #1 user defined the maximum tags... \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:04:28: #1 filter out redundant tags at the same location and the same strand by allowing at most 1 tag(s) \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:04:28: #1  tags after filtering in treatment: 26467716 \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:04:28: #1  Redundant rate of treatment: 0.13 \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:04:28: #1 finished! \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:04:28: #2 Build Peak Model... \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:04:28: #2 looking for paired plus/minus strand peaks... \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:04:30: #2 number of paired peaks: 4969 \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:04:30: start model_add_line... \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:04:31: start X-correlation... \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:04:31: end of X-cor \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:04:31: #2 finished! \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:04:31: #2 predicted fragment length is 36 bps \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:04:31: #2 alternative fragment length(s) may be 36,85,279,527 bps \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:04:31: #2.2 Generate R script for model : macs2_SREBF2/ControlIgG?_model.r \r\n",
      "WARNING @ Fri, 27 Jan 2017 02:04:31: #2 Since the d (36) calculated from paired-peaks are smaller than 2*tag length, it may be influenced by unknown sequencing problem! \r\n",
      "WARNING @ Fri, 27 Jan 2017 02:04:31: #2 You may need to consider one of the other alternative d(s): 36,85,279,527 \r\n",
      "WARNING @ Fri, 27 Jan 2017 02:04:31: #2 You can restart the process with --nomodel --extsize XXX with your choice or an arbitrary number. Nontheless, MACS will continute computing. \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:04:31: #3 Call peaks... \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:04:31: #3 Pre-compute pvalue-qvalue table... \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:05:25: #3 Call peaks for each chromosome... \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:05:54: #4 Write output xls file... macs2_SREBF2/ControlIgG?_peaks.xls \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:05:54: #4 Write peak in narrowPeak format file... macs2_SREBF2/ControlIgG?_peaks.narrowPeak \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:05:54: #4 Write summits bed file... macs2_SREBF2/ControlIgG?_summits.bed \r\n",
      "INFO  @ Fri, 27 Jan 2017 02:05:54: Done! \r\n"
     ]
    }
   ],
   "source": [
    "macs2 callpeak -t SREBF2_Ab.sorted.bam --outdir macs2_SREBF2 -n SREBF2_Ab -g hs"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 240,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "3831\r\n"
     ]
    }
   ],
   "source": [
    "cat Control_Ab_peaks.narrowPeak | wc -l"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 239,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "3891\r\n"
     ]
    }
   ],
   "source": [
    "cat SREBF2_Ab_peaks.narrowPeak | wc -l"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Usually an input or control IgG is included when performing ChIP-seq. However, both files that where available from the GSM1003603 dataset showed approximately the same amount of reads at the same target regions so we concluded that these must have been biological replicates. "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<img width=\"100%\" src=\"/user/r0259859/files/Exam 2016-2017/IGV screenschot.png\">"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "A very strong peak (red arrow) that was called by MACS2 could be detected upstream of HMGCR which was predicted to be a target gene and was highly upregulated (green arrow) in the quiescent cell state."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 5. Motif discovery using i-cisTarget"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<img width=\"100%\" src=\"/user/r0259859/files/Exam 2016-2017/SREBF2_ChIP-seq_i-cisTarget.png\">"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Unfortunately, no motifs related to SREBF2 could be retrieved. However, the first enriched transcription factor regulatory track is SREBF2 on human GM12878 produced by the Snyder lab."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "# E. Conclusion"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We could recapitulate the published data and showed that genes involved in lipid biosynthesis were highly upregulated and detected as a significantly enriched GO category. Among our identified set of downregulated genes we identified numerous cell cycle related genes reflecting the block in cell cycle progression imposed by serum depletion. Furthermore, we were able to extend the analysis and uncovered master regulators of the quiescent cell state."
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Bash",
   "language": "bash",
   "name": "bash"
  },
  "language_info": {
   "codemirror_mode": "shell",
   "file_extension": ".sh",
   "mimetype": "text/x-sh",
   "name": "bash"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
