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 | |
| inp = sys.stdin | |
| count = 0 | |
| for line in inp: | |
| ls = [i.strip() for i in line.split(' |')] | |
| if ls: | |
| assert len(ls) == 3 and ls[2] == '' | |
| rank = ls[0] | |
| if rank == 'species': |
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 | |
| OTT_DIR=$1 | |
| ROOT_TAXON=$2 | |
| echo "Extracting taxa that are descendants of ${ROOT_TAXON}" | |
| otc-taxonomy-parser \ | |
| $OTT_DIR \ | |
| --format="%R | %N |" \ | |
| -r $ROOT_TAXON \ | |
| --cull-flags "major_rank_conflict,major_rank_conflict_inherited,environmental,viral,barren,not_otu,hidden,was_container,inconsistent,hybrid,merged" \ |
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
| d = read.table('times_num_studies.tsv', header=TRUE, sep="\t"); | |
| print(d); | |
| dt = as.POSIXct(d$time, origin="1970-01-01"); | |
| print(dt); | |
| pdf("ot-time-series.pdf"); | |
| plot(dt, d$num_phyle_studies, | |
| xlab="Date", ylab="num studies", | |
| ylim=c(0, max(d$num_phyle_studies)), | |
| type="l", |
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 json | |
| import datetime | |
| synth_j, unix_ts_and_num_studies = sys.argv[1:] | |
| ts_ns = [] | |
| with open(unix_ts_and_num_studies, 'r') as inp: | |
| for line in inp: | |
| ls = line.strip().split() | |
| if ls: |
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 | |
| git rev-list HEAD > commits.txt | |
| prev_ns=0 | |
| for sha in $(cat commits.txt) | |
| do | |
| unix_time=$(git show -s --format=%at "${sha}") | |
| git checkout $sha || exit | |
| num_studies=$(find study -name "*.json" | wc -l) | |
| if test $num_studies -ne $prev_ns | |
| 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
| #!/bin/bash | |
| # works on the unpacked dir that is posted under the link | |
| # text "All pipeline outputs " on the release page. | |
| # E.g. the release page https://tree.opentreeoflife.org/about/synthesis-release/v9.1 | |
| # points to http://files.opentreeoflife.org/synthesis/opentree9.1/opentree9.1_output.tgz | |
| # as its versions of "All pipeline outputs" | |
| # | |
| # I downloaded that, unpacked it, and provide the path to that dir as the only | |
| # argument to this script. |
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
| \documentclass{article} | |
| \usepackage{amsmath} | |
| \usepackage{paralist} | |
| \DeclareMathOperator*{\argmin}{argmin} | |
| \begin{document} | |
| \section*{Note on detecting whether a pattern is parsimony informative} | |
| Let $\ell(T, c)$ be the unordered parsimony length of discrete character pattern $c$ on | |
| tree $T$ and $\ell(T, c, i)$ be the parsimony length that combination of pattern and tree | |
| when state $i$ is enforced as the state for the root of the tree. | |
| Data pattern $c$ is ``parsimony informative'' if and only if, |
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 | |
| try: | |
| annot_fp = sys.argv[1] | |
| except: | |
| sys.exit("Expecting a path to an annotations.json file as the only argument.\n") | |
| import json | |
| import codecs | |
| with codecs.open(annot_fp, 'rU', encoding='utf-8') as inp: | |
| obj = 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/bash | |
| cd ~ | |
| mkdir OpenTree | |
| cd OpenTree/ | |
| git clone https://github.com/mtholder/propinquity.git | |
| echo '[opentree]' > ~/.opentree | |
| echo "home = $PWD" >> ~/.opentree | |
| echo 'peyotl = %(home)s/peyotl' >> ~/.opentree |
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 | |
| from peyotl.api import PhylesystemAPI | |
| import sys | |
| studyid = sys.argv[1] | |
| phy = PhylesystemAPI(get_from='local') | |
| nx = phy.get_study(studyid)['data']['nexml'] | |
| print(nx.keys()) |