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 | |
| n=${1} | |
| if test -z $n ; then | |
| echo "Takes a number argument n that, as ot${n}.opentreeoflife.org should be the machine to update" | |
| exit 1 | |
| fi | |
| u=${2} | |
| if test -z $u ; then | |
| u=admin | |
| fi |
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 | |
| i="${1}" | |
| if test -z $i ; then | |
| echo "Number like 51 for ot51 needed as an arg" | |
| exit 1 | |
| fi | |
| echo "fetching cert from ot$i to compare to a local copy of a cert from ot50" | |
| if echo | openssl s_client -servername ot${i}.opentreeoflife.org -connect ot${i}.opentreeoflife.org:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > ot${i}-certificate.crt | |
| diff ot50-certificate.crt ot${i}-certificate.crt ; then | |
| echo "Success" |
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 | |
| def func(arg): | |
| a_var.append(1) | |
| loc_a_var = arg | |
| b_var = list(arg) | |
| print('func({} with id: {} and ids: {})'.format(repr(arg), id(arg), [id(i) for i in arg])) | |
| print(' locals: {}'.format({k: id(v) for k, v in locals().items() if not k.startswith('__')})) | |
| print(' globals: {}'.format({k: id(v) for k, v in globals().items() if not k.startswith('__')})) |
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/env python | |
| """ Example of wrapping a call to gnparser from python | |
| See https://gitlab.com/gogna/gnparser#command-line | |
| Adapted based on instructions on | |
| https://medium.com/learning-the-go-programming-language/calling-go-functions-from-other-languages-4c7d8bcc69bf | |
| """ | |
| import ctypes | |
| import json | |
| lib = ctypes.cdll.LoadLibrary("./libgnparser.so") |
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 | |
| inpdir=$1 | |
| if ! test -d "${inpdir}" ; then | |
| echo "$0 must be passed in a directory of subproblems (with ott###.tre files)." | |
| exit 1 | |
| fi | |
| rpwd=`realpath .` | |
| rpid=`realpath $inpdir` | |
| if test "${rpwd}" = "${rpid}" ; then | |
| echo "$0 Cannot be run in place." |
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 | |
| '''Reverses the order of the first n-1 lines of a file | |
| and writes it to stdout. | |
| ''' | |
| import sys | |
| fp = sys.argv[1] | |
| with open(fp, 'r', encoding='utf-8') as inp: | |
| lines = inp.readlines() | |
| last = lines.pop(-1) | |
| lines.reverse() |
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 python | |
| import json | |
| import sys | |
| import subprocess | |
| import itertools | |
| inpjson = 'subproblem_size_summary.json' | |
| with open(inpjson, 'r', encoding='utf-8') as inp: | |
| summary_blob = json.load(inp) |
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 python | |
| import json | |
| import sys | |
| import subprocess | |
| import itertools | |
| DEBUG = False | |
| def count_tips_and_inf_splits(fn): | |
| out = subprocess.check_output(['otc-degree-distribution', fn], stderr=subprocess.DEVNULL).decode('utf-8') |
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 | |
| otc-tree-tool --indented-table labelled_supertree/labelled_supertree_simplified_ottnames.tre > subproblems/indented-table.txt | |
| cat subproblems/indented-table.txt | sed -E '/ +mrca/d' | sed -E 's/.* ott([0-9]+) : ([0-9]+)/"ott\1": \2,/' > num_tips_for_ott_internals_in_labelled_tree.json | |
| rm subproblems/indented-table.txt |
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 | |
| # This needs to be made part of the propinquity process. | |
| # MTH ran steps that made up the basis of this before the | |
| # Jan 2020 SSB workshop. So the resulting file will be in | |
| # the https://files.opentreeoflife.org/synthesis/opentree12.3/opentree12.3/subproblems/ | |
| # folder, but (perversely enough) not in the tar archive at https://files.opentreeoflife.org/synthesis/opentree12.3/opentree12.3.tgz | |
| # If all goes as planned, we'll start adding this to the tree build process so that it will be in | |
| # builds and archives made after 12.3 | |
| # This is to be run with the working directory being the propinquity |