{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Canarium GBS: BPP analyses\n", "### *Federman et al.*\n", "\n", "This notebook provides all code run BPP analyses performed in Federman et al. (xxxx). All code in this notebook is written in Python." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Required software" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": true }, "outputs": [], "source": [ "## conda install ipyrad -c ipyrad\n", "## conda install toytree -c eaton-lab\n", "## conda install bpp -c ipyrad" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Imports" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "ipyrad v.0.7.22\n" ] } ], "source": [ "import toytree\n", "import toyplot.svg\n", "import ipyrad as ip\n", "import ipyrad.analysis as ipa\n", "print \"ipyrad v.{}\".format(ip.__version__)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Connect to cluster" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "scrolled": true }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "host compute node: [40 cores] on sacra\n" ] } ], "source": [ "import ipyparallel as ipp\n", "ipyclient = ipp.Client()\n", "ip.cluster_info(ipyclient)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Setup analyses" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": true }, "outputs": [], "source": [ "## the subset of six taxa used in BPP analyses, 4 per taxon (or 2)\n", "## exclude hybrid taxon SF172\n", "## exclude D12963 b/c it was not consistently placed in 3B vs 3C vs. sister to both \n", "imap = {\n", " \"1A\": ['SF175', 'SF328', 'SF200'],\n", " \"1B\": ['SF209', 'D13052'],\n", " \"1C\": ['D14528', 'SF276', 'SF286'],\n", " \n", " \"2A\": ['D13101', 'D13103', 'D14482', 'D14483'],\n", " \"2B\": ['D14504', 'D14505', 'D14506'],\n", " \"2C\": ['D14477', 'D14478', 'D14480', 'D14485', 'D14501', 'D14513'], \n", " \n", " \"3A\": ['D13090', 'D12950'],\n", " \"3B\": ['SF155', 'SF224', 'SF228', '5573', 'SF327'],\n", " \"3C\": ['SF164', 'SF153', 'SF160', 'D13053', 'D13063', 'D13075', 'D13097', 'SF197'], \n", " }\n", "\n", "\n", "## make a dictionary with min values to filter loci to those with N samples per species.\n", "minmap = {\n", " \"1A\": 3, \n", " \"1B\": 2, \n", " \"1C\": 3,\n", " \"2A\": 4, \n", " \"2B\": 3, \n", " \"2C\": 4,\n", " \"3A\": 2,\n", " \"3B\": 4,\n", " \"3C\": 4,\n", "}" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | with-data | \n", "prior-only | \n", "
---|---|---|
lnL | \n", "-11006.5848 | \n", "nan | \n", "
tau_101A1B1C2A2B2C3A3B3C | \n", "0.0011 | \n", "0.0014 | \n", "
tau_111A1B1C | \n", "0.0007 | \n", "0.0009 | \n", "
tau_121B1C | \n", "0.0004 | \n", "0.0005 | \n", "
tau_132A2B2C3A3B3C | \n", "0.0010 | \n", "0.0012 | \n", "
tau_142A2B2C | \n", "0.0009 | \n", "0.0008 | \n", "
tau_152B2C | \n", "0.0007 | \n", "0.0004 | \n", "
tau_163A3B3C | \n", "0.0007 | \n", "0.0008 | \n", "
tau_173B3C | \n", "0.0004 | \n", "0.0004 | \n", "
theta_101A1B1C2A2B2C3A3B3C | \n", "0.0020 | \n", "0.0090 | \n", "
theta_111A1B1C | \n", "0.0033 | \n", "0.0096 | \n", "
theta_11A | \n", "0.0027 | \n", "0.0101 | \n", "
theta_121B1C | \n", "0.0094 | \n", "0.0101 | \n", "
theta_132A2B2C3A3B3C | \n", "0.0098 | \n", "0.0095 | \n", "
theta_142A2B2C | \n", "0.0074 | \n", "0.0100 | \n", "
theta_152B2C | \n", "0.0099 | \n", "0.0103 | \n", "
theta_163A3B3C | \n", "0.0047 | \n", "0.0095 | \n", "
theta_173B3C | \n", "0.0057 | \n", "0.0091 | \n", "
theta_21B | \n", "0.0011 | \n", "0.0099 | \n", "
theta_31C | \n", "0.0016 | \n", "0.0095 | \n", "
theta_42A | \n", "0.0030 | \n", "0.0093 | \n", "
theta_52B | \n", "0.0012 | \n", "0.0100 | \n", "
theta_62C | \n", "0.0119 | \n", "0.0104 | \n", "
theta_73A | \n", "0.0013 | \n", "0.0101 | \n", "
theta_83B | \n", "0.0084 | \n", "0.0102 | \n", "
theta_93C | \n", "0.0036 | \n", "0.0097 | \n", "