Skip to content

Instantly share code, notes, and snippets.

@dereneaton
Last active Aug 29, 2015
Embed
What would you like to do?
** PERMALINKED **
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"PyRAD manuscript supplementary notebook"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Scripts to fully reproduce all analyses "
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"D.A.R. Eaton (Nov. 12, 2013)\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"------------------------- \n",
"\n",
"This IPython notebook contains a combination of Python, bash and R scripts that describe the full analysis used in the \n",
"pyRAD manuscript. If you wish to execute the scripts yourself you can copy and paste commands from the input cells, \n",
"or you can download this notebook as a .pynb and re-execute all scripts in an IPython notebook of your own. \n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"If you are unfamiliar with IPython notebooks (you are reading one now) you can read more about them [here](http://ipython.org/notebook.html), however I'll \n",
"explain briefly: The default language in any coding cell is _Python_, however other languages can be executed within cells \n",
"as well. An easy way to do this is to designate the language at the beginning of the cell using the __%%__ character. Cells \n",
"which begin with %%bash are executed like a shell script, and those with \"%%R\" execute _R_ scripts, including the ability \n",
"to embed high quality graphics in the output below cells, which is demonstrated near the end of this notebook. Below I use \n",
"the __ls -l__ unix command to check what is in my current working directory. \n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"--------------------------------------- \n",
"\n",
"If you plan to execute scripts in this notebook you will need the following Python modules: \n",
"\n",
"* Numpy \n",
"* Scipy \n",
"* Egglib \n",
"\n",
"In addition you will need PyRAD v.1.64 and Stacks 1.1 or higher (the MYSQL installation is not required). You will also need \n",
"two directories containing the necessary scripts and input files, which are located in a zipped directory in the supplemental \n",
"materials. Unzip this archive and move the contents into your current working directory.\n",
"\n",
"-------------------------------- \n",
"\n",
"You will need to change the location of pyRAD and Stacks in all of the following scripts to reflect its location on your machine.\n",
"\n"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"!ls -l"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"total 400\r\n",
"-rw-rw-r-- 1 deren deren 43695 Dec 2 18:31 PyRAD_STACKS.ipynb\r\n",
"drwxrwxr-x 2 deren deren 4096 Dec 2 18:21 REALDATA\r\n",
"drwxrwxr-x 2 deren deren 4096 Dec 2 18:22 SIMbig\r\n",
"-rw-rw-rw- 1 deren deren 7687 Nov 20 14:14 simradsMANU.py\r\n",
"drwxrwxr-x 2 deren deren 4096 Dec 2 18:23 SIMsmall\r\n"
]
}
],
"prompt_number": 1
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"---------------------------- \n",
"At this point you see there is a .pynb file, which is this Ipython notebook, and also three directories and a python script for \n",
"simulating RADseq data under a coalescent model. This will also create a barcodes output files for each data set. The SIMsmall \n",
"directory contains the params input files for three _PyRAD_ analyses."
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"!ls -l SIMsmall/"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"total 24\r\n",
"-rw-rw-r-- 1 deren deren 4369 Dec 2 18:23 params_high.txt\r\n",
"-rw-rw-r-- 1 deren deren 4370 Dec 2 18:23 params_low.txt\r\n",
"-rw-rw-r-- 1 deren deren 4365 Dec 2 18:24 params_no.txt\r\n"
]
}
],
"prompt_number": 2
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Simulating RAD sequences"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The script simradsMANU.py (included with supplemental materials) uses the _egglib_ module to simulate sequences under a coalescent \n",
"model and then trims them to emulate RADseq-like data. To begin, I simulate three different data sets which I use to compare the \n",
"performance of _PyRAD_ and _Stacks_ on data containing indels. \n",
"\n",
"The first argument to the script is the rate of indel deletions, and the second is whether mutations should arise in the restriction \n",
"recognition site (locus dropout), which I do not use here (set to 0). The third argument is the number of loci to simulate and the \n",
"fourth is the number of individuals to sample per species. The final argument is the name of the output file. Data are simulated on \n",
"a species tree as described in the manuscript text. All other parameters used in the simulation are kept constant, because I am \n",
"primarily interested in examining the effect of indel variation."
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"%%bash\n",
"## you must have the egglib Python module installed to do this step. \n",
"python simradsMANU.py 0.00 0 10000 1 SIMsmall/simRADs_no.fastq\n",
"python simradsMANU.py 0.02 0 10000 1 SIMsmall/simRADs_low.fastq\n",
"python simradsMANU.py 0.05 0 10000 1 SIMsmall/simRADs_high.fastq"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\tsimulating 10000 RAD loci across 12 tip taxa with 1 samples per taxon\n",
"\tindels arise at frequency of 0.000000\n",
"\tmutations in restriction site = False\n",
"\ttheta=4Nu= 0.0014\n",
"\tcreating new barcode map\n",
". . . . . . . . . .\n",
"\tsimulating 10000 RAD loci across 12 tip taxa with 1 samples per taxon\n",
"\tindels arise at frequency of 0.020000\n",
"\tmutations in restriction site = False\n",
"\ttheta=4Nu= 0.0014\n",
"\tcreating new barcode map\n",
". . . . . . . . . .\n",
"\tsimulating 10000 RAD loci across 12 tip taxa with 1 samples per taxon\n",
"\tindels arise at frequency of 0.050000\n",
"\tmutations in restriction site = False\n",
"\ttheta=4Nu= 0.0014\n",
"\tcreating new barcode map\n",
". . . . . . . . . .\n"
]
}
],
"prompt_number": 3
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"--------------- \n",
"\n",
"The raw simulated data are in _fastQ_ format as shown below. With uniformly high quality scores."
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"!head -n12 SIMsmall/simRADs_no.fastq"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"@lane1_fakedata_R1_0 1:N:0:\r\n",
"ATGGATTGCAGTGATATATTCCCATTTCTGGTTCTGGAGATACCCTCGTCCGGGAATCTAACTATCTGTGTCTTTACGGCTGAGGTTGTCCCATTGTATTTCCAGTCTTAG\r\n",
"+\r\n",
"BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB\r\n",
"@lane1_fakedata_R1_1 1:N:0:\r\n",
"ATGGATTGCAGTGATATATTCCCATTTCTGGTTCTGGAGATACCCTCGTCCGGGAATCTAACTATCTGTGTCTTTACGGCTGAGGTTGTCCCATTGTATTTCCAGTCTTAG\r\n",
"+\r\n",
"BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB\r\n",
"@lane1_fakedata_R1_2 1:N:0:\r\n",
"ATGGATTGCAGTGATATATTCCCATTTCTGGTTCTGGAGATACCCTCGTCCGGGAATCTAACTATCTGTGTCTTTACGGCTGAGGTTGTCCCATTGTATTTCCAGTCTTAG\r\n",
"+\r\n",
"BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB\r\n"
]
}
],
"prompt_number": 4
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Small simulated data analysis "
]
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"PyRAD analysis"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Now I run the _PyRAD_ analysis. To begin, I create a different working directory for each analysis, then execute _PyRAD_ on the three \n",
"different params files which point to one of the three working directories, respectively. The following cells will each take some time \n",
"to run. The __time__ command is used to measure how long. And each is run in a separate cell. The params files designate to use parallel \n",
"processing on 12 processors."
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"%%bash\n",
"## create working directories for each PyRAD analysis\n",
"mkdir SIMsmall/Py_no\n",
"mkdir SIMsmall/Py_low\n",
"mkdir SIMsmall/Py_high"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 5
},
{
"cell_type": "heading",
"level": 4,
"metadata": {},
"source": [
"No Indels"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"%time ! ~/pyrad_v.1.62/pyRAD -p SIMsmall/params_no.txt 2> SIMsmall/log.pyno"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"usearch_i86linux32 v6.0.307, 4.0Gb RAM (49.5Gb total), 24 cores\r\n",
"(C) Copyright 2010-12 Robert C. Edgar, all rights reserved.\r\n",
"http://drive5.com/usearch\r\n",
"\r\n",
"Licensed to: daeaton@uchicago.edu\r\n",
"\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\tingroup ['1A0', '1B0', '1C0', '1D0', '2E0', '2F0', '2G0', '2H0', '3I0', '3J0', '3K0', '3L0']\r\n",
"\taddon []\r\n",
"\texclude []\r\n",
"\t"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"..."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"..."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\r\n",
"\tfinal stats written to:\r\n",
"\t /home/deren/Dropbox/PYRADMANU/SIMsmall/Py_no/stats/c85d6m2pN.stats\r\n",
"\toutput files written to:\r\n",
"\t /home/deren/Dropbox/PYRADMANU/SIMsmall/Py_no/outfiles/ directory\r\n",
"\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"CPU times: user 1.92 s, sys: 0.34 s, total: 2.26 s"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"Wall time: 1128.01 s\n"
]
}
],
"prompt_number": 6
},
{
"cell_type": "heading",
"level": 4,
"metadata": {},
"source": [
"Low Indels"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"%time ! ~/pyrad_v.1.62/pyRAD -p SIMsmall/params_low.txt 2> SIMsmall/log.pylow"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"usearch_i86linux32 v6.0.307, 4.0Gb RAM (49.5Gb total), 24 cores\r\n",
"(C) Copyright 2010-12 Robert C. Edgar, all rights reserved.\r\n",
"http://drive5.com/usearch\r\n",
"\r\n",
"Licensed to: daeaton@uchicago.edu\r\n",
"\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\tingroup ['1A0', '1B0', '1C0', '1D0', '2E0', '2F0', '2G0', '2H0', '3I0', '3J0', '3K0', '3L0']\r\n",
"\taddon []\r\n",
"\texclude []\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\t"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
".."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
".."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\r\n",
"\tfinal stats written to:\r\n",
"\t /home/deren/Dropbox/PYRADMANU/SIMsmall/Py_low/stats/c85d6m2pN.stats\r\n",
"\toutput files written to:\r\n",
"\t /home/deren/Dropbox/PYRADMANU/SIMsmall/Py_low/outfiles/ directory\r\n",
"\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"CPU times: user 1.81 s, sys: 0.30 s, total: 2.10 s"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"Wall time: 1112.46 s\n"
]
}
],
"prompt_number": 7
},
{
"cell_type": "heading",
"level": 4,
"metadata": {},
"source": [
"High Indels"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"%time ! ~/pyrad_v.1.62/pyRAD -p SIMsmall/params_high.txt 2> SIMsmall/log.pyhigh"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"usearch_i86linux32 v6.0.307, 4.0Gb RAM (49.5Gb total), 24 cores\r\n",
"(C) Copyright 2010-12 Robert C. Edgar, all rights reserved.\r\n",
"http://drive5.com/usearch\r\n",
"\r\n",
"Licensed to: daeaton@uchicago.edu\r\n",
"\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\tingroup ['1A0', '1B0', '1C0', '1D0', '2E0', '2F0', '2G0', '2H0', '3I0', '3J0', '3K0', '3L0']\r\n",
"\taddon []\r\n",
"\texclude []\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\t"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"..."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
".."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\r\n",
"\tfinal stats written to:\r\n",
"\t /home/deren/Dropbox/PYRADMANU/SIMsmall/Py_high/stats/c85d6m2pN.stats\r\n",
"\toutput files written to:\r\n",
"\t /home/deren/Dropbox/PYRADMANU/SIMsmall/Py_high/outfiles/ directory\r\n",
"\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"CPU times: user 1.73 s, sys: 0.33 s, total: 2.06 s"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"Wall time: 1133.35 s\n"
]
}
],
"prompt_number": 8
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"%%bash\n",
"## The following script removes unneeded files leftover from the analysis to save memory space.\n",
"rm -r SIMsmall/Py_no/fastq/ SIMsmall/Py_no/edits/ \n",
"rm -r SIMsmall/Py_low/fastq/ SIMsmall/Py_low/edits/ \n",
"rm -r SIMsmall/Py_high/fastq/ SIMsmall/Py_high/edits/"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 9
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Stacks Analysis"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Now I run the _Stacks_ analysis. To begin, I create three output directories, one for each analysis."
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"%%bash\n",
"## create working directories for each stacks analysis\n",
"mkdir SIMsmall/stackf_no\n",
"mkdir SIMsmall/stackf_low\n",
"mkdir SIMsmall/stackf_high"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 10
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"I then use process\\_tags to sort reads by their barcodes and then the denovo\\_map.pl pipeline to run the three _Stacks_ analyses. \n",
"Parameter setting used are analagous (as close as possible) to those used in the _PyRAD_ analysis. Because the barcodes were randomly \n",
"generated from the simulation and they must be entered by hand in the stacks script I use the commands below to generate a _Stacks_ input \n",
"script as a .sh file. I show the file and then execute it. "
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"%%bash\n",
"## create a barcode file for stacks analyses\n",
"cut -f 2 SIMsmall/simRADs_no.fastq.barcodes > SIMsmall/simRADs_no.stacks.barcodes\n",
"cut -f 2 SIMsmall/simRADs_low.fastq.barcodes > SIMsmall/simRADs_low.stacks.barcodes\n",
"cut -f 2 SIMsmall/simRADs_high.fastq.barcodes > SIMsmall/simRADs_high.stacks.barcodes"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 11
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"- assemble denovo RADseq data sets using Stacks for each data set. \n",
"- mindepth = m = 2\n",
"- clust.within = M = 13 differences\n",
"- secondary clust = N = M+2\n",
"- across sample clust = n = 15\n",
"- These settings are (close to being) analagous to the .85 clust similarity used in PyRAD given that read length are 100 bp. "
]
},
{
"cell_type": "heading",
"level": 4,
"metadata": {},
"source": [
"No Indels"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"%%bash\n",
"process_radtags -f SIMsmall/simRADs_no.fastq -o SIMsmall/stackf_no/ \\\n",
" -b SIMsmall/simRADs_no.stacks.barcodes -e pstI -E phred33"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Using Phred+33 encoding for quality scores.\n",
"Found 1 input file(s).\n",
"Searching for single-end, inlined barcodes.\n",
"Loaded 12 barcodes (6bp).\n",
"Processing file 1 of 1 [simRADs_no.fastq]\n",
" 2600000 total reads; -200000 ambiguous barcodes; -0 ambiguous RAD-Tags; +0 recovered; -0 low quality reads; 2400000 retained reads.\n",
"Closing files, flushing buffers...\n",
"Outputing details to log: 'SIMsmall/stackf_no/process_radtags.log'\n",
"\n",
"2600000 total sequences;\n",
" 200000 ambiguous barcode drops;\n",
" 0 low quality read drops;\n",
" 0 ambiguous RAD-Tag drops;\n",
"2400000 retained reads.\n"
]
}
],
"prompt_number": 12
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The function below creates the shell script (\".sh\") to run a stacks analysis."
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import glob \n",
"def makestackslist(dset):\n",
" infiles = [\"-s \"+ff+\" \" for ff in glob.glob(\"SIMsmall/stackf_\"+dset+\"/*.fq\")]\n",
" denovo = \"denovo_map.pl -m 2 -M 13 -n 15 -T 12 -b 1 -B 1 -S -X \"+\\\n",
" \"'populations:-m 6' -D 'SIMsmall_no' -o SIMsmall/stackf_\"+dset+\" \"+\"\".join(infiles)\n",
" with open(\"SIMsmall/stacks_\"+dset+\".sh\",'w') as outfile:\n",
" outfile.write(denovo)\n",
" "
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 13
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"makestackslist('no')"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 14
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"For example, the stacks_no.sh script below will run stacks on the data set with no indels."
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"!cat SIMsmall/stacks_no.sh"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"denovo_map.pl -m 2 -M 13 -n 15 -T 12 -b 1 -B 1 -S -X 'populations:-m 6' -D 'SIMsmall_no' -o SIMsmall/stackf_no -s SIMsmall/stackf_no/sample_AAGAGG.fq -s SIMsmall/stackf_no/sample_GAGAGA.fq -s SIMsmall/stackf_no/sample_GGTTTA.fq -s SIMsmall/stackf_no/sample_ATAGTA.fq -s SIMsmall/stackf_no/sample_TAAATG.fq -s SIMsmall/stackf_no/sample_TGAAAT.fq -s SIMsmall/stackf_no/sample_GAGAAT.fq -s SIMsmall/stackf_no/sample_GAGTAT.fq -s SIMsmall/stackf_no/sample_GATAGA.fq -s SIMsmall/stackf_no/sample_ATGGAT.fq -s SIMsmall/stackf_no/sample_TGTAGA.fq -s SIMsmall/stackf_no/sample_ATGGTT.fq "
]
}
],
"prompt_number": 15
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"%time ! sh SIMsmall/stacks_no.sh 2> SIMsmall/log.stackno"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 1 of 12 [sample_AAGAGG]\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 2 of 12 [sample_GAGAGA]\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 3 of 12 [sample_GGTTTA]\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 4 of 12 [sample_ATAGTA]\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 5 of 12 [sample_TAAATG]\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 6 of 12 [sample_TGAAAT]\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 7 of 12 [sample_GAGAAT]\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 8 of 12 [sample_GAGTAT]\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 9 of 12 [sample_GATAGA]\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 10 of 12 [sample_ATGGAT]\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 11 of 12 [sample_TGTAGA]\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 12 of 12 [sample_ATGGTT]\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"CPU times: user 7.00 s, sys: 0.99 s, total: 7.99 s"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"Wall time: 2490.63 s\n"
]
}
],
"prompt_number": 16
},
{
"cell_type": "heading",
"level": 4,
"metadata": {},
"source": [
"Low Indels"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"%%bash\n",
"process_radtags -f SIMsmall/simRADs_low.fastq -o SIMsmall/stackf_low/ \\\n",
" -b SIMsmall/simRADs_low.stacks.barcodes -e pstI -E phred33"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Using Phred+33 encoding for quality scores.\n",
"Found 1 input file(s).\n",
"Searching for single-end, inlined barcodes.\n",
"Loaded 12 barcodes (6bp).\n",
"Processing file 1 of 1 [simRADs_low.fastq]\n",
" 2600000 total reads; -200000 ambiguous barcodes; -0 ambiguous RAD-Tags; +0 recovered; -0 low quality reads; 2400000 retained reads.\n",
"Closing files, flushing buffers...\n",
"Outputing details to log: 'SIMsmall/stackf_low/process_radtags.log'\n",
"\n",
"2600000 total sequences;\n",
" 200000 ambiguous barcode drops;\n",
" 0 low quality read drops;\n",
" 0 ambiguous RAD-Tag drops;\n",
"2400000 retained reads.\n"
]
}
],
"prompt_number": 17
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"makestackslist(\"low\")"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 18
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"!cat SIMsmall/stacks_low.sh"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"denovo_map.pl -m 2 -M 13 -n 15 -T 12 -b 1 -B 1 -S -X 'populations:-m 6' -D 'SIMsmall_no' -o SIMsmall/stackf_low -s SIMsmall/stackf_low/sample_ATGTGG.fq -s SIMsmall/stackf_low/sample_AAAAAG.fq -s SIMsmall/stackf_low/sample_GTTGGA.fq -s SIMsmall/stackf_low/sample_GTATGT.fq -s SIMsmall/stackf_low/sample_GGTAGG.fq -s SIMsmall/stackf_low/sample_TAGTAA.fq -s SIMsmall/stackf_low/sample_GGTAGT.fq -s SIMsmall/stackf_low/sample_GGTATG.fq -s SIMsmall/stackf_low/sample_GGGTTG.fq -s SIMsmall/stackf_low/sample_GGGGAG.fq -s SIMsmall/stackf_low/sample_AAGATT.fq -s SIMsmall/stackf_low/sample_TTTGTG.fq "
]
}
],
"prompt_number": 19
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"%time ! sh SIMsmall/stacks_low.sh 2> SIMsmall/log.stacklow"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 1 of 12 [sample_ATGTGG]\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 2 of 12 [sample_AAAAAG]\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 3 of 12 [sample_GTTGGA]\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 4 of 12 [sample_GTATGT]\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 5 of 12 [sample_GGTAGG]\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 6 of 12 [sample_TAGTAA]\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 7 of 12 [sample_GGTAGT]\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 8 of 12 [sample_GGTATG]\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 9 of 12 [sample_GGGTTG]\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 10 of 12 [sample_GGGGAG]\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 11 of 12 [sample_AAGATT]\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 12 of 12 [sample_TTTGTG]\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"CPU times: user 7.28 s, sys: 1.13 s, total: 8.42 s"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"Wall time: 2485.87 s\n"
]
}
],
"prompt_number": 20
},
{
"cell_type": "heading",
"level": 4,
"metadata": {},
"source": [
"High Indels"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"%%bash\n",
"process_radtags -f SIMsmall/simRADs_high.fastq -o SIMsmall/stackf_high/ \\\n",
" -b SIMsmall/simRADs_high.stacks.barcodes -e pstI -E phred33"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Using Phred+33 encoding for quality scores.\n",
"Found 1 input file(s).\n",
"Searching for single-end, inlined barcodes.\n",
"Loaded 12 barcodes (6bp).\n",
"Processing file 1 of 1 [simRADs_high.fastq]\n",
" 2600000 total reads; -200000 ambiguous barcodes; -0 ambiguous RAD-Tags; +0 recovered; -0 low quality reads; 2400000 retained reads.\n",
"Closing files, flushing buffers...\n",
"Outputing details to log: 'SIMsmall/stackf_high/process_radtags.log'\n",
"\n",
"2600000 total sequences;\n",
" 200000 ambiguous barcode drops;\n",
" 0 low quality read drops;\n",
" 0 ambiguous RAD-Tag drops;\n",
"2400000 retained reads.\n"
]
}
],
"prompt_number": 21
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"makestackslist(\"high\")"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 22
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"!cat SIMsmall/stacks_high.sh"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"denovo_map.pl -m 2 -M 13 -n 15 -T 12 -b 1 -B 1 -S -X 'populations:-m 6' -D 'SIMsmall_no' -o SIMsmall/stackf_high -s SIMsmall/stackf_high/sample_TAGATT.fq -s SIMsmall/stackf_high/sample_GGATAT.fq -s SIMsmall/stackf_high/sample_AGAATG.fq -s SIMsmall/stackf_high/sample_TTAGGG.fq -s SIMsmall/stackf_high/sample_ATATGT.fq -s SIMsmall/stackf_high/sample_TTAAAG.fq -s SIMsmall/stackf_high/sample_TTGAAG.fq -s SIMsmall/stackf_high/sample_AGATAT.fq -s SIMsmall/stackf_high/sample_TTAAAA.fq -s SIMsmall/stackf_high/sample_GAAATG.fq -s SIMsmall/stackf_high/sample_ATAGGA.fq -s SIMsmall/stackf_high/sample_GGAAAT.fq "
]
}
],
"prompt_number": 23
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"%time ! sh SIMsmall/stacks_high.sh 2> SIMsmall/log.stackhigh"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 1 of 12 [sample_TAGATT]\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 2 of 12 [sample_GGATAT]\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 3 of 12 [sample_AGAATG]\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 4 of 12 [sample_TTAGGG]\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 5 of 12 [sample_ATATGT]\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 6 of 12 [sample_TTAAAG]\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 7 of 12 [sample_TTGAAG]\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 8 of 12 [sample_AGATAT]\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 9 of 12 [sample_TTAAAA]\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 10 of 12 [sample_GAAATG]\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 11 of 12 [sample_ATAGGA]\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 12 of 12 [sample_GGAAAT]\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"CPU times: user 7.86 s, sys: 1.15 s, total: 9.00 s"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"Wall time: 2777.69 s\n"
]
}
],
"prompt_number": 24
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Simulation results"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"I create a list measuring taxon coverage for each _Stacks_ analysis, and similarly for each _PyRAD_ analysis below. This measures the \n",
"total number of loci that have data for at least N taxa for each value of N. "
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"## Stacks results ##\n",
"lines = open(\"SIMsmall/stackf_high/batch_1.haplotypes.tsv\").readlines()\n",
"cnts = [int(field.strip().split(\"\\t\")[1]) for field in lines[1:]]\n",
"shigh = [cnts.count(i) for i in range(1,13)]\n",
"SHIGH = [int(sum(shigh)-sum(shigh[:i-1])) for i in range(1,13)]\n",
"\n",
"lines = open(\"SIMsmall/stackf_low/batch_1.haplotypes.tsv\").readlines()\n",
"cnts = [int(field.strip().split(\"\\t\")[1]) for field in lines[1:]]\n",
"slow = [cnts.count(i) for i in range(1,13)]\n",
"SLOW = [int(sum(slow)-sum(slow[:i-1])) for i in range(1,13)]\n",
"\n",
"lines = open(\"SIMsmall/stackf_no/batch_1.haplotypes.tsv\").readlines()\n",
"cnts = [int(field.strip().split(\"\\t\")[1]) for field in lines[1:]]\n",
"sno = [cnts.count(i) for i in range(1,13)]\n",
"SNO = [int(sum(sno)-sum(sno[:i-1])) for i in range(1,13)]"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 25
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"## PyRAD results ##\n",
"infile = open(\"SIMsmall/Py_no/stats/c85d6m2pN.stats\").readlines()\n",
"pno = [int(infile[j].strip().split(\"\\t\")[1]) for j in range(26,38)]\n",
"PNO = [sum(pno)-sum(pno[:i-1]) for i in range(1,13)]\n",
"\n",
"infile = open(\"SIMsmall/Py_low/stats/c85d6m2pN.stats\").readlines()\n",
"plow = [int(infile[j].strip().split(\"\\t\")[1]) for j in range(26,38)]\n",
"PLOW = [sum(plow)-sum(plow[:i-1]) for i in range(1,13)]\n",
"\n",
"infile = open(\"SIMsmall/Py_high/stats/c85d6m2pN.stats\").readlines()\n",
"phigh = [int(infile[j].strip().split(\"\\t\")[1]) for j in range(26,38)]\n",
"PHIGH = [sum(phigh)-sum(phigh[:i-1]) for i in range(1,13)]"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 26
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"## convert PyRAD lists to R objects ##\n",
"%load_ext rmagic \n",
"%Rpush PNO PLOW PHIGH SNO SLOW SHIGH"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 27
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"%%R\n",
"RES = cbind(PNO,PLOW,PHIGH,SNO,SLOW,SHIGH)\n",
"print(RES)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "display_data",
"text": [
" PNO PLOW PHIGH SNO SLOW SHIGH\n",
" [1,] 10000 9997 10049 10000 12085 16041\n",
" [2,] 10000 9997 10033 10000 10918 12683\n",
" [3,] 10000 9997 10021 10000 10707 11986\n",
" [4,] 10000 9996 10010 10000 10466 11100\n",
" [5,] 10000 9995 9988 10000 10062 10162\n",
" [6,] 10000 9995 9982 10000 9991 9929\n",
" [7,] 10000 9993 9974 10000 9966 9781\n",
" [8,] 10000 9993 9968 10000 9882 9481\n",
" [9,] 10000 9992 9945 10000 9523 8651\n",
"[10,] 10000 9991 9934 10000 9301 8000\n",
"[11,] 10000 9991 9923 10000 9110 7432\n",
"[12,] 10000 9991 9911 9996 8301 5755\n"
]
}
],
"prompt_number": 28
},
{
"cell_type": "heading",
"level": 4,
"metadata": {},
"source": [
"Plotting the results"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"%%R\n",
"makeplot <- function() {\n",
" par(mfcol=c(1,3),\n",
" cex.axis=1.1,\n",
" cex.main=1.1,\n",
" cex.lab=1.1,\n",
" mar=c(4,4,3,0), \n",
" oma=c(1,2,0,2))\n",
"\n",
" plot(RES[,1], ylim=c(0,18000),xlim=c(1,12),\n",
" xlab=\"Minimum taxon coverage\",\n",
" ylab=\"Number of loci recovered\",\n",
" main=\"No indels\")\n",
"\n",
" points(RES[,1], pch=20, col='black', cex=2.5)\n",
" lines(RES[,1], lwd=3)\n",
" points(RES[,4], pch=20, col='darkgrey', cex=1.35)\n",
" lines(RES[,4], lwd=2.5, col='darkgrey')\n",
"\n",
" plot(RES[,2], ylim=c(0,18000),xlim=c(1,12),\n",
" xlab=\"Minimum taxon coverage\",\n",
" ylab=\"\",#loci with at least N taxa\",\n",
" main=\"Low indels\")\n",
"\n",
" points(RES[,2], pch=20, col='black', cex=2.5)\n",
" lines(RES[,2], lwd=3)\n",
" points(RES[,5], pch=20, col='darkgrey', cex=1.35)\n",
" lines(RES[,5], lwd=2.5, col='darkgrey')\n",
"\n",
" plot(RES[,3], ylim=c(0,18000),xlim=c(1,12),\n",
" xlab=\"Minimum taxon coverage\",\n",
" ylab=\"\",#loci with at least N taxa\",\n",
" main=\"High indels\")\n",
"\n",
" points(RES[,3], pch=20, col='black', cex=2.5)\n",
" lines(RES[,3], lwd=3)\n",
" points(RES[,6], pch=20, col='darkgrey', cex=1.35)\n",
" lines(RES[,6], lwd=2.5, col='darkgrey')\n",
"}"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 29
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"%%R\n",
"pdf(\"SIMsmall/FIG_1.pdf\",\n",
" width=6.5, height=2.8,\n",
" family=\"Times\")\n",
"makeplot()\n",
"dev.off()"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 30
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"%R makeplot()"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "display_data",
"png": "iVBORw0KGgoAAAANSUhEUgAAAeAAAAHgCAMAAABKCk6nAAADAFBMVEUAAAABAQECAgIDAwMEBAQF\nBQUGBgYHBwcICAgJCQkKCgoLCwsMDAwNDQ0ODg4PDw8QEBARERESEhITExMUFBQVFRUWFhYXFxcY\nGBgZGRkaGhobGxscHBwdHR0eHh4fHx8gICAhISEiIiIjIyMkJCQlJSUmJiYnJycoKCgpKSkqKior\nKyssLCwtLS0uLi4vLy8wMDAxMTEyMjIzMzM0NDQ1NTU2NjY3Nzc4ODg5OTk6Ojo7Ozs8PDw9PT0+\nPj4/Pz9AQEBBQUFCQkJDQ0NERERFRUVGRkZHR0dISEhJSUlKSkpLS0tMTExNTU1OTk5PT09QUFBR\nUVFSUlJTU1NUVFRVVVVWVlZXV1dYWFhZWVlaWlpbW1tcXFxdXV1eXl5fX19gYGBhYWFiYmJjY2Nk\nZGRlZWVmZmZnZ2doaGhpaWlqampra2tsbGxtbW1ubm5vb29wcHBxcXFycnJzc3N0dHR1dXV2dnZ3\nd3d4eHh5eXl6enp7e3t8fHx9fX1+fn5/f3+AgICBgYGCgoKDg4OEhISFhYWGhoaHh4eIiIiJiYmK\nioqLi4uMjIyNjY2Ojo6Pj4+QkJCRkZGSkpKTk5OUlJSVlZWWlpaXl5eYmJiZmZmampqbm5ucnJyd\nnZ2enp6fn5+goKChoaGioqKjo6OkpKSlpaWmpqanp6eoqKipqamqqqqrq6usrKytra2urq6vr6+w\nsLCxsbGysrKzs7O0tLS1tbW2tra3t7e4uLi5ubm6urq7u7u8vLy9vb2+vr6/v7/AwMDBwcHCwsLD\nw8PExMTFxcXGxsbHx8fIyMjJycnKysrLy8vMzMzNzc3Ozs7Pz8/Q0NDR0dHS0tLT09PU1NTV1dXW\n1tbX19fY2NjZ2dna2trb29vc3Nzd3d3e3t7f39/g4ODh4eHi4uLj4+Pk5OTl5eXm5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
"prompt_number": 31
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Statistics"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import glob\n",
"RES = []\n",
"for run in [\"no\", \"low\", \"high\"]:\n",
" handle = \"SIMsmall/stackf_\"+run+\"/sample_*.tags.tsv\"\n",
" c = [open(ff,'r').read().count(\"consensus\") for ff in glob.glob(handle)]\n",
" RES.append(['stacks',run,float(sum(c))/len(c)])\n",
" \n",
" handle = \"SIMsmall/Py_\"+run+\"/stats/s5.consens.txt\"\n",
" c = map(float,[line.split(\"\\t\")[3] for line in open(handle,'r').readlines()[1:-7]]) \n",
" RES.append(['pyrad',run,float(sum(c))/len(c)])\n",
"\n",
"for res in RES:\n",
" print 'mean N loci per sample from %s indel %s run \\t%f' % (res[1],res[0],res[2])\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"mean N loci per sample from no indel stacks run \t10000.000000\n",
"mean N loci per sample from no indel pyrad run \t10000.000000\n",
"mean N loci per sample from low indel stacks run \t10027.083333\n",
"mean N loci per sample from low indel pyrad run \t10000.500000\n",
"mean N loci per sample from high indel stacks run \t10087.083333\n",
"mean N loci per sample from high indel pyrad run \t10002.000000\n"
]
}
],
"prompt_number": 32
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"infile = open(\"SIMsmall/stackf_high/batch_1.haplotypes.tsv\").readlines()\n",
"tcov = [line.split(\"\\t\")[1] for line in infile[1:]]\n",
"print mean(map(int,tcov)), 'mean coverage stacks highindel'\n",
"\n",
"infile = open(\"SIMsmall/stackf_low/batch_1.haplotypes.tsv\").readlines()\n",
"tcov = [line.split(\"\\t\")[1] for line in infile[1:]]\n",
"print mean(map(int,tcov)), 'mean coverage stacks lowindel'\n",
"\n",
"infile = open(\"SIMsmall/stackf_no/batch_1.haplotypes.tsv\").readlines()\n",
"tcov = [line.split(\"\\t\")[1] for line in infile[1:]]\n",
"print mean(map(int,tcov)), 'mean coverage stacks noindel'\n",
"\n",
"infile = open(\"SIMsmall/Py_high/stats/c85d6m2pN.stats\").readlines()[26:38]\n",
"tcov = []\n",
"for line in infile:\n",
" a = line.split(\"\\t\")\n",
" tcov += [int(a[0])]*int(a[1]) \n",
"print mean(tcov), 'mean coverage pyrad highindel'\n",
"\n",
"infile = open(\"SIMsmall/Py_low/stats/c85d6m2pN.stats\").readlines()[26:38]\n",
"tcov = []\n",
"for line in infile:\n",
" a = line.split(\"\\t\")\n",
" tcov += [int(a[0])]*int(a[1]) \n",
"print mean(tcov), 'mean coverage pyrad lowhindel'\n",
"\n",
"infile = open(\"SIMsmall/Py_no/stats/c85d6m2pN.stats\").readlines()[26:38]\n",
"tcov = []\n",
"for line in infile:\n",
" a = line.split(\"\\t\")\n",
" tcov += [int(a[0])]*int(a[1]) \n",
"print mean(tcov), 'mean coverage pyrad noindel'\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"7.54323296553 mean coverage stacks highindel\n",
"9.95548200248 mean coverage stacks lowindel\n",
"11.9996 mean coverage stacks noindel\n",
"11.9154144691 mean coverage pyrad highindel\n",
"11.9963989197 mean coverage pyrad lowhindel\n",
"12.0 mean coverage pyrad noindel\n"
]
}
],
"prompt_number": 33
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Empirical Analysis"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"An empirical analysis was conducted on the published data set from Eaton & Ree (2013), available de-multiplexed in fastQ format at the \n",
"ncbi sequence read archive (SRA072507). This step takes many hours using 12 processors, as described in the paper. The data are already \n",
"sorted, so PyRAD is started from step 2. After trimming the barcode and adapter read lengths are 69bp. At .85 similarity this is equivalent \n",
"to 10 base differences. The params.txt file is available in the supplementary materials. Because _Stacks_ and _PyRAD_ use different quality \n",
"filtering methods I employed filtering by _PyRAD_ only, and the data are converted back to fastQ format to be read into _Stacks_. This way \n",
"quality filtering does not affect the results of comparison between the two programs. "
]
},
{
"cell_type": "heading",
"level": 4,
"metadata": {},
"source": [
"Initial filtering "
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"%time ! ~/pyrad_v.1.62/pyRAD -p REALDATA/paramsPAR.txt -s 2"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\r\n",
"\r\n",
" ------------------------------------------------------------------\r\n",
" pyRAD : RAD/GBS for phylogenetics & introgression analyses\r\n",
" ------------------------------------------------------------------\r\n",
"\r\n",
"\tsorted .fastq from /home/deren/Dropbox/raw_cyatho/*.fq being used\r\n",
"\tstep 2: editing raw reads \r\n",
"\t"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"CPU times: user 0.37 s, sys: 0.04 s, total: 0.40 s"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"Wall time: 157.25 s\n"
]
}
],
"prompt_number": 34
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"To remove the effect of different error filtering of the two programs the filtered data from PyRAD were used for both analyses. Because \n",
"PyRAD converts the data from fastq to fasta at this step, discarding read quality scores, the data were converted back to fastq with \n",
"arbitrarily high quality scores (b) added to for each base for use in Stacks. \n",
"\n"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"! mkdir REALDATA/edits4stacks"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 35
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"for ff in glob.glob(\"REALDATA/edits/*.edit\"):\n",
" dat = open(ff).readlines()\n",
" outfile = open(\"REALDATA/edits4stacks/\"+ff.split(\"/\")[-1].replace(\".edit\",\".fq\"),'w')\n",
" writing = []\n",
" for line in dat:\n",
" if \">\" in line:\n",
" x,y = line.split(\"_\")[2:4]\n",
" nn = \"@GRC13_0027_FC:4:1:\"+x+\":\"+y+\"#0/1\"\n",
" writing.append(nn.strip())\n",
" else:\n",
" seq = \"TGCAG\"+line.strip()\n",
" writing.append(seq)\n",
" writing.append(\"+\")\n",
" writing.append(\"b\"*len(seq)+\"\\n\")\n",
" outfile.write(\"\\n\".join(writing))\n",
" writing = []\n",
" outfile.close()\n",
" "
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 36
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"PyRAD analysis"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"PyRAD analysis is done with and without paralog filtering"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"%time ! ~/pyrad_v.1.62/pyRAD -p REALDATA/paramsNOPAR.txt -s 34567 2> REALDATA/log.py.txt"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"usearch_i86linux32 v6.0.307, 4.0Gb RAM (49.5Gb total), 24 cores\r\n",
"(C) Copyright 2010-12 Robert C. Edgar, all rights reserved.\r\n",
"http://drive5.com/usearch\r\n",
"\r\n",
"Licensed to: daeaton@uchicago.edu\r\n",
"\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\tingroup ['FieldMuseum_Ree_29154', 'FieldMuseum_Ree_30556', 'FieldMuseum_Ree_30686', 'FieldMuseum_Ree_32082', 'FieldMuseum_Ree_33405', 'FieldMuseum_Ree_33413', 'FieldMuseum_Ree_33588', 'FieldMuseum_Ree_35855', 'FieldMuseum_Ree_38362', 'FieldMuseum_Ree_39618', 'FieldMuseum_Ree_40578', 'FieldMuseum_Ree_41478', 'FieldMuseum_Ree_41954']\r\n",
"\taddon []\r\n",
"\texclude []\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\t"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\r\n",
"\tfinal stats written to:\r\n",
"\t /home/deren/Dropbox/PYRADMANU/REALDATA/stats/c85d6m2pN.stats\r\n",
"\toutput files written to:\r\n",
"\t /home/deren/Dropbox/PYRADMANU/REALDATA/outfiles/ directory\r\n",
"\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"CPU times: user 208.31 s, sys: 32.33 s, total: 240.64 s"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"Wall time: 127436.99 s\n"
]
}
],
"prompt_number": 37
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"%%bash\n",
"mv REALDATA/stats REALDATA/stats.nopar\n",
"mkdir REALDATA/stats\n",
"rm REALDATA/clust.85/*.consens\n",
"\n",
"~/pyrad_v.1.62/pyRAD -p REALDATA/paramsPAR.txt -s 4567 2> REALDATA/log.py2.txt"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"usearch_i86linux32 v6.0.307, 4.0Gb RAM (49.5Gb total), 24 cores\n",
"(C) Copyright 2010-12 Robert C. Edgar, all rights reserved.\n",
"http://drive5.com/usearch\n",
"\n",
"Licensed to: daeaton@uchicago.edu\n",
"\n",
"\tingroup ['FieldMuseum_Ree_29154', 'FieldMuseum_Ree_30556', 'FieldMuseum_Ree_30686', 'FieldMuseum_Ree_32082', 'FieldMuseum_Ree_33405', 'FieldMuseum_Ree_33413', 'FieldMuseum_Ree_33588', 'FieldMuseum_Ree_35855', 'FieldMuseum_Ree_38362', 'FieldMuseum_Ree_39618', 'FieldMuseum_Ree_40578', 'FieldMuseum_Ree_41478', 'FieldMuseum_Ree_41954']\n",
"\taddon []\n",
"\texclude []\n",
"\t............\n",
"\tfinal stats written to:\n",
"\t /home/deren/Dropbox/PYRADMANU/REALDATA/stats/c85d6m2p3H3N3.stats\n",
"\toutput files written to:\n",
"\t /home/deren/Dropbox/PYRADMANU/REALDATA/outfiles/ directory\n",
"\n"
]
}
],
"prompt_number": 38
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Stacks analysis"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"!mkdir REALDATA/stacks85"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 39
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import glob\n",
"infiles = [\"-s \"+ff+\" \" for ff in glob.glob(\"REALDATA/edits4stacks/*\")]\n",
"denovo = \"denovo_map.pl -m 2 -M 10 -N 10 -n 10 -T 12 -b 1 -B 1 -S -X \"+\\\n",
" \"'populations:-m 6' -X 'ustacks:--max_locus_stacks 2' -D 'stacks85' \"+\\\n",
" \"-o REALDATA/stacks85 \"+\"\".join(infiles)\n",
"with open(\"REALDATA/stacks85/stacks.sh\",'w') as outfile:\n",
" outfile.write(denovo)"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 40
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"!cat REALDATA/stacks85/stacks.sh"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"denovo_map.pl -m 2 -M 10 -N 10 -n 10 -T 12 -b 1 -B 1 -S -X 'populations:-m 6' -X 'ustacks:--max_locus_stacks 2' -D 'stacks85' -o REALDATA/stacks85 -s REALDATA/edits4stacks/FieldMuseum_Ree_41478.fq -s REALDATA/edits4stacks/FieldMuseum_Ree_35855.fq -s REALDATA/edits4stacks/FieldMuseum_Ree_30556.fq -s REALDATA/edits4stacks/FieldMuseum_Ree_33588.fq -s REALDATA/edits4stacks/FieldMuseum_Ree_39618.fq -s REALDATA/edits4stacks/FieldMuseum_Ree_38362.fq -s REALDATA/edits4stacks/FieldMuseum_Ree_40578.fq -s REALDATA/edits4stacks/FieldMuseum_Ree_29154.fq -s REALDATA/edits4stacks/FieldMuseum_Ree_33413.fq -s REALDATA/edits4stacks/FieldMuseum_Ree_33405.fq -s REALDATA/edits4stacks/FieldMuseum_Ree_41954.fq -s REALDATA/edits4stacks/FieldMuseum_Ree_32082.fq -s REALDATA/edits4stacks/FieldMuseum_Ree_30686.fq "
]
}
],
"prompt_number": 41
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"%time !sh REALDATA/stacks85/stacks.sh 2> REALDATA/log.stacks.txt"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 1 of 13 [FieldMuseum_Ree_41478]\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 2 of 13 [FieldMuseum_Ree_35855]\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 3 of 13 [FieldMuseum_Ree_30556]\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 4 of 13 [FieldMuseum_Ree_33588]\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 5 of 13 [FieldMuseum_Ree_39618]\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 6 of 13 [FieldMuseum_Ree_38362]\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 7 of 13 [FieldMuseum_Ree_40578]\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 8 of 13 [FieldMuseum_Ree_29154]\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 9 of 13 [FieldMuseum_Ree_33413]\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 10 of 13 [FieldMuseum_Ree_33405]\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 11 of 13 [FieldMuseum_Ree_41954]\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 12 of 13 [FieldMuseum_Ree_32082]\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 13 of 13 [FieldMuseum_Ree_30686]\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"CPU times: user 800.48 s, sys: 143.01 s, total: 943.49 s"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"Wall time: 266088.77 s\n"
]
}
],
"prompt_number": 42
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Compiling results"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"infile = open(\"REALDATA/stats.nopar/c85d6m2pN.stats\").readlines()\n",
"pno = [int(infile[j].strip().split(\"\\t\")[1]) for j in range(27,40)]\n",
"PEMPN = [sum(pno)-sum(pno[:i-1]) for i in range(1,14)]\n",
"\n",
"infile = open(\"REALDATA/stats/c85d6m2p3H3N3.stats\").readlines()\n",
"fno = [int(infile[j].strip().split(\"\\t\")[1]) for j in range(27,40)]\n",
"PEMPF = [sum(fno)-sum(fno[:i-1]) for i in range(1,14)]"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 43
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Stacks does not have the same paralog filtering options that pyrad does and so I implement three additional filters on the data. \n",
"First, I remove loci that have more than three alleles in a locus, and second I remove loci with more than three heterozygous sites, \n",
"and lastly, I remove stacks from the final output that are heterozygous at the same site across more than four samples. "
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"handle = \"REALDATA/stacks85/batch_1.haplotypes.tsv\"\n",
"lines = open(handle).readlines()\n",
"FILTER = []\n",
"NOFILTER = []\n",
"for line in lines[1:]:\n",
" dat = line.strip().split(\"\\t\")[1:]\n",
" cnt = int(dat[0])\n",
" ocnt = int(dat[0])\n",
" hets = []\n",
" for loc in dat:\n",
" \" remove loci with more than 2 alleles\"\n",
" if loc.count(\"/\") > 1:\n",
" dat.remove(loc)\n",
" cnt -= 1\n",
" else:\n",
" if \"/\" in loc:\n",
" a,b = loc.split(\"/\") \n",
" \" remove loci with more than 4 hetero sites \"\n",
" if len(a) > 3:\n",
" dat.remove(loc)\n",
" cnt -= 1\n",
" else:\n",
" \" remove stack if a hetero site is shared across more than 4 samples\"\n",
" h = [i for i in range(len(a)) if a[i]!=b[i]]\n",
" for i in h:\n",
" hets.append(i)\n",
" if [hets.count(i) for i in set(hets)]:\n",
" if max([hets.count(i) for i in set(hets)]) > 4:\n",
" cnt = 0\n",
" FILTER.append(cnt)\n",
" NOFILTER.append(ocnt)\n",
"\n",
"filt = [FILTER.count(i) for i in range(1,14)]\n",
"nofilt = [NOFILTER.count(i) for i in range(1,14)]\n",
"SEMPF = [int(sum(filt)-sum(filt[:i-1])) for i in range(1,14)]\n",
"SEMPN = [int(sum(nofilt)-sum(nofilt[:i-1])) for i in range(1,14)]\n",
"\n",
"print \"mean coverage stacks no filter\", mean(NOFILTER)\n",
"print \"%fullcov stacks no filter\",float([NOFILTER.count(13)][0])/sum([FILTER.count(i) for i in range(1,14)])*100\n",
"print \"\"\n",
"print \"mean coverage stacks paralog filtered\", mean(FILTER)\n",
"print \"%fullcov stacks filtered\",float([FILTER.count(13)][0])/sum([FILTER.count(i) for i in range(1,14)])*100\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"mean coverage stacks no filter 2.65351217823\n",
"%fullcov stacks no filter 0.93914895677\n",
"\n",
"mean coverage stacks paralog filtered "
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"2.44040946562\n",
"%fullcov stacks filtered 0.543641380646\n"
]
}
],
"prompt_number": 44
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"def meancovpyrad(lines):\n",
" tcov = []\n",
" for line in lines:\n",
" a = line.split(\"\\t\")\n",
" tcov += [int(a[0])]*int(a[1])\n",
" full = 100*float(tcov.count(13))/len(tcov)\n",
" return mean(tcov), full\n",
"\n",
"\n",
"infile = open(\"REALDATA/stats.nopar/c85d6m2pN.stats\").readlines()[27:40]\n",
"nofiltpycov, fullnofiltpy = meancovpyrad(infile)\n",
"infile = open(\"REALDATA/stats/c85d6m2p3H3N3.stats\").readlines()[27:40]\n",
"filtpycov, fullfiltpy = meancovpyrad(infile)\n",
"print \"mean coverage pyrad no filter\", nofiltpycov\n",
"print \"%fullcov pyrad no filter\", fullnofiltpy\n",
"print \"\"\n",
"print \"mean coverage pyrad paralog filtered\", filtpycov\n",
"print \"%fullcov pyrad no filter\", fullfiltpy\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"mean coverage pyrad no filter 2.99135473853\n",
"%fullcov pyrad no filter 1.35862030721\n",
"\n",
"mean coverage pyrad paralog filtered 2.96574310049\n",
"%fullcov pyrad no filter 0.985513914028\n"
]
}
],
"prompt_number": 45
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"%load_ext rmagic \n",
"%Rpush SEMPF SEMPN PEMPF PEMPN"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 46
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"%%R \n",
"DIFFN <- c(SEMPN-PEMPN)\n",
"DIFFF <- c(SEMPF-PEMPF)"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 47
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"%%R\n",
"REALRES = cbind(PEMPN,SEMPN,PEMPF,SEMPF,DIFFN,DIFFF)\n",
"print(REALRES)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "display_data",
"text": [
" PEMPN SEMPN PEMPF SEMPF DIFFN DIFFF\n",
" [1,] 180330 213742 165193 206570 33412 41377\n",
" [2,] 78326 86858 72317 82252 8532 9935\n",
" [3,] 51231 52562 47542 48868 1331 1326\n",
" [4,] 42819 42429 39505 39032 -390 -473\n",
" [5,] 37216 35963 34146 32694 -1253 -1452\n",
" [6,] 33022 31270 30151 28009 -1752 -2142\n",
" [7,] 29293 27159 26532 23780 -2134 -2752\n",
" [8,] 25804 23508 23162 20024 -2296 -3138\n",
" [9,] 22171 19807 19470 16182 -2364 -3288\n",
"[10,] 17596 15489 15031 11873 -2107 -3158\n",
"[11,] 12330 10649 10078 7533 -1681 -2545\n",
"[12,] 6843 5791 5165 3678 -1052 -1487\n",
"[13,] 2450 1940 1628 1123 -510 -505\n"
]
}
],
"prompt_number": 48
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Plot of the difference in taxon coverage for the empirical data set"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The difference in the number of loci recovered by the two programs is shown. Above the zero line (grey) Stacks recovers more loci and \n",
"below the line (black) pyRAD recovers more loci. PyRAD returns more loci at high coverage than does Stacks, which instead recovers many \n",
"more singleton and small coverage loci. Plotted on log scale. A better way to visualize the difference in performance between the two programs. "
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"%%R\n",
"diffplot <- function() {\n",
" par(cex.axis=1.1,\n",
" cex.main=1.1,\n",
" cex.lab=1.6,\n",
" mar=c(4,4,3,0), \n",
" oma=c(1,2,0,2))\n",
" D <- log(abs(DIFFN)) * c(-1,-1,-1,rep(1,10))\n",
" E <- log(abs(DIFFF)) * c(-1,-1,-1,rep(1,10))\n",
" names(D) <- seq(1,13)\n",
" df.bar <- barplot(D, col=c(rep('grey',3),rep('black',10)),\n",
" ylim=c(-12,10), space=0.5,\n",
" ylab=\"Log difference in number of loci recovered\",\n",
" xlab=\"Minimum taxon coverage\",axes=F)\n",
" box()\n",
" abline(h=0,lwd=2,lty=2)\n",
" points(df.bar, E, bg=c(rep('grey',3),rep('black',10)),\n",
" cex=2, pch=21)\n",
" axis(2,c(-10,-5,0,5,10),c(\"10\",\"5\",\"0\",\"5\",\"10\"))\n",
"} \n",
"diffplot()"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "display_data",
"png": "iVBORw0KGgoAAAANSUhEUgAAAeAAAAHgCAMAAABKCk6nAAADAFBMVEUAAAABAQECAgIDAwMEBAQF\nBQUGBgYHBwcICAgJCQkKCgoLCwsMDAwNDQ0ODg4PDw8QEBARERESEhITExMUFBQVFRUWFhYXFxcY\nGBgZGRkaGhobGxscHBwdHR0eHh4fHx8gICAhISEiIiIjIyMkJCQlJSUmJiYnJycoKCgpKSkqKior\nKyssLCwtLS0uLi4vLy8wMDAxMTEyMjIzMzM0NDQ1NTU2NjY3Nzc4ODg5OTk6Ojo7Ozs8PDw9PT0+\nPj4/Pz9AQEBBQUFCQkJDQ0NERERFRUVGRkZHR0dISEhJSUlKSkpLS0tMTExNTU1OTk5PT09QUFBR\nUVFSUlJTU1NUVFRVVVVWVlZXV1dYWFhZWVlaWlpbW1tcXFxdXV1eXl5fX19gYGBhYWFiYmJjY2Nk\nZGRlZWVmZmZnZ2do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Wueg7yugOAgOPiU1\nOkq7YcUd6nfqGNYAAABQSURBVFyugOIgmAOvoR6L3klD+o8lBxkQzIHS+bdH3tSJqnsr0wDBggOC\nBQcECw4IFhwQLDggWHBAsOCAYMEBwYIDggUHBAsOCBYcECw4/w/pEquuHWln1wAAAABJRU5ErkJg\ngg==\n"
}
],
"prompt_number": 49
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"%%R\n",
"pdf(\"diffplot.pdf\", width=7, height=6, family='Times')\n",
"diffplot()\n",
"dev.off()"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 50
},
{
"cell_type": "heading",
"level": 4,
"metadata": {},
"source": [
"Estimate proportion of indels in pyRAD assembled empirical data set"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"def counts(infile, mincov):\n",
" lines = [i.split(\"\\n\") for i in infile]\n",
" INDS = []\n",
" for loc in lines[:-1]:\n",
" seqs = []\n",
" for line in loc:\n",
" if \">\" in line:\n",
" seqs.append(line.split(\" \")[-1])\n",
" if len(seqs) >= mincov:\n",
" N = numpy.array([list(i) for i in seqs])\n",
" cols = iter(N.transpose())\n",
" inds = 0\n",
" col = cols.next()\n",
" while 1:\n",
" if \"-\" in col:\n",
" try: col = cols.next()\n",
" except StopIteration: break\n",
" if \"-\" not in col:\n",
" inds += 1\n",
" else:\n",
" try: col = cols.next()\n",
" except StopIteration: break\n",
" INDS.append(inds)\n",
" i = [i for i in INDS if i!=0]\n",
" return float(len(i))/len(INDS)"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 51
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#infile1 = open(\"REALDATA/outfiles/c85d6m2pN.loci\").read().split(\"//\")\n",
"infile1 = open(\"REALDATA/outfiles/c85d6m2p3H3N3.loci\").read().split(\"//\")\n",
"infile2 = open(\"SIMsmall/Py_high/outfiles/c85d6m2pN.loci\").read().split(\"//\")\n",
"infile3 = open(\"SIMsmall/Py_low/outfiles/c85d6m2pN.loci\").read().split(\"//\")"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 52
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"for i in [13,12,10,8,6,4]:\n",
" dat = counts(infile1,i)\n",
" print 'cyatho',i,\"%0.3f\" % dat\n",
"indelesthigh = counts(infile2,12)\n",
"indelestlow = counts(infile3,12)\n",
"print 'simhigh', 12, \"%0.3f\" % indelesthigh\n",
"print 'simlow', 12, \"%0.3f\" % indelestlow"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"cyatho 13 0.141\n",
"cyatho"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
" 12 0.156\n",
"cyatho"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
" 10 0.214\n",
"cyatho"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
" 8 0.260\n",
"cyatho"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
" 6 0.287\n",
"cyatho"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
" 4 0.306\n",
"simhigh"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
" 12 0.467\n",
"simlow 12 0.195\n"
]
}
],
"prompt_number": 53
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Large Simulation Analysis"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Simulate the large RADseq data set on the same species tree as before, with no indel variation, but allowing mutations to arise in the \n",
"restriction recognition site (25bp region in this case to simulate large dropout). I simulate 500K loci to create a data set that has \n",
"many fewer loci within any individual sample due to locus dropout (~150K) such that within-sample clustering is fast, but many loci to \n",
"cluster across samples (500K) such that across-sample clustering is slow. I compare run times to analyze these data in _Stacks_ and _PyRAD_ \n",
"including when implementing hierarchical clustering in _PyRAD_. "
]
},
{
"cell_type": "code",
"collapsed": true,
"input": [
"!python simradsMANU.py 0.0 50 500000 1 SIMbig/big12.fastq"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\tsimulating 500000 RAD loci across 12 tip taxa with 1 samples per taxon\r\n",
"\tindels arise at frequency of 0.000000\r\n",
"\tmutations in restriction site at length (freq) = 50\r\n",
"\ttheta=4Nu= 0.0014\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\tcreating new barcode map\r\n"
]
}
],
"prompt_number": 54
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"%%bash\n",
"mkdir SIMbig/big0/\n",
"mkdir SIMbig/big4/"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 64
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"%time ! ~/pyrad_v.1.62/pyRAD -p SIMbig/paramsbig.txt -s 12345 2> SIMbig/log.big"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"CPU times: user 10.67 s, sys: 1.66 s, total: 12.33 s"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"Wall time: 7884.25 s\n"
]
}
],
"prompt_number": 65
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"%time ! ~/pyrad_v.1.62/pyRAD -p SIMbig/paramsbig.txt -s67 2> SIMbig/log.big"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"usearch_i86linux32 v6.0.307, 4.0Gb RAM (49.5Gb total), 24 cores\r\n",
"(C) Copyright 2010-12 Robert C. Edgar, all rights reserved.\r\n",
"http://drive5.com/usearch\r\n",
"\r\n",
"Licensed to: daeaton@uchicago.edu\r\n",
"\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\tingroup ['1A0', '1B0', '1C0', '1D0', '2E0', '2F0', '2G0', '2H0', '3I0', '3J0', '3K0', '3L0']\r\n",
"\taddon []\r\n",
"\texclude []\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\t"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
".."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
".."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
".."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\r\n",
"\tfinal stats written to:\r\n",
"\t SIMbig/big0/stats/big.c85d6m2pN.stats\r\n",
"\toutput files written to:\r\n",
"\t SIMbig/big0/outfiles/ directory\r\n",
"\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"CPU times: user 44.70 s, sys: 7.13 s, total: 51.83 s"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"Wall time: 33415.28 s\n"
]
}
],
"prompt_number": 66
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"%%bash\n",
"mv SIMbig/big0/clust.85/ SIMbig/big4/\n",
"mkdir SIMbig/big4/stats"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 67
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"%time ! ~/pyrad_v.1.62/pyRAD -p SIMbig/paramsbigH4.txt -s 67 2> SIMbig/log.bigH4"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"1 4\r\n",
"2 4\r\n",
"3 4\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"usearch_i86linux32 v6.0.307, 4.0Gb RAM (49.5Gb total), 24 cores\r\n",
"(C) Copyright 2010-12 Robert C. Edgar, all rights reserved.\r\n",
"http://drive5.com/usearch\r\n",
"\r\n",
"Licensed to: daeaton@uchicago.edu\r\n",
"\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\tingroup ['1A0', '1B0', '1C0', '1D0', '2E0', '2F0', '2G0', '2H0', '3I0', '3J0', '3K0', '3L0']\r\n",
"\taddon []\r\n",
"\texclude []\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\t"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
". . . . . ."
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\r\n",
"\tfinal stats written to:\r\n",
"\t SIMbig/big4/stats/big.c85d6m2pN.stats\r\n",
"\toutput files written to:\r\n",
"\t SIMbig/big4/outfiles/ directory\r\n",
"\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"CPU times: user 8.23 s, sys: 1.12 s, total: 9.36 s"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"Wall time: 6755.55 s\n"
]
}
],
"prompt_number": 68
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"%%bash\n",
"mkdir SIMbig/stackf\n",
"cut -f 2 SIMbig/big12.fastq.barcodes > SIMbig/big12.stacks.barcodes"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 69
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"! process_radtags -f SIMbig/big12.fastq -o SIMbig/stackf -b SIMbig/big12.stacks.barcodes -e pstI -E phred33"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Using Phred+33 encoding for quality scores.\r\n",
"Found 1 input file(s).\r\n",
"Searching for single-end, inlined barcodes.\r\n",
"Loaded 12 barcodes (6bp).\r\n",
" Processing RAD-Tag 22170000 \r",
" 22173620 total reads; -10000000 ambiguous barcodes; -0 ambiguous RAD-Tags; +0 recovered; -0 low quality reads; 12173620 retained reads.\r\n",
"Closing files, flushing buffers...\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Outputing details to log: 'SIMbig/stackf/process_radtags.log'\r\n",
"\r\n",
"22173620 total sequences;\r\n",
" 10000000 ambiguous barcode drops;\r\n",
" 0 low quality read drops;\r\n",
" 0 ambiguous RAD-Tag drops;\r\n",
"12173620 retained reads.\r\n"
]
}
],
"prompt_number": 71
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Because the barcodes were made randomly and every single of the 120 input files has to be written in by hand for the stacks command \n",
"denovo_map.pl I wrote a script here to find the sample names, as output by process_radtags, and create an input file for denovo_map.pl \n",
"written to a bash script called stacks.sh"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"makestackslist(\"nom\")"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 73
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"infiles = [\"-s \"+ff+\" \" for ff in glob.glob(\"SIMbig/stackf/*.fq\")]\n",
"denovo = \"denovo_map.pl -m 2 -M 13 -n 15 -T 12 -b 1 -B 1 -S -X \"+\\\n",
" \"'populations:-m 6' -D 'SimRADsBIG' -o SIMbig/stackf \"+\"\".join(infiles)\n",
"with open(\"SIMbig/stacks.sh\",'w') as outfile:\n",
" outfile.write(denovo)"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 74
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"%time ! sh SIMbig/stacks.sh"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Found 12 sample file(s).\r\n",
"Identifying unique stacks; file 1 of 12 [sample_GTTAGG]\r\n",
" /usr/local/bin//ustacks -t fastq -f SIMbig/stackf/sample_GTTAGG.fq -o SIMbig/stackf -i 1 -m 2 -M 13 -p 12 2>&1\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 2 of 12 [sample_ATGTGT]\r\n",
" /usr/local/bin//ustacks -t fastq -f SIMbig/stackf/sample_ATGTGT.fq -o SIMbig/stackf -i 2 -m 2 -M 13 -p 12 2>&1\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 3 of 12 [sample_TGGTGG]\r\n",
" /usr/local/bin//ustacks -t fastq -f SIMbig/stackf/sample_TGGTGG.fq -o SIMbig/stackf -i 3 -m 2 -M 13 -p 12 2>&1\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 4 of 12 [sample_TGATGA]\r\n",
" /usr/local/bin//ustacks -t fastq -f SIMbig/stackf/sample_TGATGA.fq -o SIMbig/stackf -i 4 -m 2 -M 13 -p 12 2>&1\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 5 of 12 [sample_ATTTGG]\r\n",
" /usr/local/bin//ustacks -t fastq -f SIMbig/stackf/sample_ATTTGG.fq -o SIMbig/stackf -i 5 -m 2 -M 13 -p 12 2>&1\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 6 of 12 [sample_TGGGTG]\r\n",
" /usr/local/bin//ustacks -t fastq -f SIMbig/stackf/sample_TGGGTG.fq -o SIMbig/stackf -i 6 -m 2 -M 13 -p 12 2>&1\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 7 of 12 [sample_ATTGAG]\r\n",
" /usr/local/bin//ustacks -t fastq -f SIMbig/stackf/sample_ATTGAG.fq -o SIMbig/stackf -i 7 -m 2 -M 13 -p 12 2>&1\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 8 of 12 [sample_GGAGAA]\r\n",
" /usr/local/bin//ustacks -t fastq -f SIMbig/stackf/sample_GGAGAA.fq -o SIMbig/stackf -i 8 -m 2 -M 13 -p 12 2>&1\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 9 of 12 [sample_AGTTAT]\r\n",
" /usr/local/bin//ustacks -t fastq -f SIMbig/stackf/sample_AGTTAT.fq -o SIMbig/stackf -i 9 -m 2 -M 13 -p 12 2>&1\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 10 of 12 [sample_TAGTTA]\r\n",
" /usr/local/bin//ustacks -t fastq -f SIMbig/stackf/sample_TAGTTA.fq -o SIMbig/stackf -i 10 -m 2 -M 13 -p 12 2>&1\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 11 of 12 [sample_GAAATA]\r\n",
" /usr/local/bin//ustacks -t fastq -f SIMbig/stackf/sample_GAAATA.fq -o SIMbig/stackf -i 11 -m 2 -M 13 -p 12 2>&1\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Identifying unique stacks; file 12 of 12 [sample_AGTTAA]\r\n",
" /usr/local/bin//ustacks -t fastq -f SIMbig/stackf/sample_AGTTAA.fq -o SIMbig/stackf -i 12 -m 2 -M 13 -p 12 2>&1\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Generating catalog...\r\n",
" /usr/local/bin//cstacks -b 1 -o SIMbig/stackf -s SIMbig/stackf/sample_GTTAGG -s SIMbig/stackf/sample_ATGTGT -s SIMbig/stackf/sample_TGGTGG -s SIMbig/stackf/sample_TGATGA -s SIMbig/stackf/sample_ATTTGG -s SIMbig/stackf/sample_TGGGTG -s SIMbig/stackf/sample_ATTGAG -s SIMbig/stackf/sample_GGAGAA -s SIMbig/stackf/sample_AGTTAT -s SIMbig/stackf/sample_TAGTTA -s SIMbig/stackf/sample_GAAATA -s SIMbig/stackf/sample_AGTTAA -n 15 -p 12 2>&1\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Matching RAD-Tags to catalog; file 1 of 12 [sample_GTTAGG]\r\n",
" /usr/local/bin//sstacks -b 1 -c SIMbig/stackf/batch_1 -s SIMbig/stackf/sample_GTTAGG -o SIMbig/stackf -p 12 2>&1\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Matching RAD-Tags to catalog; file 2 of 12 [sample_ATGTGT]\r\n",
" /usr/local/bin//sstacks -b 1 -c SIMbig/stackf/batch_1 -s SIMbig/stackf/sample_ATGTGT -o SIMbig/stackf -p 12 2>&1\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Matching RAD-Tags to catalog; file 3 of 12 [sample_TGGTGG]\r\n",
" /usr/local/bin//sstacks -b 1 -c SIMbig/stackf/batch_1 -s SIMbig/stackf/sample_TGGTGG -o SIMbig/stackf -p 12 2>&1\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Matching RAD-Tags to catalog; file 4 of 12 [sample_TGATGA]\r\n",
" /usr/local/bin//sstacks -b 1 -c SIMbig/stackf/batch_1 -s SIMbig/stackf/sample_TGATGA -o SIMbig/stackf -p 12 2>&1\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Matching RAD-Tags to catalog; file 5 of 12 [sample_ATTTGG]\r\n",
" /usr/local/bin//sstacks -b 1 -c SIMbig/stackf/batch_1 -s SIMbig/stackf/sample_ATTTGG -o SIMbig/stackf -p 12 2>&1\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Matching RAD-Tags to catalog; file 6 of 12 [sample_TGGGTG]\r\n",
" /usr/local/bin//sstacks -b 1 -c SIMbig/stackf/batch_1 -s SIMbig/stackf/sample_TGGGTG -o SIMbig/stackf -p 12 2>&1\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Matching RAD-Tags to catalog; file 7 of 12 [sample_ATTGAG]\r\n",
" /usr/local/bin//sstacks -b 1 -c SIMbig/stackf/batch_1 -s SIMbig/stackf/sample_ATTGAG -o SIMbig/stackf -p 12 2>&1\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Matching RAD-Tags to catalog; file 8 of 12 [sample_GGAGAA]\r\n",
" /usr/local/bin//sstacks -b 1 -c SIMbig/stackf/batch_1 -s SIMbig/stackf/sample_GGAGAA -o SIMbig/stackf -p 12 2>&1\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Matching RAD-Tags to catalog; file 9 of 12 [sample_AGTTAT]\r\n",
" /usr/local/bin//sstacks -b 1 -c SIMbig/stackf/batch_1 -s SIMbig/stackf/sample_AGTTAT -o SIMbig/stackf -p 12 2>&1\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Matching RAD-Tags to catalog; file 10 of 12 [sample_TAGTTA]\r\n",
" /usr/local/bin//sstacks -b 1 -c SIMbig/stackf/batch_1 -s SIMbig/stackf/sample_TAGTTA -o SIMbig/stackf -p 12 2>&1\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Matching RAD-Tags to catalog; file 11 of 12 [sample_GAAATA]\r\n",
" /usr/local/bin//sstacks -b 1 -c SIMbig/stackf/batch_1 -s SIMbig/stackf/sample_GAAATA -o SIMbig/stackf -p 12 2>&1\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Matching RAD-Tags to catalog; file 12 of 12 [sample_AGTTAA]\r\n",
" /usr/local/bin//sstacks -b 1 -c SIMbig/stackf/batch_1 -s SIMbig/stackf/sample_AGTTAA -o SIMbig/stackf -p 12 2>&1\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Calculating population-level summary statistics\r\n",
"/usr/local/bin//populations -b 1 -P SIMbig/stackf -s -t 12 -m 6 2>&1\r\n"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"CPU times: user 221.47 s, sys: 34.13 s, total: 255.60 s"
]
},
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"Wall time: 73780.51 s\n"
]
}
],
"prompt_number": 75
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Measure stats for big simulation analysis"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"infile = open(\"SIMbig/stackf/batch_1.haplotypes.tsv\").readlines()\n",
"tcov = [line.split(\"\\t\")[1] for line in infile[1:]]\n",
"print mean(map(int,tcov)), 'mean coverage stacks'\n",
"\n",
"infile = open(\"SIMbig/big0/stats/big.c85d6m2pN.stats\").readlines()[26:38]\n",
"tcov = []\n",
"for line in infile:\n",
" a = line.split(\"\\t\")\n",
" tcov += [int(a[0])]*int(a[1]) \n",
"print mean(tcov), 'mean coverage pyrad'\n",
"\n",
"infile = open(\"SIMbig/big4/stats/big.c85d6m2pN.stats\").readlines()[26:38]\n",
"tcov = []\n",
"for line in infile:\n",
" a = line.split(\"\\t\")\n",
" tcov += [int(a[0])]*int(a[1]) \n",
"print mean(tcov), 'mean coverage pyrad hierarchical'"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"4.4786988998 mean coverage stacks\n",
"4.47936475229 mean coverage pyrad\n",
"2.8736130253 mean coverage pyrad hierarchical\n"
]
}
],
"prompt_number": 76
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"infile = open(\"SIMbig/big0/stats/big.c85d6m2pN.stats\").readlines()\n",
"phigh = [int(infile[j].strip().split(\"\\t\")[1]) for j in range(26,38)]\n",
"P0 = [sum(phigh)-sum(phigh[:i-1]) for i in range(1,13)]\n",
"\n",
"infile = open(\"SIMbig/big4/stats/big.c85d6m2pN.stats\").readlines()\n",
"phigh = [int(infile[j].strip().split(\"\\t\")[1]) for j in range(26,38)]\n",
"P4 = [sum(phigh)-sum(phigh[:i-1]) for i in range(1,13)]\n",
"\n",
"lines = open(\"SIMbig/stackf/batch_1.haplotypes.tsv\").readlines()\n",
"cnts = [int(field.strip().split(\"\\t\")[1]) for field in lines[1:]]\n",
"sno = [cnts.count(i) for i in range(1,13)]\n",
"S0 = [int(sum(sno)-sum(sno[:i-1])) for i in range(1,13)]"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 77
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"print array([P0,P4,S0]).transpose()"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"[[ 135884. 85618. 135885.]\n",
" [ 121263. 45613. 121228.]\n",
" [ 106282. 45613. 106261.]\n",
" [ 82504. 45613. 82487.]\n",
" [ 59113. 5609. 59106.]\n",
" [ 43673. 5609. 43670.]\n",
" [ 29057. 5609. 29054.]\n",
" [ 16368. 5609. 16367.]\n",
" [ 8528. 285. 8528.]\n",
" [ 4206. 285. 4206.]\n",
" [ 1511. 285. 1511.]\n",
" [ 285. 285. 285.]]\n"
]
}
],
"prompt_number": 78
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"100*(253./500000)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "pyout",
"prompt_number": 79,
"text": [
"0.050600000000000006"
]
}
],
"prompt_number": 79
},
{
"cell_type": "code",
"collapsed": false,
"input": [],
"language": "python",
"metadata": {},
"outputs": []
}
],
"metadata": {}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment