{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Acute myeloid leukemia (AML) is associated with poor prognosis despite use intensive treatment strategies,\n",
    "such as chemotherapy and hematopoietic stem cell transplantation. \n",
    "The transcription factor cAMP Response Element Binding Protein (CREB) is overexpressed in ~60% \n",
    "of AML patients and is associated with a more aggressive form of AML. Previous work has shown that this CREB overexpression augments AML cell growth, while CREB knockdown disrupted AML cell functions in vitro.\n",
    "\n",
    "CREB is thus an important regulator of survival and growth of AML cells, which makes it an interesting target\n",
    "for future drug development. For this reason, a small inhibitor of CREB, XX-650-23 was developed. This molecule\n",
    "interferes with the interaction between CREB and its co-activator CBP.\n",
    "\n",
    "XX-650-23 has been shown to disrupt the interaction in AML cells and shows an array of on-target transcriptional alterations.\n",
    "Here, we tried to confirm the RNA-seq and Chip-seq results found in Mitton et al, together with some deeper analysis.\n",
    "\n",
    "reference: Small molecule inhibition of cAMP response element binding protein in human acute myeloid leukemia cells\n",
    "            Mitton et al."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# RNA-SEQ"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "To confirm the downregulation of CREB-bound genes after XX-650-23 treatment, RNA-seq analysis was performed. For RNA-Seq experiments, KG-1 cells were treated with either XX-650-23 (5μM) or 0.1% DMSO for 12 hours. Two repetitions of this experiment were compared. DMSO-treated cells were used as a negative control.\n",
    "\n",
    "\n",
    "For RNA-seq analysis, the four different \".sra files\" (GSM1937937 : DMSO_rep1, GSM1937938 : DMSO_rep2, GSM1937939 : XX-650-23_rep1, GSM1937940 : XX-650-23_rep2) were dowloaded from the GEO Accession Viewer. The \"sra files\" were then converted into a \"fastq\" format with the fastq-command. Then, a quality control was performed on the fastq files. After this, the STAR command was run to map the fastq files to the genome, using hg19 as the reference genome. SAM files were then converted into BAM files. A all.gene.counts file was made to annotate the right gene names to the reads.\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "mkdir: cannot create directory ‘/home/luna.kuleuven.be/r0363211/data/ncbi’: File exists\r\n"
     ]
    }
   ],
   "source": [
    "mkdir ~/data/ncbi\n",
    "vdb-config -s /repository/user/main/public/root=~/data/ncb"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "/home/luna.kuleuven.be/r0363211/data/work\r\n"
     ]
    }
   ],
   "source": [
    "pwd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": []
    }
   ],
   "source": [
    "mkdir /home/luna.kuleuven.be/r0363211/data/work"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "cd /home/luna.kuleuven.be/r0363211/data/work\n",
    "pwd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "fastq-dump --split-files SRR2919449\n",
    "fastq-dump --split-files SRR2919450\n",
    "fastq-dump --split-files SRR2919451\n",
    "fastq-dump --split-files SRR2919452"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "/home/luna.kuleuven.be/r0363211/data/work\r\n"
     ]
    }
   ],
   "source": [
    "pwd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "~\t\t\t    DMSO_rep2.SJ.out.tab\r\n",
      "all.counts\t\t    gencode.v19.nopseudo.plus.sort.chr21.gtf\r\n",
      "all.counts.summary\t    SRR2919449_1.fastq\r\n",
      "all.gene.counts\t\t    SRR2919449_1_fastqc.html\r\n",
      "all.genedata.tsv\t    SRR2919449_1_fastqc.zip\r\n",
      "DESeq2-results-table.txt    XX650_23_rep1.Log.final.out\r\n",
      "deseq.results.tsv\t    XX650_23_rep1.Log.out\r\n",
      "DMSO_rep1.Log.final.out     XX650_23_rep1.Log.progress.out\r\n",
      "DMSO_rep1.Log.out\t    XX650_23_rep1.SJ.out.tab\r\n",
      "DMSO_rep1.Log.progress.out  XX650_23_rep2.Log.final.out\r\n",
      "DMSO_rep1.SJ.out.tab\t    XX650_23_rep2.Log.out\r\n",
      "DMSO_rep2.Log.final.out     XX650_23_rep2.Log.progress.out\r\n",
      "DMSO_rep2.Log.out\t    XX650_23_rep2.SJ.out.tab\r\n",
      "DMSO_rep2.Log.progress.out\r\n"
     ]
    }
   ],
   "source": [
    "ls"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Here, one of the FASTQC reports is shown (figure 1)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Started analysis of SRR2919449_1.fastq\r\n",
      "Approx 5% complete for SRR2919449_1.fastq\r\n",
      "Approx 10% complete for SRR2919449_1.fastq\r\n",
      "Approx 15% complete for SRR2919449_1.fastq\r\n",
      "Approx 20% complete for SRR2919449_1.fastq\r\n",
      "Approx 25% complete for SRR2919449_1.fastq\r\n",
      "Approx 30% complete for SRR2919449_1.fastq\r\n",
      "Approx 35% complete for SRR2919449_1.fastq\r\n",
      "Approx 40% complete for SRR2919449_1.fastq\r\n",
      "Approx 45% complete for SRR2919449_1.fastq\r\n",
      "Approx 50% complete for SRR2919449_1.fastq\r\n",
      "Approx 55% complete for SRR2919449_1.fastq\r\n",
      "Approx 60% complete for SRR2919449_1.fastq\r\n",
      "Approx 65% complete for SRR2919449_1.fastq\r\n",
      "Approx 70% complete for SRR2919449_1.fastq\r\n",
      "Approx 75% complete for SRR2919449_1.fastq\r\n",
      "Approx 80% complete for SRR2919449_1.fastq\r\n",
      "Approx 85% complete for SRR2919449_1.fastq\r\n",
      "Approx 90% complete for SRR2919449_1.fastq\r\n",
      "Approx 95% complete for SRR2919449_1.fastq\r\n",
      "Analysis complete for SRR2919449_1.fastq\r\n"
     ]
    }
   ],
   "source": [
    "/usr/local/bin/FastQC/fastqc -o . SRR2919449_1.fastq"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "figure 1\n",
    "\n",
    "<img width=\"100%\" src=\"/user/r0363211/files/fastq%20control.jpg\">"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Dec 18 10:54:50 ..... started STAR run\r\n",
      "Dec 18 10:54:50 ..... loading genome\r\n",
      "Dec 18 10:54:51 ..... started mapping\r\n",
      "Dec 18 11:31:36 ..... finished successfully\r\n"
     ]
    }
   ],
   "source": [
    "STAR --genomeDir /mnt/nfs/mfiers/STAR/hg19_star_db \\\n",
    "     --genomeLoad LoadAndKeep \\\n",
    "     --runThreadN 2 \\\n",
    "     --readFilesIn SRR2919449_1.fastq \\\n",
    "     --outFileNamePrefix DMSO_rep1."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Dec 18 11:35:34 ..... started STAR run\r\n",
      "Dec 18 11:35:34 ..... loading genome\r\n",
      "Dec 18 11:35:34 ..... started mapping\r\n",
      "Dec 18 12:20:08 ..... finished successfully\r\n"
     ]
    }
   ],
   "source": [
    "STAR --genomeDir /mnt/nfs/mfiers/STAR/hg19_star_db \\\n",
    "     --genomeLoad LoadAndKeep \\\n",
    "     --runThreadN 2 \\\n",
    "     --readFilesIn SRR2919450_1.fastq \\\n",
    "     --outFileNamePrefix DMSO_rep2."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Dec 18 13:19:13 ..... started STAR run\r\n",
      "Dec 18 13:19:13 ..... loading genome\r\n",
      "Dec 18 13:19:13 ..... started mapping\r\n",
      "Dec 18 13:59:30 ..... finished successfully\r\n"
     ]
    }
   ],
   "source": [
    "STAR --genomeDir /mnt/nfs/mfiers/STAR/hg19_star_db \\\n",
    "     --genomeLoad LoadAndKeep \\\n",
    "     --runThreadN 2 \\\n",
    "     --readFilesIn SRR2919451_1.fastq \\\n",
    "     --outFileNamePrefix XX650_23_rep1."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Dec 18 14:00:20 ..... started STAR run\r\n",
      "Dec 18 14:00:20 ..... loading genome\r\n",
      "Dec 18 14:00:20 ..... started mapping\r\n",
      "Dec 18 14:36:37 ..... finished successfully\r\n"
     ]
    }
   ],
   "source": [
    "STAR --genomeDir /mnt/nfs/mfiers/STAR/hg19_star_db \\\n",
    "     --genomeLoad LoadAndKeep \\\n",
    "     --runThreadN 2 \\\n",
    "     --readFilesIn SRR2919452_1.fastq \\\n",
    "     --outFileNamePrefix XX650_23_rep2."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "~\t\t\t    SRR2919453_1.fastq\r\n",
      "DMSO_rep1.Aligned.out.sam   SRR2919454_1.fastq\r\n",
      "DMSO_rep1.Log.final.out     SRR2919455_1.fastq\r\n",
      "DMSO_rep1.Log.out\t    SRR2919456_1.fastq\r\n",
      "DMSO_rep1.Log.progress.out  XX650_23_rep1.Aligned.out.sam\r\n",
      "DMSO_rep1.SJ.out.tab\t    XX650_23_rep1.Log.final.out\r\n",
      "DMSO_rep2.Aligned.out.sam   XX650_23_rep1.Log.out\r\n",
      "DMSO_rep2.Log.final.out     XX650_23_rep1.Log.progress.out\r\n",
      "DMSO_rep2.Log.out\t    XX650_23_rep1.SJ.out.tab\r\n",
      "DMSO_rep2.Log.progress.out  XX650_23_rep2.Aligned.out.sam\r\n",
      "DMSO_rep2.SJ.out.tab\t    XX650_23_rep2.Log.final.out\r\n",
      "SRR2919449_1.fastq\t    XX650_23_rep2.Log.out\r\n",
      "SRR2919450_1.fastq\t    XX650_23_rep2.Log.progress.out\r\n",
      "SRR2919451_1.fastq\t    XX650_23_rep2.SJ.out.tab\r\n",
      "SRR2919452_1.fastq\r\n"
     ]
    }
   ],
   "source": [
    "ls"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[bam_sort_core] merging from 39 files...\r\n"
     ]
    }
   ],
   "source": [
    "samtools sort -o DMSO_rep1.bam DMSO_rep1.Aligned.out.sam"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": []
    }
   ],
   "source": [
    "samtools index DMSO_rep1.bam"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[bam_sort_core] merging from 46 files...\r\n"
     ]
    }
   ],
   "source": [
    "samtools sort -o DMSO_rep2.bam DMSO_rep2.Aligned.out.sam"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": []
    }
   ],
   "source": [
    "samtools index DMSO_rep2.bam"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": []
    }
   ],
   "source": [
    "samtools sort -o XX650_23_rep1.bam XX650_23_rep1.Aligned.out.sam"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": []
    }
   ],
   "source": [
    "samtools index XX650_23_rep1.bam"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[bam_sort_core] merging from 36 files...\r\n"
     ]
    }
   ],
   "source": [
    "samtools sort -o XX650_23_rep2.bam XX650_23_rep2.Aligned.out.sam"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": []
    }
   ],
   "source": [
    "samtools index XX650_23_rep2.bam"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "lrwxrwxrwx 1 r0363211 domain users 71 dec 18 17:32 gencode.v19.nopseudo.plus.sort.chr21.gtf -> /mnt/nfs/data/RNA-seq/GSE47042/gencode.v19.nopseudo.plus.sort.chr21.gtf\r\n"
     ]
    }
   ],
   "source": [
    "ln -sf /mnt/nfs/data/RNA-seq/GSE47042/*.gtf /home/luna.kuleuven.be/r0363211/data/work\n",
    "ls -l *gtf"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "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[32mS\u001b[36m DMSO_rep1.bam\u001b[0m \u001b[0m                                 ||\r\n",
      "||                           \u001b[32mS\u001b[36m DMSO_rep2.bam\u001b[0m \u001b[0m                                 ||\r\n",
      "||                           \u001b[32mS\u001b[36m XX650_23_rep1.bam\u001b[0m \u001b[0m                             ||\r\n",
      "||                           \u001b[32mS\u001b[36m XX650_23_rep1.bam\u001b[0m \u001b[0m                             ||\r\n",
      "||  \u001b[0m                                                                          ||\r\n",
      "||             Output file : \u001b[36mall.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 DMSO_rep1.bam... \u001b[0m                                         ||\r\n",
      "||    Single-end reads are included. \u001b[0m                                         ||\r\n",
      "||    Assign reads to features... \u001b[0m                                            ||\r\n",
      "||    Total reads : \u001b[36m93302255\u001b[0m \u001b[0m                                                 ||\r\n",
      "||    Successfully assigned reads : \u001b[36m68211360 (73.1%)\u001b[0m \u001b[0m                         ||\r\n",
      "||    Running time : \u001b[36m2.38 minutes\u001b[0m \u001b[0m                                            ||\r\n",
      "||  \u001b[0m                                                                          ||\r\n",
      "|| Process BAM file DMSO_rep2.bam... \u001b[0m                                         ||\r\n",
      "||    Single-end reads are included. \u001b[0m                                         ||\r\n",
      "||    Assign reads to features... \u001b[0m                                            ||\r\n",
      "||    Total reads : \u001b[36m110965760\u001b[0m \u001b[0m                                                ||\r\n",
      "||    Successfully assigned reads : \u001b[36m81022124 (73.0%)\u001b[0m \u001b[0m                         ||\r\n",
      "||    Running time : \u001b[36m2.85 minutes\u001b[0m \u001b[0m                                            ||\r\n",
      "||  \u001b[0m                                                                          ||\r\n",
      "|| Process BAM file XX650_23_rep1.bam... \u001b[0m                                     ||\r\n",
      "||    Single-end reads are included. \u001b[0m                                         ||\r\n",
      "||    Assign reads to features... \u001b[0m                                            ||\r\n",
      "||    Total reads : \u001b[36m99227920\u001b[0m \u001b[0m                                                 ||\r\n",
      "||    Successfully assigned reads : \u001b[36m70801662 (71.4%)\u001b[0m \u001b[0m                         ||\r\n",
      "||    Running time : \u001b[36m2.56 minutes\u001b[0m \u001b[0m                                            ||\r\n",
      "||  \u001b[0m                                                                          ||\r\n",
      "|| Process BAM file XX650_23_rep1.bam... \u001b[0m                                     ||\r\n",
      "||    Single-end reads are included. \u001b[0m                                         ||\r\n",
      "||    Assign reads to features... \u001b[0m                                            ||\r\n",
      "||    Total reads : \u001b[36m99227920\u001b[0m \u001b[0m                                                 ||\r\n",
      "||    Successfully assigned reads : \u001b[36m70801662 (71.4%)\u001b[0m \u001b[0m                         ||\r\n",
      "||    Running time : \u001b[36m2.56 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.counts \\\n",
    "  DMSO_rep1.bam DMSO_rep2.bam XX650_23_rep1.bam XX650_23_rep1.bam"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "# Program:featureCounts v1.5.0-p1; Command:\"featureCounts\" \"-Q\" \"10\" \"-g\" \"gene_name\" \"-a\" \"/mnt/nfs/data/RNA-seq/gencode.v19.nopseudo.plus.sort.gtf\" \"-o\" \"all.counts\" \"DMSO_rep1.bam\" \"DMSO_rep2.bam\" \"XX650_23_rep1.bam\" \"XX650_23_rep1.bam\" \r\n",
      "Geneid\tChr\tStart\tEnd\tStrand\tLength\tDMSO_rep1.bam\tDMSO_rep2.bam\tXX650_23_rep1.bam\tXX650_23_rep1.bam\r\n",
      "MIR1302-11\tchr1;chr1;chr1\t29554;30267;30976\t30039;30667;31109\t+;+;+\t1021\t2\t1\t0\t0\r\n",
      "FAM138A\tchr1;chr1;chr1\t34554;35245;35721\t35174;35481;36081\t-;-;-\t1219\t0\t0\t2\t2\r\n",
      "OR4F5\tchr1\t69091\t70008\t+\t918\t0\t0\t0\t0\r\n",
      "RP11-34P13.7\tchr1;chr1;chr1;chr1;chr1;chr1;chr1\t89295;92091;110953;112700;120721;129055;133374\t91629;92240;111357;112804;120932;129223;133566\t-;-;-;-;-;-;-\t3569\t36\t27\t29\t29\r\n",
      "RP11-34P13.8\tchr1;chr1\t89551;90287\t90050;91105\t-;-\t1319\t0\t0\t0\t0\r\n",
      "AL627309.1\tchr1;chr1\t134901;137621\t135802;139379\t-;-\t2661\t1654\t1867\t2174\t2174\r\n",
      "RP11-34P13.14\tchr1;chr1\t139790;140075\t139847;140339\t-;-\t323\t3\t3\t5\t5\r\n",
      "RP11-34P13.13\tchr1;chr1;chr1;chr1;chr1;chr1;chr1;chr1;chr1;chr1\t141474;146386;155767;164263;165884;168100;168610;169049;172557;173753\t143011;149707;155831;164791;165942;168165;168767;169264;172688;173862\t-;-;-;-;-;-;-;-;-;-\t6195\t22\t58\t124\t124\r\n"
     ]
    }
   ],
   "source": [
    "head all.counts"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": []
    }
   ],
   "source": [
    "cut -f-6 all.counts > all.genedata.tsv"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "# Program:featureCounts v1.5.0-p1; Command:\"featureCounts\" \"-Q\" \"10\" \"-g\" \"gene_name\" \"-a\" \"/mnt/nfs/data/RNA-seq/gencode.v19.nopseudo.plus.sort.gtf\" \"-o\" \"all.counts\" \"DMSO_rep1.bam\" \"DMSO_rep2.bam\" \"XX650_23_rep1.bam\" \"XX650_23_rep1.bam\" \r\n",
      "Geneid\tChr\tStart\tEnd\tStrand\tLength\r\n",
      "MIR1302-11\tchr1;chr1;chr1\t29554;30267;30976\t30039;30667;31109\t+;+;+\t1021\r\n",
      "FAM138A\tchr1;chr1;chr1\t34554;35245;35721\t35174;35481;36081\t-;-;-\t1219\r\n",
      "OR4F5\tchr1\t69091\t70008\t+\t918\r\n",
      "RP11-34P13.7\tchr1;chr1;chr1;chr1;chr1;chr1;chr1\t89295;92091;110953;112700;120721;129055;133374\t91629;92240;111357;112804;120932;129223;133566\t-;-;-;-;-;-;-\t3569\r\n",
      "RP11-34P13.8\tchr1;chr1\t89551;90287\t90050;91105\t-;-\t1319\r\n",
      "AL627309.1\tchr1;chr1\t134901;137621\t135802;139379\t-;-\t2661\r\n",
      "RP11-34P13.14\tchr1;chr1\t139790;140075\t139847;140339\t-;-\t323\r\n",
      "RP11-34P13.13\tchr1;chr1;chr1;chr1;chr1;chr1;chr1;chr1;chr1;chr1\t141474;146386;155767;164263;165884;168100;168610;169049;172557;173753\t143011;149707;155831;164791;165942;168165;168767;169264;172688;173862\t-;-;-;-;-;-;-;-;-;-\t6195\r\n"
     ]
    }
   ],
   "source": [
    "head all.genedata.tsv"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": []
    }
   ],
   "source": [
    "cut -f1,7- all.counts | grep -v '^#' > all.gene.counts"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Geneid\tDMSO_rep1.bam\tDMSO_rep2.bam\tXX650_23_rep1.bam\tXX650_23_rep1.bam\r\n",
      "MIR1302-11\t2\t1\t0\t0\r\n",
      "FAM138A\t0\t0\t2\t2\r\n",
      "OR4F5\t0\t0\t0\t0\r\n",
      "RP11-34P13.7\t36\t27\t29\t29\r\n",
      "RP11-34P13.8\t0\t0\t0\t0\r\n",
      "AL627309.1\t1654\t1867\t2174\t2174\r\n",
      "RP11-34P13.14\t3\t3\t5\t5\r\n",
      "RP11-34P13.13\t22\t58\t124\t124\r\n",
      "RNU6-1100P\t0\t0\t0\t0\r\n"
     ]
    }
   ],
   "source": [
    "head all.gene.counts"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## RNA-seq analysis"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "First, we contructed a heatmap using Multiexperiment Viewer (MeV). There is clearly a difference in gene expression between DMSO-treated and XX-650-23-treated cells. This is a first indication that XX-650-23 indeed interferes with the CREB-related transcription of genes. Here the top of 20 affected genes is showed (figure 2)."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "figure 2\n",
    "\n",
    "<img width=\"100%\" src=\"/user/r0363211/files/heatmap.jpg\">"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "In order to know in which processes these genes play a role, we performed a Gene Ontology analysis using GORilla (figure 3). The top processes involved are response to endoplasmic reticulum stress, single-organism developmental process and regulation of apoptotic process. This last one is in line with the article, since there, the stress is on the link between CREB and survival and proliferation of AML cells. Therefore, in the article, the main focus were genes encoding proteins involved in proliferation and DNA/RNA replication. Proliferation was also found in the list of gene ontologies as shown below (figure 3). "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "figure 3\n",
    "\n",
    "<img width=\"100%\" src=\"/user/r0363211/files/GORilla.jpg\">"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "For deeper analysis, we tried to confirm the differential expression of genes found in the article. Here, we checked the gene counts of the genes discussed in the article. We can see some drastic changes in gene counts in DMSO-treated versus XX-650-23-treated cells. (colums are DMSO_rep1; DMSO_rep2; XX-650-23_rep1; XX-650-23_rep2)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "POLD2\t27460\t29819\t21400\t21400\r\n",
      "ANAPC2\t4274\t5454\t3148\t3148\r\n",
      "GNL3\t15886\t17716\t11079\t11079\r\n",
      "GNL3L\t1149\t2091\t1444\t1444\r\n",
      "ODF2L\t663\t885\t824\t824\r\n",
      "ODF2\t10858\t12812\t9332\t9332\r\n",
      "DTYMK\t4463\t5108\t2377\t2377\r\n",
      "FOSL1\t2941\t3289\t668\t668\r\n",
      "RECQL4\t14085\t16639\t6999\t6999\r\n"
     ]
    }
   ],
   "source": [
    "grep POLD2 all.gene.counts\n",
    "grep ANAPC2 all.gene.counts\n",
    "grep GNL3 all.gene.counts\n",
    "grep ODF2 all.gene.counts\n",
    "grep DTYMK all.gene.counts\n",
    "grep FOSL1 all.gene.counts\n",
    "grep RECQL4 all.gene.counts"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Using DESEQ-analysis, we could confirm the significant differential expression of the genes discussed in the article (jupyternotebook \"DESEQ for task bioinformatics\"). These genes indeed encode proteins involved in proliferation and DNA/RNA replication (figure 4). "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "figure 4\n",
    "\n",
    "<img width=\"100%\" src=\"/user/r0363211/files/creb%20affected%20genes%201.jpg\">"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Next, we also looked at other genes known to be regulated by CREB and found that PER1,PER2 and VGF, also have a significant lower expression after XX-650-23 treatment (figure 5). These genes encode proteins involved in maintenance of circadian rhythms and regulation of energy homeostasis."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "figure 5\n",
    "<img width=\"100%\" src=\"/user/r0363211/files/creb%20affected%20genes%202.jpg\">"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We chose two of the discussed proteins for visualization in IGV. FOSL1 and DTYMK clearly have less coverage in the XX-650-23 treated condition compared to DMSO treatment. Since these genes are involved in cell proliferation and RNA replication respectively, this is in line with the lower proliferation of XX-650-23 treated cells (figure 6 and figure 7 respectively)."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "figure 6\n",
    "<img width=\"100%\" src=\"/user/r0363211/files/FOSL1%20IGV.jpg\">"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "figure 7\n",
    "<img width=\"100%\" src=\"/user/r0363211/files/DTYMK%20IGV.jpg\">"
   ]
  }
 ],
 "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
}
