[med-svn] [Git][med-team/bali-phy][master] 3 commits: New upstream version 3.2+dfsg

Benjamin Redelings gitlab at salsa.debian.org
Tue Jun 26 02:42:12 BST 2018


Benjamin Redelings pushed to branch master at Debian Med / bali-phy


Commits:
beb9d2d2 by Benjamin Redelings at 2018-06-25T21:39:04-04:00
New upstream version 3.2+dfsg
- - - - -
d92888bb by Benjamin Redelings at 2018-06-25T21:39:07-04:00
Update upstream source from tag 'upstream/3.2+dfsg'

Update to upstream version '3.2+dfsg'
with Debian dir 4d8bb8cc82385ed22f47beb4f2bf00a4e48754b6
- - - - -
a40d3759 by Benjamin Redelings at 2018-06-25T21:39:49-04:00
Update changelog.

- - - - -


18 changed files:

- + NEWS
- debian/changelog
- doc/README.html
- doc/README.itex.xml
- doc/README.pdf
- doc/README.xhtml
- examples/models/CoalMine.hs
- functions/rs07_relaxed_rates.json
- meson.build
- scripts/bp-analyze
- src/builtins/Distribution.cc
- src/builtins/SMC.cc
- src/mcmc/sample-two-nodes.cc
- src/models/rules.cc
- src/models/setup.cc
- src/tools/alignment-compare.cc
- src/tools/alignment-identity.cc
- src/tools/alignment-smc.cc


Changes:

=====================================
NEWS
=====================================
--- /dev/null
+++ b/NEWS
@@ -0,0 +1,30 @@
+* 3.2.0
+  - Fixes
+    - Increase test timeout for internal testsuite and testiphy.
+    - HTML report: don't hide header behind top-bar in Chrome.
+  - alignment-smc improvements.
+* 3.1.5
+  - Fixes
+    - Make all programs use shipped libstdc++
+    - Make MDS plots handle bp-analyze --subsample
+    - Increase test timeouts
+    - Correctly write initial alignment for fixed alignment partitions.
+    - Don't write "file:" for MDS URLs in HTML report
+  - Print citations with pmid and pmcid in help.
+  - Add Frequencies.uniform[] function.
+  - Print help for 0-argument functions like 'dna'
+  - Make SEV handle site-compression.
+  - HTML report: print version number + lots of cosmetic improvements.
+  - Add new tool tree-tool (and map page, etc.)
+  - Change alignments-diff highlight color back to red.
+  - Clean up DP matrix code.
+* 3.1.4
+  - Fix prior on alpha in Rates.gamma
+* 3.1.3
+  - Fix mean_length prior in RS05 model.
+  - Add some more color-schemes for drawing alignments-diff output.
+  - Add ferns exon/intro data set.
+* 3.1.2
+  - Fix a testsuite bug
+* 3.1.1
+  - Print priors on models in their own section.


=====================================
debian/changelog
=====================================
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+bali-phy (3.2+dfsg-1) UNRELEASED; urgency=medium
+
+  * New upstream version
+
+ -- Benjamin Redelings <benjamin.redelings at gmail.com>  Mon, 25 Jun 2018 21:39:12 -0400
+
 bali-phy (3.1.5+dfsg-1) unstable; urgency=medium
 
   * New upstream version


=====================================
doc/README.html
=====================================
--- a/doc/README.html
+++ b/doc/README.html
@@ -1,4 +1,4 @@
-<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>BAli-Phy User's Guide v3.1</title><link rel="stylesheet" type="text/css" href="docbook.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div lang="en" class="article"><div class="titlepage"><div><div><h2 class="title"><a name="idp1"></a><span class="application">BAli-Phy</span> User's Guide v3.1</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Benjamin</span> <span class="surname">Redelings</span></h3></div></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="section"><a href="#intro">1. Introduction</a></span></dt><dt><span class="section"><a href="#installation">2. Installation</a></span></dt><dd><dl><dt><span class="section"><a href="#pre-requisites">2.1. Hardware requirements</a></span></dt><dt><span class="section"><a href="#idp5">2.2. Install on MS Windows</a></span></dt><dt><span class="section"><a href="#idp10">2.3. Install on Mac OS X</a></span></dt><dt><span class="section"><a href="#idp15">2.4. Install on Linux</a></span></dt><dt><span class="section"><a href="#path">2.5. Add BAli-Phy to your <code class="envar">PATH</code></a></span></dt><dt><span class="section"><a href="#tests">2.6. Test the installed software</a></span></dt><dt><span class="section"><a href="#software_req">2.7. Install programs used for viewing the results</a></span></dt></dl></dd><dt><span class="section"><a href="#compilation">3. Compiling <span class="application">BAli-Phy</span></a></span></dt><dd><dl><dt><span class="section"><a href="#idp25">3.1. Setup</a></span></dt><dt><span class="section"><a href="#quickstart">3.2. Clone, Configure, Compile</a></span></dt><dt><span class="section"><a href="#idp26">3.3. Options: compiler and linker flags</a></span></dt></dl></dd><dt><span class="section"><a href="#running">4. Running the program</a></span></dt><dd><dl><dt><span class="section"><a href="#idp27">4.1. Quick Start</a></span></dt><dt><span class="section"><a href="#idp28">4.2. Command line options</a></span></dt><dt><span class="section"><a href="#idp33">4.3. Multiple genes/partitions, models, and linking</a></span></dt><dt><span class="section"><a href="#cluster">4.4. Running on computing clusters</a></span></dt><dt><span class="section"><a href="#idp37">4.5. Option files (Scripts)</a></span></dt><dt><span class="section"><a href="#examples">4.6. Examples</a></span></dt></dl></dd><dt><span class="section"><a href="#input">5. Input</a></span></dt><dd><dl><dt><span class="section"><a href="#idp38">5.1. Sequence formats</a></span></dt><dt><span class="section"><a href="#idp41">5.2. Is my data set too large?</a></span></dt></dl></dd><dt><span class="section"><a href="#output">6. Output</a></span></dt><dd><dl><dt><span class="section"><a href="#idp42">6.1. Output directory</a></span></dt><dt><span class="section"><a href="#idp46">6.2. Output files</a></span></dt><dt><span class="section"><a href="#idp54">6.3. Summarizing the output</a></span></dt><dt><span class="section"><a href="#analysis">6.4. Summarizing the output - scripted</a></span></dt></dl></dd><dt><span class="section"><a href="#functions">7. Models and Priors</a></span></dt><dd><dl><dt><span class="section"><a href="#idp57">7.1. Models and distributions are functions</a></span></dt><dt><span class="section"><a href="#priors">7.2. Priors</a></span></dt><dt><span class="section"><a href="#idp61">7.3. Models and '<strong class="userinput"><code>+</code></strong>' notation</a></span></dt><dt><span class="section"><a href="#default_values">7.4. Default values and default priors</a></span></dt><dt><span class="section"><a href="#types">7.5. Argument and result types</a></span></dt></dl></dd><dt><span class="section"><a href="#subst_models">8. Substitution models</a></span></dt><dd><dl><dt><span class="section"><a href="#idp62">8.1. Default substitution models</a></span></dt><dt><span class="section"><a href="#subst_basic">8.2. Basic CTMC models</a></span></dt><dt><span class="section"><a href="#subst_freq">8.3. Substitution Frequency models</a></span></dt><dt><span class="section"><a href="#idp63">8.4. Substitution Mixture Models</a></span></dt><dt><span class="section"><a href="#idp64">8.5. The branch-site substitution model</a></span></dt><dt><span class="section"><a href="#idp65">8.6. Substitution model examples</a></span></dt><dt><span class="section"><a href="#genetic-codes">8.7. Genetic Codes</a></span></dt></dl></dd><dt><span class="section"><a href="#indel_models">9. Insertion/deletion models</a></span></dt><dt><span class="section"><a href="#mixing_and_convergence">10. Convergence and Mixing: Is it done yet?</a></span></dt><dd><dl><dt><span class="section"><a href="#idp66">10.1. Definition of Convergence</a></span></dt><dt><span class="section"><a href="#idp67">10.2. Definition of Mixing</a></span></dt><dt><span class="section"><a href="#idp70">10.3. Diagnostics: Variation in split frequencies across runs (ASDSF/MSDSF)</a></span></dt><dt><span class="section"><a href="#idp71">10.4. Diagnostics: Potential Scale Reduction Factors (PSRF)</a></span></dt><dt><span class="section"><a href="#idp74">10.5. Diagnostics: Effective sample sizes (ESS)</a></span></dt><dt><span class="section"><a href="#idp77">10.6. Diagnostics: Stabilization</a></span></dt></dl></dd><dt><span class="section"><a href="#alignment-utilities">11. Alignment utilities</a></span></dt><dd><dl><dt><span class="section"><a href="#idp78">11.1. alignment-info</a></span></dt><dt><span class="section"><a href="#idp79">11.2. alignment-cat</a></span></dt><dt><span class="section"><a href="#idp80">11.3. alignment-thin</a></span></dt><dt><span class="section"><a href="#idp81">11.4. alignment-draw</a></span></dt><dt><span class="section"><a href="#idp82">11.5. alignment-find</a></span></dt><dt><span class="section"><a href="#idp83">11.6. alignment-indices</a></span></dt><dt><span class="section"><a href="#idp84">11.7. alignment-chop-internal</a></span></dt></dl></dd><dt><span class="section"><a href="#tree-utilities">12. Tree utilities</a></span></dt><dd><dl><dt><span class="section"><a href="#idp85">12.1. trees-consensus</a></span></dt><dt><span class="section"><a href="#idp86">12.2. trees-bootstrap</a></span></dt><dt><span class="section"><a href="#idp87">12.3. trees-to-SRQ</a></span></dt></dl></dd><dt><span class="section"><a href="#FAQ">13. Frequently Asked Questions (FAQ)</a></span></dt><dd><dl><dt><span class="section"><a href="#idp88">13.1. Input files</a></span></dt><dt><span class="section"><a href="#idp89">13.2. Running <span class="command"><strong>bali-phy</strong></span>.</a></span></dt><dt><span class="section"><a href="#idp90">13.3. Run-time error messages</a></span></dt><dt><span class="section"><a href="#idp91">13.4. Stopping <span class="command"><strong>bali-phy</strong></span>.</a></span></dt><dt><span class="section"><a href="#idp92">13.5. Running <span class="command"><strong>bp-analyze</strong></span>.</a></span></dt><dt><span class="section"><a href="#idp93">13.6. Interpreting the results.</a></span></dt><dt><span class="section"><a href="#idp94">13.7. How do I...</a></span></dt></dl></dd></dl></div>
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>BAli-Phy User's Guide v3.2</title><link rel="stylesheet" type="text/css" href="docbook.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div lang="en" class="article"><div class="titlepage"><div><div><h2 class="title"><a name="idp1"></a><span class="application">BAli-Phy</span> User's Guide v3.2</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Benjamin</span> <span class="surname">Redelings</span></h3></div></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="section"><a href="#intro">1. Introduction</a></span></dt><dt><span class="section"><a href="#installation">2. Installation</a></span></dt><dd><dl><dt><span class="section"><a href="#pre-requisites">2.1. Hardware requirements</a></span></dt><dt><span class="section"><a href="#idp5">2.2. Install on MS Windows</a></span></dt><dt><span class="section"><a href="#idp10">2.3. Install on Mac OS X</a></span></dt><dt><span class="section"><a href="#idp15">2.4. Install on Linux</a></span></dt><dt><span class="section"><a href="#path">2.5. Add BAli-Phy to your <code class="envar">PATH</code></a></span></dt><dt><span class="section"><a href="#tests">2.6. Test the installed software</a></span></dt><dt><span class="section"><a href="#software_req">2.7. Install programs used for viewing the results</a></span></dt></dl></dd><dt><span class="section"><a href="#compilation">3. Compiling <span class="application">BAli-Phy</span></a></span></dt><dd><dl><dt><span class="section"><a href="#idp25">3.1. Setup</a></span></dt><dt><span class="section"><a href="#quickstart">3.2. Clone, Configure, Compile</a></span></dt><dt><span class="section"><a href="#idp26">3.3. Options: compiler and linker flags</a></span></dt></dl></dd><dt><span class="section"><a href="#running">4. Running the program</a></span></dt><dd><dl><dt><span class="section"><a href="#idp27">4.1. Quick Start</a></span></dt><dt><span class="section"><a href="#idp28">4.2. Command line options</a></span></dt><dt><span class="section"><a href="#idp33">4.3. Multiple genes/partitions, models, and linking</a></span></dt><dt><span class="section"><a href="#cluster">4.4. Running on computing clusters</a></span></dt><dt><span class="section"><a href="#idp37">4.5. Option files (Scripts)</a></span></dt><dt><span class="section"><a href="#examples">4.6. Examples</a></span></dt></dl></dd><dt><span class="section"><a href="#input">5. Input</a></span></dt><dd><dl><dt><span class="section"><a href="#idp38">5.1. Sequence formats</a></span></dt><dt><span class="section"><a href="#idp41">5.2. Is my data set too large?</a></span></dt></dl></dd><dt><span class="section"><a href="#output">6. Output</a></span></dt><dd><dl><dt><span class="section"><a href="#idp42">6.1. Output directory</a></span></dt><dt><span class="section"><a href="#idp46">6.2. Output files</a></span></dt><dt><span class="section"><a href="#idp54">6.3. Summarizing the output</a></span></dt><dt><span class="section"><a href="#analysis">6.4. Summarizing the output - scripted</a></span></dt></dl></dd><dt><span class="section"><a href="#functions">7. Models and Priors</a></span></dt><dd><dl><dt><span class="section"><a href="#idp57">7.1. Models and distributions are functions</a></span></dt><dt><span class="section"><a href="#priors">7.2. Priors</a></span></dt><dt><span class="section"><a href="#idp61">7.3. Models and '<strong class="userinput"><code>+</code></strong>' notation</a></span></dt><dt><span class="section"><a href="#default_values">7.4. Default values and default priors</a></span></dt><dt><span class="section"><a href="#types">7.5. Argument and result types</a></span></dt></dl></dd><dt><span class="section"><a href="#subst_models">8. Substitution models</a></span></dt><dd><dl><dt><span class="section"><a href="#idp62">8.1. Default substitution models</a></span></dt><dt><span class="section"><a href="#subst_basic">8.2. Basic CTMC models</a></span></dt><dt><span class="section"><a href="#subst_freq">8.3. Substitution Frequency models</a></span></dt><dt><span class="section"><a href="#idp63">8.4. Substitution Mixture Models</a></span></dt><dt><span class="section"><a href="#idp64">8.5. The branch-site substitution model</a></span></dt><dt><span class="section"><a href="#idp65">8.6. Substitution model examples</a></span></dt><dt><span class="section"><a href="#genetic-codes">8.7. Genetic Codes</a></span></dt></dl></dd><dt><span class="section"><a href="#indel_models">9. Insertion/deletion models</a></span></dt><dt><span class="section"><a href="#mixing_and_convergence">10. Convergence and Mixing: Is it done yet?</a></span></dt><dd><dl><dt><span class="section"><a href="#idp66">10.1. Definition of Convergence</a></span></dt><dt><span class="section"><a href="#idp67">10.2. Definition of Mixing</a></span></dt><dt><span class="section"><a href="#idp70">10.3. Diagnostics: Variation in split frequencies across runs (ASDSF/MSDSF)</a></span></dt><dt><span class="section"><a href="#idp71">10.4. Diagnostics: Potential Scale Reduction Factors (PSRF)</a></span></dt><dt><span class="section"><a href="#idp74">10.5. Diagnostics: Effective sample sizes (ESS)</a></span></dt><dt><span class="section"><a href="#idp77">10.6. Diagnostics: Stabilization</a></span></dt></dl></dd><dt><span class="section"><a href="#alignment-utilities">11. Alignment utilities</a></span></dt><dd><dl><dt><span class="section"><a href="#idp78">11.1. alignment-info</a></span></dt><dt><span class="section"><a href="#idp79">11.2. alignment-cat</a></span></dt><dt><span class="section"><a href="#idp80">11.3. alignment-thin</a></span></dt><dt><span class="section"><a href="#idp81">11.4. alignment-draw</a></span></dt><dt><span class="section"><a href="#idp82">11.5. alignment-find</a></span></dt><dt><span class="section"><a href="#idp83">11.6. alignment-indices</a></span></dt><dt><span class="section"><a href="#idp84">11.7. alignment-chop-internal</a></span></dt></dl></dd><dt><span class="section"><a href="#tree-utilities">12. Tree utilities</a></span></dt><dd><dl><dt><span class="section"><a href="#idp85">12.1. trees-consensus</a></span></dt><dt><span class="section"><a href="#idp86">12.2. trees-bootstrap</a></span></dt><dt><span class="section"><a href="#idp87">12.3. trees-to-SRQ</a></span></dt></dl></dd><dt><span class="section"><a href="#FAQ">13. Frequently Asked Questions (FAQ)</a></span></dt><dd><dl><dt><span class="section"><a href="#idp88">13.1. Input files</a></span></dt><dt><span class="section"><a href="#idp89">13.2. Running <span class="command"><strong>bali-phy</strong></span>.</a></span></dt><dt><span class="section"><a href="#idp90">13.3. Run-time error messages</a></span></dt><dt><span class="section"><a href="#idp91">13.4. Stopping <span class="command"><strong>bali-phy</strong></span>.</a></span></dt><dt><span class="section"><a href="#idp92">13.5. Running <span class="command"><strong>bp-analyze</strong></span>.</a></span></dt><dt><span class="section"><a href="#idp93">13.6. Interpreting the results.</a></span></dt><dt><span class="section"><a href="#idp94">13.7. How do I...</a></span></dt></dl></dd></dl></div>
   
 
   <div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="intro"></a>1. Introduction</h2></div></div></div>
@@ -53,10 +53,10 @@
 	First, download and extract the executables:
       </p><pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>mkdir -p ~/Applications</code></strong>
 <code class="prompt">%</code> <strong class="userinput"><code>cd ~/Applications</code></strong>
-<code class="prompt">%</code> <strong class="userinput"><code>wget http://www.bali-phy.org/files/bali-phy-3.1-win64.tar.gz</code></strong>
-<code class="prompt">%</code> <strong class="userinput"><code>tar -zxf bali-phy-3.1-win64.tar.gz</code></strong></pre><p>
+<code class="prompt">%</code> <strong class="userinput"><code>wget http://www.bali-phy.org/files/bali-phy-3.2-win64.tar.gz</code></strong>
+<code class="prompt">%</code> <strong class="userinput"><code>tar -zxf bali-phy-3.2-win64.tar.gz</code></strong></pre><p>
        Second, check that the <span class="command"><strong>bali-phy</strong></span> executable runs:
-      </p><pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>~/Applications/bali-phy-3.1/bin/bali-phy --version</code></strong></pre><p>
+      </p><pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>~/Applications/bali-phy-3.2/bin/bali-phy --version</code></strong></pre><p>
       You still need to add it to your PATH as described in <a class="xref" href="#path" title="2.5. Add BAli-Phy to your PATH">Section 2.5, “Add BAli-Phy to your <code class="envar">PATH</code>”</a>.
     </p>
 </div>
@@ -81,10 +81,10 @@ If you install with homebrew, you don't need to do anything extra to put bali-ph
       First download and extract the executables:
       </p><pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>mkdir -p ~/Applications</code></strong>
 <code class="prompt">%</code> <strong class="userinput"><code>cd ~/Applications</code></strong>
-<code class="prompt">%</code> <strong class="userinput"><code>curl -O http://www.bali-phy.org/files/bali-phy-3.1-mac64.tar.gz</code></strong>
-<code class="prompt">%</code> <strong class="userinput"><code>tar -zxf bali-phy-3.1-mac64.tar.gz</code></strong></pre><p>
+<code class="prompt">%</code> <strong class="userinput"><code>curl -O http://www.bali-phy.org/files/bali-phy-3.2-mac64.tar.gz</code></strong>
+<code class="prompt">%</code> <strong class="userinput"><code>tar -zxf bali-phy-3.2-mac64.tar.gz</code></strong></pre><p>
       Check that the executable runs:
-      </p><pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>~/Applications/bali-phy-3.1/bin/bali-phy --version</code></strong></pre><p>
+      </p><pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>~/Applications/bali-phy-3.2/bin/bali-phy --version</code></strong></pre><p>
       You still need to add it to your PATH as described in <a class="xref" href="#path" title="2.5. Add BAli-Phy to your PATH">Section 2.5, “Add BAli-Phy to your <code class="envar">PATH</code>”</a>.
     </p>
 
@@ -114,7 +114,8 @@ However, note that this might conflict with R installed from other places, such 
 
     <div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp15"></a>2.4. Install on Linux</h3></div></div></div>
 
-    <div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="idp11"></a>2.4.1. Install BAli-Phy using <span class="command"><strong>apt-get</strong></span> (recommended if using <span class="emphasis"><em>Debian: testing or unstable</em></span>)</h4></div></div></div>
+    <div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="idp11"></a>2.4.1. Install BAli-Phy using <span class="command"><strong>apt-get</strong></span></h4></div></div></div>
+    BAli-Phy is available on Ubuntu <a class="ulink" href="https://launchpad.net/ubuntu/+source/bali-phy/" target="_top">("Cosmic Cuttlefish" or later)</a>, and Debian (<a class="ulink" href="https://packages.debian.org/search?keywords=bali-phy&searchon=names&section=all" target="_top">testing and unstable</a>).
     <pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>sudo apt-get install bali-phy</code></strong></pre>
     Check that the executable runs:
     <pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>bali-phy --version</code></strong></pre>
@@ -130,10 +131,10 @@ However, note that this might conflict with R installed from other places, such 
       Then download and extract the executables:
       </p><pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>mkdir -p ~/Applications</code></strong>
 <code class="prompt">%</code> <strong class="userinput"><code>cd ~/Applications</code></strong>
-<code class="prompt">%</code> <strong class="userinput"><code>wget http://www.bali-phy.org/files/bali-phy-3.1-linux64.tar.gz</code></strong>
-<code class="prompt">%</code> <strong class="userinput"><code>tar -zxf bali-phy-3.1-linux64.tar.gz</code></strong></pre><p>
+<code class="prompt">%</code> <strong class="userinput"><code>wget http://www.bali-phy.org/files/bali-phy-3.2-linux64.tar.gz</code></strong>
+<code class="prompt">%</code> <strong class="userinput"><code>tar -zxf bali-phy-3.2-linux64.tar.gz</code></strong></pre><p>
       Second, check that the executable runs:
-      </p><pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>~/Applications/bali-phy-3.1/bin/bali-phy --version</code></strong></pre><p>
+      </p><pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>~/Applications/bali-phy-3.2/bin/bali-phy --version</code></strong></pre><p>
       You still need to add it to your PATH as described in <a class="xref" href="#path" title="2.5. Add BAli-Phy to your PATH">Section 2.5, “Add BAli-Phy to your <code class="envar">PATH</code>”</a>.
     </p>
     </div>
@@ -166,10 +167,10 @@ If bali-phy is not in your PATH, then continue with this section.
     </div>
     <div class="section"><div class="titlepage"><div><div><h4 class="title"><a name="idp17"></a>2.5.2. Quick version</h4></div></div></div>
 <p>Add <span class="command"><strong>bali-phy</strong></span> to your PATH, so that the shell knows where to find it.  This command only affects the terminal in which it is typed, and will not affect new terminals:
-</p><pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>export PATH=~/Applications/bali-phy-3.1/bin:$PATH</code></strong></pre><p>
+</p><pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>export PATH=~/Applications/bali-phy-3.2/bin:$PATH</code></strong></pre><p>
 To set the PATH automatically for new terminals, type:
-</p><pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>test -r ~/.bash_profile && echo 'export PATH=~/Applications/bali-phy-3.1/bin:$PATH' >> ~/.bash_profile</code></strong>
-<code class="prompt">%</code> <strong class="userinput"><code>echo 'export PATH=~/Applications/bali-phy-3.1/bin:$PATH' >> ~/.profile</code></strong></pre><p>
+</p><pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>test -r ~/.bash_profile && echo 'export PATH=~/Applications/bali-phy-3.2/bin:$PATH' >> ~/.bash_profile</code></strong>
+<code class="prompt">%</code> <strong class="userinput"><code>echo 'export PATH=~/Applications/bali-phy-3.2/bin:$PATH' >> ~/.profile</code></strong></pre><p>
 This will affect new terminals only after you log out and log back in though.</p>
 <p>
 Now check that the executable runs:
@@ -182,7 +183,7 @@ If it does, then your PATH is set up correctly, and you can probably skip the re
       <p>
 	If you installed <span class="application">BAli-Phy</span> to the directory
 	<code class="filename">~/Applications</code>, then you can run
-	bali-phy by typing <span class="command"><strong>~/Applications/bali-phy-3.1/bin/bali-phy</strong></span>.
+	bali-phy by typing <span class="command"><strong>~/Applications/bali-phy-3.2/bin/bali-phy</strong></span>.
 	However, it would be much nicer to simply type
 	<span class="command"><strong>bali-phy</strong></span> and let the computer find the
 	executable for you.  This can be achieved by putting the directory
@@ -205,9 +206,9 @@ If it does, then your PATH is set up correctly, and you can probably skip the re
 	</p><pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>echo $PATH</code></strong></pre><p>
 	We will assume that you extracted the bali-phy archive in
 	<code class="filename">~/Applications</code> and so you want to add
-	<code class="filename">$HOME/Applications/bali-phy-3.1/bin</code>
+	<code class="filename">$HOME/Applications/bali-phy-3.2/bin</code>
 	to your <code class="envar">PATH</code>.  (If you installed to another directory,
-	replace <code class="filename">$HOME/Applications/bali-phy-3.1/</code> with that directory.)
+	replace <code class="filename">$HOME/Applications/bali-phy-3.2/</code> with that directory.)
       </p>
       </div>
 
@@ -217,10 +218,10 @@ If it does, then your PATH is set up correctly, and you can probably skip the re
 	<span class="command"><strong>echo $SHELL</strong></span> to find out. If your
 	shell is <span class="command"><strong>sh</strong></span> or 
 	<span class="command"><strong>bash</strong></span> then the command looks like this: 
-	</p><pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>PATH=$HOME/Applications/bali-phy-3.1/bin:$PATH</code></strong></pre><p>
+	</p><pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>PATH=$HOME/Applications/bali-phy-3.2/bin:$PATH</code></strong></pre><p>
 	If your shell is <span class="command"><strong>csh</strong></span> or
 	<span class="command"><strong>tcsh</strong></span>, then the command looks like this:
-	</p><pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>setenv PATH $HOME/Applications/bali-phy-3.1/bin:$PATH</code></strong></pre><p>
+	</p><pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>setenv PATH $HOME/Applications/bali-phy-3.2/bin:$PATH</code></strong></pre><p>
 	Note that these commands will only affect the window you are typing
 	in, and will vanish when you reboot.   
       </p>
@@ -251,8 +252,8 @@ If it does, then your PATH is set up correctly, and you can probably skip the re
 
     <div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="tests"></a>2.6. Test the installed software</h3></div></div></div>
     <p>In order to determine that the software has been correctly installed, and the <code class="envar">PATH</code> has been correctly set, run the following commands:
-    </p><pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>bali-phy ~/Applications/bali-phy-3.1/share/doc/bali-phy/examples/sequences/5S-rRNA/25.fasta --iter=150</code></strong>
-<code class="prompt">%</code> <strong class="userinput"><code>bali-phy ~/Applications/bali-phy-3.1/share/doc/bali-phy/examples/sequences/5S-rRNA/25.fasta --iter=150</code></strong>
+    </p><pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>bali-phy ~/Applications/bali-phy-3.2/share/doc/bali-phy/examples/sequences/5S-rRNA/25.fasta --iter=150</code></strong>
+<code class="prompt">%</code> <strong class="userinput"><code>bali-phy ~/Applications/bali-phy-3.2/share/doc/bali-phy/examples/sequences/5S-rRNA/25.fasta --iter=150</code></strong>
 <code class="prompt">%</code> <strong class="userinput"><code>bp-analyze 25-1 25-2</code></strong></pre><p>
     </p>
     <p>Furthermore, the directories <code class="filename">25-1</code> and <code class="filename">25-2</code> should contain a file called <code class="filename">C1.log</code>.  You should be able to load these files in Tracer, although the chain will not really have converged yet.</p>
@@ -360,9 +361,9 @@ Otherwise you can install meson through pip3:
 </p>
 <p>
 Then run meson to configure the build process:
-</p><pre class="screen"><code class="prompt">%</code><strong class="userinput"><code> meson build --prefix=$HOME/Applications/bali-phy-3.1/</code></strong></pre><p>
+</p><pre class="screen"><code class="prompt">%</code><strong class="userinput"><code> meson build --prefix=$HOME/Applications/bali-phy-3.2/</code></strong></pre><p>
 In the MSYS2 environment, the command is called <span class="command"><strong>meson.py</strong></span> instead of <span class="command"><strong>meson</strong></span>:
-</p><pre class="screen"><code class="prompt">%</code><strong class="userinput"><code> meson.py build --prefix=$HOME/Applications/bali-phy-3.1/</code></strong></pre><p>
+</p><pre class="screen"><code class="prompt">%</code><strong class="userinput"><code> meson.py build --prefix=$HOME/Applications/bali-phy-3.2/</code></strong></pre><p>
 </p>
 <p>
 Finally, build and install the software:
@@ -370,21 +371,21 @@ Finally, build and install the software:
 <code class="prompt">%</code><strong class="userinput"><code> ninja -C build test</code></strong>
 <code class="prompt">%</code><strong class="userinput"><code> ninja -C build install</code></strong>
 </pre><p>
-The command <span class="command"><strong>bali-phy</strong></span> and its associated tools should then be located in <code class="filename">~/Applications/bali-phy-3.1/bin/</code>. To install to another directory <em class="replaceable"><code>dir</code></em>, specify --prefix=<em class="replaceable"><code>dir</code></em> to <span class="command"><strong>meson</strong></span>.
+The command <span class="command"><strong>bali-phy</strong></span> and its associated tools should then be located in <code class="filename">~/Applications/bali-phy-3.2/bin/</code>. To install to another directory <em class="replaceable"><code>dir</code></em>, specify --prefix=<em class="replaceable"><code>dir</code></em> to <span class="command"><strong>meson</strong></span>.
       </p>
 
     </div>
       <div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp26"></a>3.3. Options: compiler and linker flags</h3></div></div></div>
 	
       <p>You can select the C++ compiler by setting the CXX variable.  A useful example of this is to use <span class="command"><strong>g++-5</strong></span> on systems where <span class="command"><strong>g++</strong></span> invokes a compiler that is too old:
- </p><pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>CXX=g++-5 meson build --prefix=$HOME/Applications/bali-phy-3.1</code></strong></pre><p>
+ </p><pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>CXX=g++-5 meson build --prefix=$HOME/Applications/bali-phy-3.2</code></strong></pre><p>
  You may also set compiler and linker options using the CPPFLAGS, CXXFLAGS, and LDFLAGS variables.  For example, you can instruct the compiler to use all the features of your chip, instead of producing generic code that will run anywhere:
- </p><pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>CXXFLAGS="-mtune=native -march=native" meson --prefix=$HOME/Applications/bali-phy-3.1</code></strong></pre><p>
+ </p><pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>CXXFLAGS="-mtune=native -march=native" meson --prefix=$HOME/Applications/bali-phy-3.2</code></strong></pre><p>
 
  For example, you can set the CPPFLAGS and LDFLAGS variables to instruct the compiler where to look for libraries, such as cairo:
-	  </p><pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>CPPFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib" meson build --prefix=$HOME/Applications/bali-phy-3.1</code></strong></pre><p>
+	  </p><pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>CPPFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib" meson build --prefix=$HOME/Applications/bali-phy-3.2</code></strong></pre><p>
  Another useful example of this is to produce an OS X executable on that can run on older versions of OS X:
-	  </p><pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>CXXFLAGS="-mmacosx-version-min=10.9" LDFLAGS="-mmacosx-version-min=10.9" meson build --prefix=$HOME/Applications/bali-phy-3.1</code></strong></pre><p>	</p>
+	  </p><pre class="screen"><code class="prompt">%</code> <strong class="userinput"><code>CXXFLAGS="-mmacosx-version-min=10.9" LDFLAGS="-mmacosx-version-min=10.9" meson build --prefix=$HOME/Applications/bali-phy-3.2</code></strong></pre><p>	</p>
       </div>
 
     </div>
@@ -572,7 +573,7 @@ scale = 1,3:</pre><p>
       executables and extracted them in the
       <code class="filename">~/Applications</code> directory, then the
       <code class="filename">examples/sequences/</code> directory will be found at 
-      <code class="filename">~/Applications/bali-phy-3.1/share/doc/bali-phy/examples/sequences/</code>.
+      <code class="filename">~/Applications/bali-phy-3.2/share/doc/bali-phy/examples/sequences/</code>.
     </p>
 
     <p>Also note that <span class="command"><strong>bali-phy</strong></span>
@@ -587,7 +588,7 @@ scale = 1,3:</pre><p>
       
       <p>Here we analyze the EF-Tu 5-taxon data set provided with
 	the software.</p>
-      <pre class="screen"> <code class="prompt">%</code> <strong class="userinput"><code>bali-phy ~/Applications/bali-phy-3.1/share/doc/bali-phy/examples/sequences/EF-Tu/5d.fasta</code></strong></pre>
+      <pre class="screen"> <code class="prompt">%</code> <strong class="userinput"><code>bali-phy ~/Applications/bali-phy-3.2/share/doc/bali-phy/examples/sequences/EF-Tu/5d.fasta</code></strong></pre>
     </div></div><br class="example-break">
 
     <div class="example"><a name="idp779"></a><p class="title"><b>Example 2. Multiple-Rate Substitution Model</b></p><div class="example-contents">
@@ -597,7 +598,7 @@ scale = 1,3:</pre><p>
 	invariant sites.  The amount of rate variation and the fraction of
 	invariant sites are estimated</p>
       
-      <pre class="screen"> <code class="prompt">%</code> <strong class="userinput"><code>bali-phy ~/Applications/bali-phy-3.1/share/doc/bali-phy/examples/sequences/EF-Tu/5d.fasta --smodel lg08+Rates.log_normal+inv</code></strong></pre></div></div><br class="example-break">
+      <pre class="screen"> <code class="prompt">%</code> <strong class="userinput"><code>bali-phy ~/Applications/bali-phy-3.2/share/doc/bali-phy/examples/sequences/EF-Tu/5d.fasta --smodel lg08+Rates.log_normal+inv</code></strong></pre></div></div><br class="example-break">
 
     <div class="example"><a name="idp787"></a><p class="title"><b>Example 3. Fixed alignment</b></p><div class="example-contents">
       
@@ -605,7 +606,7 @@ scale = 1,3:</pre><p>
       the software. The <strong class="userinput"><code>-Inone</code></strong> option is used, fixing the alignment and making indels non-informative.
       </p> 
 
-      <pre class="screen"> <code class="prompt">%</code> <strong class="userinput"><code>bali-phy ~/Applications/bali-phy-3.1/share/doc/bali-phy/examples/sequences/5S-rRNA/25-muscle.fasta -Inone</code></strong></pre>
+      <pre class="screen"> <code class="prompt">%</code> <strong class="userinput"><code>bali-phy ~/Applications/bali-phy-3.2/share/doc/bali-phy/examples/sequences/5S-rRNA/25-muscle.fasta -Inone</code></strong></pre>
 
     </div></div><br class="example-break">
   </div>


=====================================
doc/README.itex.xml
=====================================
--- a/doc/README.itex.xml
+++ b/doc/README.itex.xml
@@ -1,5 +1,5 @@
 <!DOCTYPE book [
-<!ENTITY  version        "3.1.4"         >
+<!ENTITY  version        "3.2"         >
 
 <!ENTITY  source.file    "bali-phy-&version;.tar.gz"         >
 <!ENTITY  linux64.file   "bali-phy-&version;-linux64.tar.gz"         >
@@ -848,6 +848,13 @@ scale = 1,3:</programlisting>
 	  </listitem>
 	</varlistentry>
 	
+	<varlistentry>
+	  <term>C1.run.json</term>
+	  <listitem>
+	    <para>JSON file containing information about the command line, models, hostname, start time, etc.</para>
+	  </listitem>
+	</varlistentry>
+
       </variablelist>
       
       <para>For the last two files, each line in these files corresponds to one iteration.</para>


=====================================
doc/README.pdf
=====================================
Binary files a/doc/README.pdf and b/doc/README.pdf differ


=====================================
doc/README.xhtml
=====================================
The diff for this file was not included because it is too large.

=====================================
examples/models/CoalMine.hs
=====================================
--- a/examples/models/CoalMine.hs
+++ b/examples/models/CoalMine.hs
@@ -1,4 +1,4 @@
-module AirLine where {
+module CoalMine where {
 import Distributions;
 
 fatalities = [4, 5, 4, 1, 0, 4, 3, 4, 0, 6, 3, 3, 4, 0, 2, 6, 3, 3, 5, 4, 5, 3, 1, 4, 4, 1, 5, 5, 3, 4, 2, 5, 2, 2, 3, 4, 2, 1, 3, 2, 2, 1, 1, 1, 1, 3, 0, 0, 1, 0, 1, 1, 0, 0, 3, 1, 0, 3, 2, 2, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 2, 1, 0, 0, 0, 1, 1, 0, 2, 3, 3, 1, 1, 2, 1, 1, 1, 1, 2, 3, 3, 0, 0, 0, 1, 4, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1];


=====================================
functions/rs07_relaxed_rates.json
=====================================
--- a/functions/rs07_relaxed_rates.json
+++ b/functions/rs07_relaxed_rates.json
@@ -1,7 +1,6 @@
 {
     "name": "rs07_relaxed_rates",
     "result_type": "IndelModel",
-    "generate_function": false,
     "call": "IModel.rs07_relaxed_rates_model",
     "args": "",
     "extract": "all"


=====================================
meson.build
=====================================
--- a/meson.build
+++ b/meson.build
@@ -1,5 +1,5 @@
 project('bali-phy', ['cpp','c'],
-	version: '3.1.5',
+	version: '3.2',
 	default_options : [
 	  'buildtype=release',
 	  'cpp_std=c++14'
@@ -135,7 +135,7 @@ run_tests = find_program(join_paths(meson.source_root(),'tests/run-tests.py'))
 
 test('bali-phy testsuite',
      run_tests,
-     timeout: 600,
+     timeout: 3000,
      workdir: join_paths(meson.source_root(),'tests'),
      args:[baliphy.full_path(), packagepath])
 
@@ -146,7 +146,7 @@ testiphy = find_program(join_paths(meson.source_root(),'testiphy/testiphy'), req
 if testiphy.found()
   test('testiphy (likelihood testsuite)',
        testiphy,
-       timeout: 600,
+       timeout: 3000,
        workdir: join_paths(meson.source_root(),'testiphy'),
        args:[baliphy.full_path(), packagepath])
 endif


=====================================
scripts/bp-analyze
=====================================
--- a/scripts/bp-analyze
+++ b/scripts/bp-analyze
@@ -419,7 +419,13 @@ sub html_header
 
       .content {margin:1em; margin-top: 3em}
       .backlit td {background: rgb(220,220,220);}
-      .anchor {position: relative; top: -3em}
+
+      :target:before {
+        content:"";
+        display:block;
+        height:2em; /* fixed header height*/
+        margin:-2em 0 0; /* negative fixed header height */
+      }
 
       h1 {font-size: 150%;}
       h2 {font-size: 130%; margin-top:2.5em; margin-bottom: 1em}


=====================================
src/builtins/Distribution.cc
=====================================
--- a/src/builtins/Distribution.cc
+++ b/src/builtins/Distribution.cc
@@ -1,5 +1,4 @@
 #pragma clang diagnostic ignored "-Wreturn-type-c-linkage"
-#undef NDEBUG
 #include <vector>
 #include <valarray>
 #include <string>


=====================================
src/builtins/SMC.cc
=====================================
--- a/src/builtins/SMC.cc
+++ b/src/builtins/SMC.cc
@@ -30,7 +30,7 @@ double quantile(double eta, double p)
 
 vector<double> get_bin_boundaries(int n, const vector<double>& coalescent_rates, const vector<double>& level_boundaries)
 {
-    assert(coalescent_rates.size() + 1 == level_boundaries.size());
+    assert(coalescent_rates.size() == level_boundaries.size());
     assert(level_boundaries[0] == 0.0);
 
     vector<double> b(n+1);
@@ -58,13 +58,14 @@ vector<double> get_bin_boundaries(int n, const vector<double>& coalescent_rates,
 	    assert(level < level_boundaries.size());
 
 	    double delta_t = quantile(coalescent_rates[level], 1.0 - q2);
-	    if (t2 + delta_t < level_boundaries[level+1])
+	    if (t2 + delta_t < level_boundaries[level] or level == level_boundaries.size()-1)
 	    {
 		b[i] = t2 + delta_t;
 		break;
 	    }
 	    else
 	    {
+		assert(level + 1 < level_boundaries.size());
 		t2 = level_boundaries[level+1];
 		delta_t = level_boundaries[level+1] - level_boundaries[level];
 		assert(delta_t >= 0);
@@ -397,11 +398,13 @@ constexpr double scale_min = 1.0/scale_factor;
 constexpr double log_scale_min = -177.445678223345999210811423093293201427328034396225345054e0;
 
 
-enum class site_t {unknown=0,poly,mono,missing};
+enum class site_t {unknown=0,poly,mono,missing,empty};
 
 inline site_t classify_site(int x1, int x2)
 {
-    if (x1 < 0 or x2< 0)
+    if (x1 == -1 and x2 == -1)
+	return site_t::empty;
+    else if (x1 < 0 or x2< 0)
 	return site_t::missing;
     else if (x1 == x2)
 	return site_t::mono;
@@ -486,7 +489,12 @@ vector<pair<int,site_t>> classify_sites(const alignment& A)
     vector<pair<int,site_t>> sites;
     for(int l=1; l < A.length();)
     {
-	site_t s = classify_site(A(l,0),A(l,1));
+	site_t s = classify_site(A(l,0), A(l,1));
+	if (s == site_t::empty)
+	{
+	    l++;
+	    continue;
+	}
 	int count = 0;
 
 	do
@@ -518,7 +526,9 @@ void smc_group(vector<double>& L, vector<double>& L2, int& scale, const vector<E
 	    double temp = 0;
 	    for(int j=0;j<n_bins; j++)
 		temp += L[j] * M(j,k);
-	    L2[k] = temp;
+
+	    assert(temp > -1.0e-9);
+	    L2[k] = std::max(temp, 0.0);
 	}
 	i += taking;
 
@@ -532,7 +542,7 @@ void smc_group(vector<double>& L, vector<double>& L2, int& scale, const vector<E
 
 log_double_t smc(double rho_over_theta, vector<double> coalescent_rates, vector<double> level_boundaries, const alignment& A)
 {
-    assert(level_boundaries.size() >= 2);
+    assert(level_boundaries.size() >= 1);
     assert(level_boundaries[0] == 0.0);
 
     assert(rho_over_theta >= 0);
@@ -564,8 +574,13 @@ log_double_t smc(double rho_over_theta, vector<double> coalescent_rates, vector<
     int scale = 0;
 
     // FIXME: I think we should be able to start at site -1 with L[i] = pi[i], if pi[i] is the equilibrium of T(j,k)
+    //        Its not exactly the equilibrium, so this is approximate, I guess.
     for(int i=0;i< n_bins; i++)
-	L[i] = pi[i] * emission_probabilities[i](A(0,0), A(0,1));
+    {
+	L[i] = pi[i];
+//	if (A(0,0) >= 0 and A(0,1) >= 0)
+//	    L[i] *= emission_probabilities[i](A(0,0), A(0,1));
+    }
 
     // # Iteratively compute likelihoods for remaining columns
     const auto transition = get_transition_probabilities(bin_boundaries, bin_times, theta, rho);
@@ -610,7 +625,6 @@ extern "C" closure builtin_function_smc_density(OperationArgs& Args)
     level_boundaries.push_back(0);
     for(auto& l: level_boundaries_)
 	level_boundaries.push_back(l.as_double());
-    level_boundaries.push_back(100000);
 
     auto a = Args.evaluate(3);
     auto& A = a.as_<alignment>();


=====================================
src/mcmc/sample-two-nodes.cc
=====================================
--- a/src/mcmc/sample-two-nodes.cc
+++ b/src/mcmc/sample-two-nodes.cc
@@ -1,4 +1,3 @@
-#undef NDEBUG
 /*
   Copyright (C) 2004-2007,2009-2014 Benjamin Redelings
 


=====================================
src/models/rules.cc
=====================================
--- a/src/models/rules.cc
+++ b/src/models/rules.cc
@@ -167,11 +167,6 @@ ptree convert_rule(const Rules& R, Rule rule)
 	{
 	    (*alphabet) = parse(R, alphabet->get_value<string>());
 	}
-
-	if (auto applied_args= x.get_child_optional("applied_args"))
-	{
-	    (*applied_args) = parse_type(applied_args->get_value<string>());
-	}
     }
 
     return rule;


=====================================
src/models/setup.cc
=====================================
--- a/src/models/setup.cc
+++ b/src/models/setup.cc
@@ -287,11 +287,6 @@ expression_ref arg_to_apply(const ptree& expression)
     return E;
 }
 
-expression_ref apply_args(expression_ref action, const ptree& applied_args)
-{
-    return {action, arg_to_apply(applied_args)};
-}
-
 optional<vector<double>> get_frequencies_from_tree(const ptree& model_rep, const alphabet& a)
 {
     vector<double> pi;
@@ -442,7 +437,6 @@ expression_ref get_model_as(const Rules& R, const ptree& model_rep, const map<st
     if (not rule->count("call")) throw myexception()<<"No call for '"<<name<<"'";
 	
     // 6a. Extract parts of the rule
-    bool generate_function = rule->get("generate_function",true);
     bool perform_function = rule->get("perform",false);
     ptree call = rule->get_child("call");
     ptree args = rule->get_child("args");
@@ -451,20 +445,6 @@ expression_ref get_model_as(const Rules& R, const ptree& model_rep, const map<st
 	throw myexception()<<"For rule '"<<name<<"', function '"<<call.get_value<string>()<<"' must be a qualified symbol or a builtin constructor like '(,)', but it is neither!";
     expression_ref E = dummy(call.get_value<string>());
 
-    // This means (i) don't perform the arguments first and (ii) don't add "return" to the result.
-    if (not generate_function)
-    {
-	for(int i=0;i<call.size();i++)
-	{
-	    string arg_name = array_index(call,i).get_value<string>();
-	    // check that arg_name is a valid argument
-	    get_arg(*rule, arg_name);
-	    expression_ref arg = get_model_as(R, model_rep.get_child(arg_name), scope);
-	    E = {E,arg};
-	}
-	return E;
-    }
-
     // 6b. Apply the arguments listed in the call : 'f call.name1 call.name2 call.name3'
     //    There could be fewer of these than the rule arguments.
     for(int i=0;i<call.size();i++)
@@ -489,11 +469,6 @@ expression_ref get_model_as(const Rules& R, const ptree& model_rep, const map<st
 	string arg_name = argi.get_child("arg_name").get_value<string>();
 	expression_ref arg = get_model_as(R, model_rep.get_child(arg_name), extend_scope(*rule, i, scope));
 
-	// Apply arguments if necessary
-	auto applied_args = argi.get_child_optional("applied_args");
-	if (applied_args)
-	    arg = apply_args(arg, *applied_args);
-
 	auto log_name = name + ":" + arg_name;
 	// Prefix "arg_name" (arg_+arg_name)
 	arg = {Prefix, log_name, arg};


=====================================
src/tools/alignment-compare.cc
=====================================
--- a/src/tools/alignment-compare.cc
+++ b/src/tools/alignment-compare.cc
@@ -34,10 +34,6 @@ along with BAli-Phy; see the file COPYING.  If not see
 #include "distance-methods.H"
 #include "rng.H"
 
-#ifdef NDEBUG
-#undef NDEBUG
-#endif
-
 #include <boost/program_options.hpp>
 #include <boost/shared_ptr.hpp>
 #include "io.H"


=====================================
src/tools/alignment-identity.cc
=====================================
--- a/src/tools/alignment-identity.cc
+++ b/src/tools/alignment-identity.cc
@@ -56,8 +56,6 @@ void do_setup(const variables_map& args,vector<alignment>& alignments)
 	throw myexception()<<"Alignment sample is empty.";
 }
 
-#undef NDEBUG
-
 unsigned n_with_identity(const alignment& A,int s1,int s2,double I)
 {
     // Get matches


=====================================
src/tools/alignment-smc.cc
=====================================
--- a/src/tools/alignment-smc.cc
+++ b/src/tools/alignment-smc.cc
@@ -278,8 +278,10 @@ bool is_masked_column(const alignment& A, int c)
 	    return false;
     return true;
 }
+
 bool is_variant_column(const alignment& A, int c)
 {
+    assert(0 <= c and c < A.length());
     int i=0;
     int l0 = -1;
     for(;i<A.n_sequences() and l0 < 0;i++)
@@ -291,6 +293,15 @@ bool is_variant_column(const alignment& A, int c)
     return false;
 }
 
+int count_variant_columns(const alignment& A, int c1, int c2)
+{
+    int count = 0;
+    for(int c=c1;c<=c2 and c<A.length();c++)
+	if (is_variant_column(A,c))
+	    count++;
+    return count;
+}
+
 void remove_columns(alignment& A, const std::function<bool(int)>& remove)
 {
     int j=0;
@@ -575,31 +586,60 @@ void write_histogram(std::ostream& o, int blocksize, const alignment& A)
 }
 
 
-// The counts should be Poisson distributed.  It will be relatively rate to get
+// The counts should be Poisson distributed.  It will be relatively rare to get
 // counts more than 10 times higher than the mean
 
-// FIXME - this does depend on the window boundaries.
-// Change so that we use a sliding window.
+dynamic_bitset<> block_mask(dynamic_bitset<> mask, int blocksize)
+{
+    auto mask2 = mask;
+    for(int i=1; i<=blocksize; i++)
+    {
+	mask2 >>= 1;
+	mask |= mask2;
+    }
+    return mask;
+}
 
 int autoclean(alignment& A)
 {
-    constexpr double mean = 2.0;
+    constexpr double mean_snps_per_block = 2.0;
     constexpr double factor = 10.0;
-    int L = A.length();
+    int n_sites = A.length();
     int S = n_snps(A);
     if (S < 100) throw myexception()<<"Refusing to autoclean chromosome with < 100 variant sites.";
 
     int masked = 0;
-    int blocksize = int(L*(mean/S)+0.5);
-    auto counts = snps_in_blocks(A, blocksize);
+    int blocksize = int(n_sites*(mean_snps_per_block/S)+0.5);
 
-    for(int i=0;i<counts.size();i++)
-	if (counts[i] >= mean*factor)
+    dynamic_bitset<> mask(n_sites);
+    int count = 0;
+    for(int c2=0; c2<n_sites; c2++)
+    {
+	int c1 = c2 - blocksize;
+
+	if (            is_variant_column(A,c2)) count++;
+	if (c1 >= 0 and is_variant_column(A,c1)) count--;
+
+	assert(count == count_variant_columns(A, std::max(c1+1,0), c2));
+
+	if (count >= mean_snps_per_block*factor)
 	{
+	    mask.set(c2);
 	    masked++;
-	    for(int j=i*blocksize;j<A.length() and j<(i+1)*blocksize;j++)
-		mask_column(A, j);
 	}
+    }
+
+    auto mask2 = block_mask(mask, blocksize);
+    for(int i=0;i<n_sites;i++)
+    {
+	if (mask2[i])
+	{
+	    mask_column(A, i);
+	}
+    }
+
+//    std::cerr<<"Masked "<<masked<<" sites\n";
+
     return masked;
 }
 
@@ -642,7 +682,9 @@ int main(int argc,char* argv[])
 
 	auto A = A0;
 	const alphabet& a = A.get_alphabet();
-    
+
+	if (args.count("autoclean"))
+	    autoclean(A);
 
 	if (args.count("mask-file"))
 	{
@@ -653,15 +695,6 @@ int main(int argc,char* argv[])
 	    }
 	}
 
-	if (args.count("autoclean"))
-	    autoclean(A);
-
-	if (args.count("histogram"))
-	{
-	    write_histogram(std::cout, args["histogram"].as<int>(), A);
-	    exit(0);
-	}
-
 	if (args.count("mask-gaps"))
 	{
 	    // 1. label gap columns with 2 to remove them.
@@ -678,6 +711,12 @@ int main(int argc,char* argv[])
 	    remove_and_mask_columns(A, [&gaps](int c){return gaps[c];});
 	}
 
+	if (args.count("histogram"))
+	{
+	    write_histogram(std::cout, args["histogram"].as<int>(), A);
+	    exit(0);
+	}
+
 	//----- Count informative/non-constant sites ----//
 	dynamic_bitset<> informative(A.length());
 	dynamic_bitset<> informative2(A.length());



View it on GitLab: https://salsa.debian.org/med-team/bali-phy/compare/ee79a02e55d7c1b0dcddf63ff96c2dd1e5dc4cac...a40d3759c24095072e4481ced05d83543aada7c5

-- 
View it on GitLab: https://salsa.debian.org/med-team/bali-phy/compare/ee79a02e55d7c1b0dcddf63ff96c2dd1e5dc4cac...a40d3759c24095072e4481ced05d83543aada7c5
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20180626/1eba5925/attachment-0001.html>


More information about the debian-med-commit mailing list