Skip to content

Commit

Permalink
add doc generated by docco
Browse files Browse the repository at this point in the history
  • Loading branch information
adamzy committed Feb 20, 2014
1 parent 7d76995 commit 753912c
Show file tree
Hide file tree
Showing 26 changed files with 7,005 additions and 0 deletions.
190 changes: 190 additions & 0 deletions docs/core_binaryreconcile.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
<!DOCTYPE html>

<html>
<head>
<title>core_binaryreconcile.go</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
<link rel="stylesheet" media="all" href="docco.css" />
</head>
<body>
<div id="container">
<div id="background"></div>

<ul id="jump_to">
<li>
<a class="large" href="javascript:void(0);">Jump To &hellip;</a>
<a class="small" href="javascript:void(0);">+</a>
<div id="jump_wrapper">
<div id="jump_page">


<a class="source" href="rmq.html">
rmq.go
</a>


<a class="source" href="rmq_test.html">
rmq_test.go
</a>


<a class="source" href="core_binaryreconcile.html">
core_binaryreconcile.go
</a>


<a class="source" href="core_genetree.html">
core_genetree.go
</a>


<a class="source" href="core_node.html">
core_node.go
</a>


<a class="source" href="core_rf.html">
core_rf.go
</a>


<a class="source" href="core_speciestree.html">
core_speciestree.go
</a>


<a class="source" href="core_test.html">
core_test.go
</a>


<a class="source" href="core_tree.html">
core_tree.go
</a>


<a class="source" href="refine_linearrefinegt.html">
refine_linearrefinegt.go
</a>


<a class="source" href="refine_misc.html">
refine_misc.go
</a>


<a class="source" href="refine_test.html">
refine_test.go
</a>


<a class="source" href="refine_weightgt.html">
refine_weightgt.go
</a>


<a class="source" href="refine_weightgt_test.html">
refine_weightgt_test.go
</a>


<a class="source" href="test_misc.html">
test_misc.go
</a>


<a class="source" href="util_contract.html">
util_contract.go
</a>


<a class="source" href="util_prune.html">
util_prune.go
</a>


<a class="source" href="util_simu.html">
util_simu.go
</a>


<a class="source" href="util_test.html">
util_test.go
</a>


<a class="source" href="main.html">
main.go
</a>

</div>
</li>
</ul>

<ul class="sections">

<li id="title">
<div class="annotation">
<h1>core_binaryreconcile.go</h1>
</div>
</li>



<li id="section-1">
<div class="annotation">

<div class="pilwrap ">
<a class="pilcrow" href="#section-1">&#182;</a>
</div>

</div>

<div class="content"><div class='highlight'><pre><span class="hljs-keyword">package</span> tree</pre></div></div>

</li>


<li id="section-2">
<div class="annotation">

<div class="pilwrap ">
<a class="pilcrow" href="#section-2">&#182;</a>
</div>
<p>BinaryCost finds the duplication, loss, and deep coalescence cost
for input binary gene tree and species tree.</p>

</div>

<div class="content"><div class='highlight'><pre><span class="hljs-keyword">func</span> BinaryCost(gt *Tree, st *SpeciesTree) (dup, loss, dc <span class="hljs-typename">int</span>, err error) {
lm, err := LcaMap(gt, st)

<span class="hljs-keyword">if</span> err != <span class="hljs-constant">nil</span> {
<span class="hljs-keyword">return</span><span class="hljs-number"> 0</span>,<span class="hljs-number"> 0</span>,<span class="hljs-number"> 0</span>, err
}

<span class="hljs-keyword">for</span> _, n := <span class="hljs-keyword">range</span> gt.Nodes {
<span class="hljs-keyword">if</span> !n.IsLeaf() {
m := lm.Map[n.Id]
l := lm.Map[n.Children<span class="hljs-number">[0</span>].Id]
r := lm.Map[n.Children<span class="hljs-number">[1</span>].Id]
loss += (l.Level + r.Level -<span class="hljs-number"> 2</span>*m.Level)
dc += (l.Level + r.Level -<span class="hljs-number"> 2</span>*m.Level)
<span class="hljs-keyword">if</span> m == l || m == r {
dup++
} <span class="hljs-keyword">else</span> {
loss -=<span class="hljs-number"> 2</span>
}
}
}
dc -= <span class="hljs-built_in">len</span>(st.Nodes) -<span class="hljs-number"> 1</span>
<span class="hljs-keyword">return</span>
}</pre></div></div>

</li>

</ul>
</div>
</body>
</html>
Loading

0 comments on commit 753912c

Please sign in to comment.