Skip to content

Instantly share code, notes, and snippets.

@mtholder
Last active March 4, 2025 17:59
Show Gist options
  • Save mtholder/f733a75fe1616af1841ded62aadb4f04 to your computer and use it in GitHub Desktop.
Save mtholder/f733a75fe1616af1841ded62aadb4f04 to your computer and use it in GitHub Desktop.
export OTT to Darwin Core - currently without synonyms .
#!/bin/bash
#
# This requires a build of otcetera that from any branch that incorporates:
# https://github.com/OpenTreeOfLife/otcetera/commit/f29521709b60ee2a4a8e754a7c3a111b22761718
# As of the writing of this gist that is only the dwca-dump of otcetera
# See also https://github.com/SpeciesFileGroup/2025_workshop_on_taxon_names
set -x
od="${1}"
inp="${2}"
cf="major_rank_conflict,major_rank_conflict_inherited,environmental,viral,barren,not_otu,hidden,was_container,inconsistent,hybrid,merged"
if test -d "${od}" ; then
rm -f "${od}/eml.xml" "${od}/meta.xml" "${od}/taxa.txt"
rmdir "${od}"
fi
rm -f "${od}.tar.gz"
time otc-taxonomy-parser --clean "${cf}" --write-dwca "${od}" "${inp}" || exit
tar cfvz "${od}.tar.gz" "${od}" || exit
rm -f "${od}.sql.sqlite"
time from-dwca "${od}.tar.gz" "${od}.sql" || exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment