This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| PREFIX_PARENT="${HOME}/envs" | |
| set -x | |
| mkdir -p "${PREFIX_PARENT}/beagle" || exit | |
| svn checkout https://beagle-lib.googlecode.com/svn/trunk/ beagle-lib || exit | |
| cd beagle-lib | |
| sh autogen.sh | |
| mkdir build || exit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo apt-get install git | |
| git clone git://github.com/mtholder/ot-vagrant.git | |
| cd ot-vagrant/ | |
| git pull origin | |
| cat >web2py_passwords.sh <<ENDOFHEREDOC | |
| #!/bin/sh | |
| export WEB2PY_DB_USER=greatusernamehere | |
| export WEB2PY_DB_PASSWD=somepassword | |
| ENDOFHEREDOC |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def calc_F_Tt(r_Tb, n_Tt, r_Tt, param_vec): | |
| if r_Tt > n_Tt: | |
| return 0.0 | |
| Ne = param_vec[ParamOrder.PopSize].value | |
| mu = param_vec[ParamOrder.MutRate].value | |
| tau = param_vec[ParamOrder.DivTime].value | |
| # The probability of coalescence along the Turkish branch goes to 1 as tau gets big or Ne gets small | |
| prob_coalescence = 1 - exp(-tau/(2.0*Ne)) | |
| prob_no_coalescence = 1 - prob_coalescence |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| calc.F_Tt <- function (r_Tb, n_Tt, r_Tt, param.vec) { | |
| if (r_Tt > n_Tt) { | |
| return (0.0); | |
| } | |
| # unnumbered eqn on the bottom of page 5 | |
| Ne <- param.vec[2]; | |
| mu <- param.vec[3]; | |
| tau <- param.vec[4]; | |
| # The probability of coalescence along the Turkish branch goes to 1 as tau gets big or Ne gets small |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| _treemachine() | |
| { | |
| local cur=${COMP_WORDS[COMP_CWORD]} | |
| local prev=${COMP_WORDS[COMP_CWORD-1]} | |
| if test $prev = "treemachine" | |
| then | |
| # if the previous word was treemachine, prompt with the commands | |
| COMPREPLY=( $(compgen -W "addtree reprocess deletetrees jsgol fulltree fulltree_sources fulltreelist mrpdump graphml csvdump justtrees sourceexplorer listsources biparts mapsupport getlicanames counttips diversity labeltips getupdatedlist" -- $cur)) | |
| else | |
| #otherwise do file completion. Which seems tougher than it should be... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Copyright (C) 2012 Mark T. Holder | |
| // | |
| // Based on example/splitsinfile/splitsinfile.cpp in NEXUS class library | |
| // | |
| // After NCL has been installed at ${NCL_PREFIX} | |
| // | |
| // g++ newick2taxalist.cpp -o newick2taxalist -I "${NCL_PREFIX}/include" -lncl -L "${NCL_PREFIX}/lib/ncl" | |
| // | |
| // Takes a newick file and prints out the taxa labels, one per line. | |
| // |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # Script to use NCLconverter to convert TreeBase NEXUS files to newick | |
| # Invocation: | |
| # sh range_of_treebase2newick.sh 10000 10100 | |
| # in a directory with filenames like S10001.nex to convert each file | |
| # name like S10000.nex up to file S10100.nex to newick. | |
| # you should get files like: | |
| # outS####.tre newick tree for the first trees block | |
| # 2outS####.tre , 3outS####.tre , etc if the file has multiple output blocks | |
| # outS####.NameTranslationFile.txt is an ad hoc xml description of the name mapping |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| ''' | |
| Example of a client of the demo of the TNRS API described at: | |
| http://www.evoio.org/wiki/Phylotastic/TNRS | |
| Reads names (separated by newline characters) from file names passed in as | |
| command-line arguments (or reads name from standard input if no arguments | |
| are given). | |
| Outputs tab-delimited summary of the matches for each query sorted by score of |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # You might want to modify the first line to specify your own install location. | |
| # In theory the rest should not need tweaking... | |
| export GCC_PREFIX="$HOME/gcc4.7" | |
| # Hopefully, you can tweak these as they get out of date, but the download URL's | |
| # may not be stable to text substitution. | |
| GMP_DOWNLOAD_VERSION=gmp-5.0.5 | |
| MPFR_DOWNLOAD_VERSION=mpfr-3.1.0 | |
| MPC_DOWNLOAD_VERSION=mpc-0.8.2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import sys, math | |
| v_list = [float(value) for value in sys.stdin] | |
| offset = max(v_list) | |
| n = len(v_list) | |
| sum_exps = sum([math.exp(v - offset) for v in v_list]) | |
| mean_exps = sum_exps/n | |
| sys.stdout.write('Log of mean of the exp of %d values is:\n' % n) | |
| sys.stdout.write('%8.7f\n' % (math.log(mean_exps) + offset)) |