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/env python3 | |
| import sys | |
| import dendropy | |
| import re | |
| id_extractor = re.compile('.*ott([0-9]+)$') | |
| tree_filepath = sys.argv[1] | |
| id_filepath = sys.argv[2] | |
| tree = dendropy.Tree.get(path=tree_filepath, schema='newick', suppress_internal_node_taxa=False) | |
| # Get the list of IDs to retain |
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/bash | |
| fp=$1 | |
| fn=$(basename $fp) | |
| if ! test -f $fp ; then | |
| echo "$fp does not exist" | |
| exit 1 | |
| fi | |
| o=`grep '"^ot:ottId": ' "$fp" | sed 's/".*": //' | sort -g | sed ':a;N;$!ba;s/\n/ /g' | sed -E 's/ +/ /g'` | |
| echo "\"${fn}\": frozenset([ ${o} ])," |
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 python3 | |
| # -*- coding: <encoding name> -*- | |
| from __future__ import print_function | |
| from collections import defaultdict | |
| from math import log | |
| import codecs | |
| from ctypes import c_uint64 as c_trie_node_type | |
| import sys | |
| """ Pseudocode from Maly, 1976 Appendix B |
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/python3 | |
| import requests | |
| import time | |
| from threading import Thread | |
| machine='http://localhost:1984' | |
| # machine='https://ot39.opentreeoflife.org' | |
| # machine='https://api.opentreeoflife.org' |
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/bash | |
| PAR_DIR=/home/mholder | |
| TEST_OT_DIR="${PAR_DIR}/test-ot-ws" | |
| TEST_LOG_DIR="${PAR_DIR}/testotlogs" | |
| source "${PAR_DIR}/env/test-otc-ws/bin/activate" || exit | |
| source "${TEST_OT_DIR}/dev/activate.sh" || exit | |
| cd "${TEST_OT_DIR}" || exit | |
| date > "${TEST_LOG_DIR}/latest.log" | |
| nf=0 | |
| if ! git pull origin >> "${TEST_LOG_DIR}/latest.log" 2>&1 ; then |
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 | |
| # -*- coding: utf-8 -*- | |
| from scipy.optimize import bracket, brent | |
| from scipy.stats import binom | |
| from math import log, isnan | |
| import sys | |
| _inf = float('inf') | |
| def main(): | |
| n = 100 |
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 | |
| from __future__ import print_function | |
| import sys | |
| try: | |
| from selenium import webdriver | |
| except: | |
| sys.exit('Need to run:\npip install selenium\n') | |
| import tempfile | |
| import time | |
| import os |
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 | |
| from __future__ import print_function | |
| import sys | |
| try: | |
| farg = [float(i) for i in sys.argv[1:]] | |
| for i in farg: | |
| assert i >= 0.0 | |
| d_12, d_13, d_14, d_23, d_24, d_34 = farg | |
| except: | |
| m = 'd_12, d_13, d_14, d_23, d_24, d_34' |
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 | |
| import os | |
| import re | |
| tread_pat = re.compile('^tread') | |
| xread_pat = re.compile('^xread') | |
| treefilename = sys.argv[1] | |
| ext_data_pref = "tread 'tree(s) from TNT, for data in " | |
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
| import sys | |
| fn = sys.argv[1] | |
| ls_list = [] | |
| mapping = {} | |
| with open(fn, 'r') as inp: | |
| for n, line in enumerate(inp): | |
| ls = line.split('\t|\t') | |
| assert len(ls) == 5 | |
| assert ls[-1] == '\n' | |
| if n > 0: |