{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Generating Coverage Tracks\n", "\n", "In order to visualize my DML tracks in IGV, I need to match these features to the actual sample tracks. Since they are only 1x coverage, bedGraphs will not work. I will generate 5x tracks for all sample coverage files so I can use them in IGV.\n", "\n", "Methods:\n", "\n", "0. Prepare for Analyses\n", "1. Obtain Coverage Files\n", "3. Create 5x Bedgraphs" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 0. Prepare for Analyses" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 0a. Set Working Directory" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "'/Users/yaamini/Documents/paper-gonad-meth/code'" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pwd" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "/Users/yaamini/Documents/paper-gonad-meth/analyses\n" ] } ], "source": [ "cd ../analyses/" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": true }, "outputs": [], "source": [ "!mkdir 2019-03-07-IGV-Verification" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false, "scrolled": true }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "/Users/yaamini/Documents/paper-gonad-meth/analyses/2019-03-07-IGV-Verification\n" ] } ], "source": [ "cd 2019-03-07-IGV-Verification/" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 1. Obtain Coverage Files" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The file are in [this folder](http://gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/). I'll use `wget` to download them." ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "--2019-10-15 17:26:11-- http://gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/\n", "Resolving gannet.fish.washington.edu (gannet.fish.washington.edu)... 128.95.149.52\n", "Connecting to gannet.fish.washington.edu (gannet.fish.washington.edu)|128.95.149.52|:80... connected.\n", "HTTP request sent, awaiting response... 301 Moved Permanently\n", "Location: https://gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/ [following]\n", "--2019-10-15 17:26:11-- https://gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/\n", "Connecting to gannet.fish.washington.edu (gannet.fish.washington.edu)|128.95.149.52|:443... connected.\n", "HTTP request sent, awaiting response... 200 OK\n", "Length: unspecified [text/html]\n", "Saving to: ‘gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/index.html.tmp’\n", "\n", "gannet.fish.washing [ <=> ] 61.14K --.-KB/s in 0.003s \n", "\n", "2019-10-15 17:26:13 (23.8 MB/s) - ‘gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/index.html.tmp’ saved [62605]\n", "\n", "Loading robots.txt; please ignore errors.\n", "--2019-10-15 17:26:13-- https://gannet.fish.washington.edu/robots.txt\n", "Reusing existing connection to gannet.fish.washington.edu:443.\n", "HTTP request sent, awaiting response... 404 Not Found\n", "2019-10-15 17:26:13 ERROR 404: Not Found.\n", "\n", "Removing gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/index.html.tmp since it should be rejected.\n", "\n", "--2019-10-15 17:26:13-- https://gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/?C=N;O=D\n", "Reusing existing connection to gannet.fish.washington.edu:443.\n", "HTTP request sent, awaiting response... 200 OK\n", "Length: unspecified [text/html]\n", "Saving to: ‘gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/index.html?C=N;O=D.tmp’\n", "\n", "gannet.fish.washing [ <=> ] 61.14K --.-KB/s in 0.002s \n", "\n", "2019-10-15 17:26:15 (30.2 MB/s) - ‘gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/index.html?C=N;O=D.tmp’ saved [62605]\n", "\n", "Removing gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/index.html?C=N;O=D.tmp since it should be rejected.\n", "\n", "--2019-10-15 17:26:15-- https://gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/?C=M;O=A\n", "Reusing existing connection to gannet.fish.washington.edu:443.\n", "HTTP request sent, awaiting response... 200 OK\n", "Length: unspecified [text/html]\n", "Saving to: ‘gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/index.html?C=M;O=A.tmp’\n", "\n", "gannet.fish.washing [ <=> ] 61.14K --.-KB/s in 0.002s \n", "\n", "2019-10-15 17:26:16 (28.2 MB/s) - ‘gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/index.html?C=M;O=A.tmp’ saved [62605]\n", "\n", "Removing gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/index.html?C=M;O=A.tmp since it should be rejected.\n", "\n", "--2019-10-15 17:26:16-- https://gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/?C=S;O=A\n", "Reusing existing connection to gannet.fish.washington.edu:443.\n", "HTTP request sent, awaiting response... 200 OK\n", "Length: unspecified [text/html]\n", "Saving to: ‘gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/index.html?C=S;O=A.tmp’\n", "\n", "gannet.fish.washing [ <=> ] 61.14K --.-KB/s in 0.002s \n", "\n", "2019-10-15 17:26:18 (33.8 MB/s) - ‘gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/index.html?C=S;O=A.tmp’ saved [62605]\n", "\n", "Removing gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/index.html?C=S;O=A.tmp since it should be rejected.\n", "\n", "--2019-10-15 17:26:18-- https://gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/?C=D;O=A\n", "Reusing existing connection to gannet.fish.washington.edu:443.\n", "HTTP request sent, awaiting response... 200 OK\n", "Length: unspecified [text/html]\n", "Saving to: ‘gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/index.html?C=D;O=A.tmp’\n", "\n", "gannet.fish.washing [ <=> ] 61.14K --.-KB/s in 0.002s \n", "\n", "2019-10-15 17:26:19 (26.1 MB/s) - ‘gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/index.html?C=D;O=A.tmp’ saved [62605]\n", "\n", "Removing gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/index.html?C=D;O=A.tmp since it should be rejected.\n", "\n", "--2019-10-15 17:26:19-- https://gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/@eaDir/\n", "Reusing existing connection to gannet.fish.washington.edu:443.\n", "HTTP request sent, awaiting response... 200 OK\n", "Length: unspecified [text/html]\n", "Saving to: ‘gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/@eaDir/index.html.tmp’\n", "\n", "gannet.fish.washing [ <=> ] 64.35K --.-KB/s in 0.002s \n", "\n", "2019-10-15 17:26:20 (28.0 MB/s) - ‘gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/@eaDir/index.html.tmp’ saved [65897]\n", "\n", "Removing gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/@eaDir/index.html.tmp since it should be rejected.\n", "\n", "--2019-10-15 17:26:20-- https://gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/zr2096_1_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov.gz\n", "Reusing existing connection to gannet.fish.washington.edu:443.\n", "HTTP request sent, awaiting response... 200 OK\n", "Length: 28329823 (27M) [application/x-gzip]\n", "Saving to: ‘gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/zr2096_1_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov.gz’\n", "\n", "gannet.fish.washing 100%[===================>] 27.02M 71.8MB/s in 0.4s \n", "\n", "2019-10-15 17:26:20 (71.8 MB/s) - ‘gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/zr2096_1_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov.gz’ saved [28329823/28329823]\n", "\n", "--2019-10-15 17:26:20-- https://gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/zr2096_2_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov.gz\n", "Reusing existing connection to gannet.fish.washington.edu:443.\n", "HTTP request sent, awaiting response... 200 OK\n", "Length: 35812992 (34M) [application/x-gzip]\n", "Saving to: ‘gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/zr2096_2_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov.gz’\n", "\n", "gannet.fish.washing 100%[===================>] 34.15M 79.8MB/s in 0.4s \n", "\n", "2019-10-15 17:26:21 (79.8 MB/s) - ‘gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/zr2096_2_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov.gz’ saved [35812992/35812992]\n", "\n", "--2019-10-15 17:26:21-- https://gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/zr2096_3_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov.gz\n", "Reusing existing connection to gannet.fish.washington.edu:443.\n", "HTTP request sent, awaiting response... 200 OK\n", "Length: 32597990 (31M) [application/x-gzip]\n", "Saving to: ‘gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/zr2096_3_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov.gz’\n", "\n", "gannet.fish.washing 100%[===================>] 31.09M 97.3MB/s in 0.3s \n", "\n", "2019-10-15 17:26:21 (97.3 MB/s) - ‘gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/zr2096_3_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov.gz’ saved [32597990/32597990]\n", "\n", "--2019-10-15 17:26:21-- https://gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/zr2096_4_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov.gz\n", "Reusing existing connection to gannet.fish.washington.edu:443.\n", "HTTP request sent, awaiting response... 200 OK\n", "Length: 38294540 (37M) [application/x-gzip]\n", "Saving to: ‘gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/zr2096_4_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov.gz’\n", "\n", "gannet.fish.washing 100%[===================>] 36.52M 53.5MB/s in 0.7s \n", "\n", "2019-10-15 17:26:22 (53.5 MB/s) - ‘gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/zr2096_4_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov.gz’ saved [38294540/38294540]\n", "\n", "--2019-10-15 17:26:22-- https://gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/zr2096_5_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov.gz\n", "Reusing existing connection to gannet.fish.washington.edu:443.\n", "HTTP request sent, awaiting response... 200 OK\n", "Length: 42883763 (41M) [application/x-gzip]\n", "Saving to: ‘gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/zr2096_5_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov.gz’\n", "\n", "gannet.fish.washing 100%[===================>] 40.90M 59.1MB/s in 0.7s \n", "\n", "2019-10-15 17:26:23 (59.1 MB/s) - ‘gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/zr2096_5_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov.gz’ saved [42883763/42883763]\n", "\n", "--2019-10-15 17:26:23-- https://gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/zr2096_6_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov.gz\n", "Reusing existing connection to gannet.fish.washington.edu:443.\n", "HTTP request sent, awaiting response... 200 OK\n", "Length: 37380127 (36M) [application/x-gzip]\n", "Saving to: ‘gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/zr2096_6_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov.gz’\n", "\n", "gannet.fish.washing 100%[===================>] 35.65M 95.8MB/s in 0.4s \n", "\n", "2019-10-15 17:26:23 (95.8 MB/s) - ‘gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/zr2096_6_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov.gz’ saved [37380127/37380127]\n", "\n", "--2019-10-15 17:26:23-- https://gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/zr2096_7_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov.gz\n", "Reusing existing connection to gannet.fish.washington.edu:443.\n", "HTTP request sent, awaiting response... 200 OK\n", "Length: 39925200 (38M) [application/x-gzip]\n", "Saving to: ‘gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/zr2096_7_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov.gz’\n", "\n", "gannet.fish.washing 100%[===================>] 38.08M 77.9MB/s in 0.5s \n", "\n", "2019-10-15 17:26:24 (77.9 MB/s) - ‘gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/zr2096_7_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov.gz’ saved [39925200/39925200]\n", "\n", "--2019-10-15 17:26:24-- https://gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/zr2096_8_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov.gz\n", "Reusing existing connection to gannet.fish.washington.edu:443.\n", "HTTP request sent, awaiting response... 200 OK\n", "Length: 38558083 (37M) [application/x-gzip]\n", "Saving to: ‘gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/zr2096_8_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov.gz’\n", "\n", "gannet.fish.washing 100%[===================>] 36.77M 87.9MB/s in 0.4s \n", "\n", "2019-10-15 17:26:24 (87.9 MB/s) - ‘gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/zr2096_8_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov.gz’ saved [38558083/38558083]\n", "\n", "--2019-10-15 17:26:24-- https://gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/zr2096_9_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov.gz\n", "Reusing existing connection to gannet.fish.washington.edu:443.\n", "HTTP request sent, awaiting response... 200 OK\n", "Length: 32715335 (31M) [application/x-gzip]\n", "Saving to: ‘gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/zr2096_9_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov.gz’\n", "\n", "gannet.fish.washing 100%[===================>] 31.20M 96.9MB/s in 0.3s \n", "\n", "2019-10-15 17:26:24 (96.9 MB/s) - ‘gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/zr2096_9_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov.gz’ saved [32715335/32715335]\n", "\n", "--2019-10-15 17:26:24-- https://gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/zr2096_10_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov.gz\n", "Reusing existing connection to gannet.fish.washington.edu:443.\n", "HTTP request sent, awaiting response... 200 OK\n", "Length: 30809584 (29M) [application/x-gzip]\n", "Saving to: ‘gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/zr2096_10_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov.gz’\n", "\n", "gannet.fish.washing 100%[===================>] 29.38M 66.2MB/s in 0.4s \n", "\n", "2019-10-15 17:26:25 (66.2 MB/s) - ‘gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/zr2096_10_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov.gz’ saved [30809584/30809584]\n", "\n", "FINISHED --2019-10-15 17:26:25--\n", "Total wall clock time: 14s\n", "Downloaded: 16 files, 341M in 4.6s (74.9 MB/s)\n" ] } ], "source": [ "#Download files from gannet. The files will be downloaded in the same directory structure they are in online.\n", "!wget -r -l1 --no-parent -A.deduplicated.bismark.cov.gz \\\n", "http://gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "collapsed": false }, "outputs": [], "source": [ "#Move all files from gannet folder to the current directory\n", "!mv gannet.fish.washington.edu/spartina/2018-10-10-project-virginica-oa-Large-Files/2018-11-07-Bismark-Mox/* ." ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "2019-03-07-DML-and-DMR-Visualization.xml\r\n", "2019-03-07-checksums.sha\r\n", "\u001b[34m@eaDir\u001b[m\u001b[m\r\n", "\u001b[34mgannet.fish.washington.edu\u001b[m\u001b[m\r\n", "zr2096_10_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov.gz\r\n", "zr2096_1_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov.gz\r\n", "zr2096_2_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov.gz\r\n", "zr2096_3_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov.gz\r\n", "zr2096_4_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov.gz\r\n", "zr2096_5_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov.gz\r\n", "zr2096_6_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov.gz\r\n", "zr2096_7_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov.gz\r\n", "zr2096_8_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov.gz\r\n", "zr2096_9_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov.gz\r\n" ] } ], "source": [ "#Confirm all files were moved\n", "!ls" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "collapsed": true }, "outputs": [], "source": [ "#Remove the empty gannet directory\n", "!rm -r gannet.fish.washington.edu" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "collapsed": false }, "outputs": [], "source": [ "#Unzip the coverage files\n", "!gunzip *cov.gz" ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "zr2096_10_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov\r\n", "zr2096_1_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov\r\n", "zr2096_2_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov\r\n", "zr2096_3_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov\r\n", "zr2096_4_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov\r\n", "zr2096_5_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov\r\n", "zr2096_6_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov\r\n", "zr2096_7_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov\r\n", "zr2096_8_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov\r\n", "zr2096_9_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov\r\n" ] } ], "source": [ "#Confirm files were unzipped\n", "!ls *cov" ] }, { "cell_type": "code", "execution_count": 11, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "NC_007175.2\t49\t49\t0\t0\t5\r\n" ] } ], "source": [ "#See what the file looks like\n", "!head -n 1 zr2096_10_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Create 5x Tracks" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "I will replicate the above process to get tracks with 5x coverage. Claire and Mac have used 5x coverage, so I want to see what my data looks like here." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Percent Methylation Only" ] }, { "cell_type": "code", "execution_count": 18, "metadata": { "collapsed": true }, "outputs": [], "source": [ "%%bash\n", "for f in *.cov\n", "do\n", " awk '{print $1, $2-1, $2, $4, $5+$6}' ${f} | awk '{if ($5 >= 5) { print $1, $2-1, $2, $4 }}' \\\n", "> ${f}_5x.bedgraph\n", "done" ] }, { "cell_type": "code", "execution_count": 19, "metadata": { "collapsed": false, "scrolled": true }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "zr2096_10_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov_5x.bedgraph\r\n", "zr2096_1_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov_5x.bedgraph\r\n", "zr2096_2_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov_5x.bedgraph\r\n", "zr2096_3_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov_5x.bedgraph\r\n", "zr2096_4_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov_5x.bedgraph\r\n", "zr2096_5_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov_5x.bedgraph\r\n", "zr2096_6_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov_5x.bedgraph\r\n", "zr2096_7_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov_5x.bedgraph\r\n", "zr2096_8_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov_5x.bedgraph\r\n", "zr2096_9_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov_5x.bedgraph\r\n" ] } ], "source": [ "#Confirm 5x tracks were created\n", "!ls *5x.bedgraph" ] }, { "cell_type": "code", "execution_count": 20, "metadata": { "collapsed": false, "scrolled": true }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "NC_007175.2 47 48 5.40540540540541\r\n", "NC_007175.2 49 50 0\r\n", "NC_007175.2 50 51 0\r\n", "NC_007175.2 86 87 0\r\n", "NC_007175.2 87 88 0\r\n", "NC_007175.2 145 146 1.94805194805195\r\n", "NC_007175.2 146 147 2.63157894736842\r\n", "NC_007175.2 191 192 1.72413793103448\r\n", "NC_007175.2 192 193 0\r\n", "NC_007175.2 244 245 1.96078431372549\r\n" ] } ], "source": [ "!head zr2096_7_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov_5x.bedgraph" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Coverage and Percent Methylation" ] }, { "cell_type": "code", "execution_count": 13, "metadata": { "collapsed": true }, "outputs": [], "source": [ "%%bash\n", "for f in *.cov\n", "do\n", " awk '{print $1, $2-1, $2, $4, $5+$6}' ${f} | awk '{if ($5 >= 5) { print $1, $2-1, $2, $4, $5 }}' \\\n", "> ${f}_5x.percentMeth.cov\n", "done" ] }, { "cell_type": "code", "execution_count": 14, "metadata": { "collapsed": false, "scrolled": true }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "zr2096_10_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov_5x.percentMeth.cov\r\n", "zr2096_1_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov_5x.percentMeth.cov\r\n", "zr2096_2_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov_5x.percentMeth.cov\r\n", "zr2096_3_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov_5x.percentMeth.cov\r\n", "zr2096_4_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov_5x.percentMeth.cov\r\n", "zr2096_5_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov_5x.percentMeth.cov\r\n", "zr2096_6_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov_5x.percentMeth.cov\r\n", "zr2096_7_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov_5x.percentMeth.cov\r\n", "zr2096_8_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov_5x.percentMeth.cov\r\n", "zr2096_9_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov_5x.percentMeth.cov\r\n" ] } ], "source": [ "#Confirm 5x tracks were created\n", "!ls *5x.percentMeth.cov" ] }, { "cell_type": "code", "execution_count": 15, "metadata": { "collapsed": false, "scrolled": true }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "NC_007175.2 47 48 5.40540540540541 37\r\n", "NC_007175.2 49 50 0 40\r\n", "NC_007175.2 50 51 0 5\r\n", "NC_007175.2 86 87 0 78\r\n", "NC_007175.2 87 88 0 53\r\n", "NC_007175.2 145 146 1.94805194805195 154\r\n", "NC_007175.2 146 147 2.63157894736842 38\r\n", "NC_007175.2 191 192 1.72413793103448 116\r\n", "NC_007175.2 192 193 0 22\r\n", "NC_007175.2 244 245 1.96078431372549 153\r\n" ] } ], "source": [ "!head zr2096_7_s1_R1_val_1_bismark_bt2_pe.deduplicated.bismark.cov_5x.percentMeth.cov" ] } ], "metadata": { "anaconda-cloud": {}, "kernelspec": { "display_name": "Python [default]", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.5.2" } }, "nbformat": 4, "nbformat_minor": 1 }