Skip to content

Instantly share code, notes, and snippets.

@mtholder
Created September 19, 2014 11:20
Show Gist options
  • Select an option

  • Save mtholder/c634fe937800350762e6 to your computer and use it in GitHub Desktop.

Select an option

Save mtholder/c634fe937800350762e6 to your computer and use it in GitHub Desktop.
check a version of ott for new characters (punctuation and unicode) in labels
#!/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
awk 'BEGIN { FS = "\t\\|\t" } ; {print $4 }' synonyms.tsv >syn-uniqnames.txt
echo 'testing names from taxonomy for new characters'
for i in names.txt uniqnames.txt syn-uniqnames.txt
do
if ! ott_names_to_newick.py -f $i >newick-$i 2>err-$i
then
cat err-$i
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment