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 | |
| from peyotl.api.taxomachine import Taxomachine | |
| taxomachine = Taxomachine() | |
| from peyotl.nexson_syntax import write_as_json | |
| context_name = 'All life' | |
| for n in sys.argv[1:]: | |
| if n.startswith('-c'): | |
| context_name = n[2:] | |
| else: |
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 | |
| from peyotl.api.taxomachine import Taxomachine | |
| taxomachine = Taxomachine() | |
| from peyotl.nexson_syntax import write_as_json | |
| context_name = 'All life' | |
| for n in sys.argv[1:]: | |
| if n.startswith('-c'): | |
| context_name = n[2:] | |
| else: |
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 | |
| _SCRIPT_NAME = os.path.split(sys.argv[0])[-1] | |
| _FORBIDDEN = re.compile(r'[^- 0-9a-zA-Z`~@#$%^&*()_+={}|\\\[\]:;"\'<,>.?/]') | |
| _NEEDS_QU_PUNC_STR = r'[\[\]():,;]' | |
| _NEEDS_QUOTES_PATTERN = re.compile(r'(\s|' + _NEEDS_QU_PUNC_STR + ')') | |
| _NEEDS_QUOTES_PUNC_PATTERN = re.compile(_NEEDS_QU_PUNC_STR) | |
| _SINGLE_QUOTE = "'" |
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 | |
| # vim: set fileencoding=utf-8 : | |
| import sys | |
| import os | |
| import re | |
| u''' | |
| Unicode char lists found by running against ott2.8 | |
| Using the names column in taxonomy.tsv required allowing the | |
| following unicode characters: | |
| æ denoted: u'\xe6' |
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 | |
| if ! which ott_names_to_newick.py >/dev/null 2>&1 | |
| then | |
| echo 'Download ott_names_to_newick.py from https://gist.github.com/mtholder/ac58ab1b3c6a962b9bdc and put it on your PATH' | |
| exit 1 | |
| fi | |
| echo 'grabbing names from taxonomy' | |
| set -x | |
| awk 'BEGIN { FS = "\t\\|\t" } ; {print $3 }' taxonomy.tsv >names.txt | |
| awk 'BEGIN { FS = "\t\\|\t" } ; {print $6 }' taxonomy.tsv >uniqnames.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
| #!/usr/bin/env python | |
| import codecs | |
| import sys | |
| chars = set() | |
| for filepath in sys.argv[1:]: | |
| with codecs.open(filepath, 'r', encoding='utf-8') as fo: | |
| for line in fo: | |
| chars.update(iter(line)) | |
| c = list(chars) | |
| c.sort() |
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
| /* Most of this code is from GBParsy which available from https://code.google.com/p/gbfp/ | |
| T.-H. Lee, Y.-K. Kim and B.H. Nahm (2008) GBParsy: A GenBank flatfile parser library with high speed. BMC Bioinformatics, 9:321. | |
| That code is released under the GPL (see bottom of file). | |
| Mark T. Holder only wrote the slight modification to parsing of the GI and a simpliefied main | |
| function (based on the example seqext.c from gbfpy) |
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 StringIO import StringIO | |
| import sys | |
| out = sys.stdout | |
| def get_indented(x, indent): | |
| start_indent = indent | |
| written_something = False | |
| out = StringIO() | |
| for letter in x: |
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 dendropy import DnaCharacterMatrix, Tree | |
| import sys | |
| d = DnaCharacterMatrix.get(path=sys.argv[1], | |
| schema='fasta') | |
| # make the taxon_namespace immutable, so the tree does not add | |
| # new labels... | |
| d.taxon_namespace.is_mutable = False | |
| tree = Tree.get(path=sys.argv[2], | |
| schema='newick', |
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 re | |
| inp = sys.stdin | |
| outp = sys.stdout | |
| JS_PAT = re.compile(r'^<script src="/opentree/static/(.+)" type="text/javascript"></script>\s+$') | |
| CSS_PAT = re.compile(r'^<link href="/opentree/static/(.+)" rel="stylesheet" type="text/css" />\s+$') |