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
| #!/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
| 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
| #!/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
| #!/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
| 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: |
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
| #!/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 | |
| 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 | |
| # -*- 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 |