Skip to content

Commit

Permalink
make clean fixes; broken taxa bug; tarball extension change
Browse files Browse the repository at this point in the history
  • Loading branch information
kcranston committed Nov 29, 2016
1 parent 6236431 commit ee6929f
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 17 deletions.
40 changes: 26 additions & 14 deletions Makefile
Expand Up @@ -20,7 +20,7 @@ export PEYOTL_ROOT
OTT_DIR := $(shell bin/config_checker.py opentree.ott $(CONFIG_FILENAME))
export OTT_DIR

# This list of files for each OTT release are used below to create the
# This list of files for each OTT release are used below to create the
# full paths to the OTT inputs
OTT_FILENAMES=about.json \
conflicts.tsv \
Expand Down Expand Up @@ -68,19 +68,31 @@ clean: cleanpre \
cleandoc
rm -f $(ASSESSMENT_ARTIFACTS)

if test -d $(PROPINQUITY_OUT_DIR)/phylo_input ; then rmdir --ignore-fail-on-non-empty $(PROPINQUITY_OUT_DIR)/phylo_input ; fi
if test -d $(PROPINQUITY_OUT_DIR)/phylo_snapshot ; then rmdir --ignore-fail-on-non-empty $(PROPINQUITY_OUT_DIR)/phylo_snapshot ; fi
if test -d $(PROPINQUITY_OUT_DIR)/cleaned_ott ; then rmdir --ignore-fail-on-non-empty $(PROPINQUITY_OUT_DIR)/cleaned_ott ; fi
if test -d $(PROPINQUITY_OUT_DIR)/cleaned_phylo ; then rmdir --ignore-fail-on-non-empty $(PROPINQUITY_OUT_DIR)/cleaned_phylo ; fi
if test -d $(PROPINQUITY_OUT_DIR)/exemplified_phylo ; then rmdir --ignore-fail-on-non-empty $(PROPINQUITY_OUT_DIR)/exemplified_phylo ; fi
if test -d $(PROPINQUITY_OUT_DIR)/subproblems/scratch ; then rmdir --ignore-fail-on-non-empty $(PROPINQUITY_OUT_DIR)/subproblems/scratch ; fi
if test -d $(PROPINQUITY_OUT_DIR)/subproblems ; then rmdir --ignore-fail-on-non-empty $(PROPINQUITY_OUT_DIR)/subproblems ; fi
if test -d $(PROPINQUITY_OUT_DIR)/subproblem_solutions ; then rmdir --ignore-fail-on-non-empty $(PROPINQUITY_OUT_DIR)/subproblem_solutions ; fi
if test -d $(PROPINQUITY_OUT_DIR)/grafted_solution ; then rmdir --ignore-fail-on-non-empty $(PROPINQUITY_OUT_DIR)/grafted_solution ; fi
if test -d $(PROPINQUITY_OUT_DIR)/labelled_supertree ; then rmdir --ignore-fail-on-non-empty $(PROPINQUITY_OUT_DIR)/labelled_supertree ; fi
if test -d $(PROPINQUITY_OUT_DIR)/annotated_supertree ; then rmdir --ignore-fail-on-non-empty $(PROPINQUITY_OUT_DIR)/annotated_supertree ; fi
if test -d $(PROPINQUITY_OUT_DIR)/assessments ; then rmdir --ignore-fail-on-non-empty $(PROPINQUITY_OUT_DIR)/assessments ; fi
if test -d $(PROPINQUITY_OUT_DIR)/logs ; then rmdir --ignore-fail-on-non-empty $(PROPINQUITY_OUT_DIR)/logs ; fi
rmdir $(PROPINQUITY_OUT_DIR)/phylo_input || true
rmdir $(PROPINQUITY_OUT_DIR)/phylo_snapshot || true
rmdir $(PROPINQUITY_OUT_DIR)/cleaned_ott || true
rmdir $(PROPINQUITY_OUT_DIR)/cleaned_phylo || true
rmdir $(PROPINQUITY_OUT_DIR)/exemplified_phylo || true
rmdir $(PROPINQUITY_OUT_DIR)/subproblems/scratch || true
rmdir $(PROPINQUITY_OUT_DIR)/subproblems || true
rmdir $(PROPINQUITY_OUT_DIR)/subproblem_solutions || true
rmdir $(PROPINQUITY_OUT_DIR)/grafted_solution || true
rmdir $(PROPINQUITY_OUT_DIR)/labelled_supertree || true
rmdir $(PROPINQUITY_OUT_DIR)/annotated_supertree || true
rmdir $(PROPINQUITY_OUT_DIR)/logs || true
# if test -d $(PROPINQUITY_OUT_DIR)/phylo_input ; then rmdir --ignore-fail-on-non-empty $(PROPINQUITY_OUT_DIR)/phylo_input ; fi
# if test -d $(PROPINQUITY_OUT_DIR)/phylo_snapshot ; then rmdir --ignore-fail-on-non-empty $(PROPINQUITY_OUT_DIR)/phylo_snapshot ; fi
# if test -d $(PROPINQUITY_OUT_DIR)/cleaned_ott ; then rmdir --ignore-fail-on-non-empty $(PROPINQUITY_OUT_DIR)/cleaned_ott ; fi
# if test -d $(PROPINQUITY_OUT_DIR)/cleaned_phylo ; then rmdir --ignore-fail-on-non-empty $(PROPINQUITY_OUT_DIR)/cleaned_phylo ; fi
# if test -d $(PROPINQUITY_OUT_DIR)/exemplified_phylo ; then rmdir --ignore-fail-on-non-empty $(PROPINQUITY_OUT_DIR)/exemplified_phylo ; fi
# if test -d $(PROPINQUITY_OUT_DIR)/subproblems/scratch ; then rmdir --ignore-fail-on-non-empty $(PROPINQUITY_OUT_DIR)/subproblems/scratch ; fi
# if test -d $(PROPINQUITY_OUT_DIR)/subproblems ; then rmdir --ignore-fail-on-non-empty $(PROPINQUITY_OUT_DIR)/subproblems ; fi
# if test -d $(PROPINQUITY_OUT_DIR)/subproblem_solutions ; then rmdir --ignore-fail-on-non-empty $(PROPINQUITY_OUT_DIR)/subproblem_solutions ; fi
# if test -d $(PROPINQUITY_OUT_DIR)/grafted_solution ; then rmdir --ignore-fail-on-non-empty $(PROPINQUITY_OUT_DIR)/grafted_solution ; fi
# if test -d $(PROPINQUITY_OUT_DIR)/labelled_supertree ; then rmdir --ignore-fail-on-non-empty $(PROPINQUITY_OUT_DIR)/labelled_supertree ; fi
# if test -d $(PROPINQUITY_OUT_DIR)/annotated_supertree ; then rmdir --ignore-fail-on-non-empty $(PROPINQUITY_OUT_DIR)/annotated_supertree ; fi
# if test -d $(PROPINQUITY_OUT_DIR)/assessments ; then rmdir --ignore-fail-on-non-empty $(PROPINQUITY_OUT_DIR)/assessments ; fi
# if test -d $(PROPINQUITY_OUT_DIR)/logs ; then rmdir --ignore-fail-on-non-empty $(PROPINQUITY_OUT_DIR)/logs ; fi

realclean: realcleanottproducts clean
# No op
Expand Down
10 changes: 9 additions & 1 deletion bin/document_outputs.py
Expand Up @@ -224,6 +224,8 @@ def render_annotated_supertree_index(container, template, html_out, json_out):
html_out.write(template())
def render_assessments_index(container, template, html_out, json_out):
html_out.write(template(assessments=container.assessments))
# def render_broken_taxa_report(container, template, html_out, json_out):
# html_out.write(template(broken_taxa=container.broken_taxa))

def node_label2obj(nl):
'''Node labels in cleaned input trees are quirky, this tries to parse them...'''
Expand Down Expand Up @@ -287,6 +289,7 @@ def __init__(self, propinquity_dir, supertree_output_dir, config_filepath):
self.subproblems = self.read_subproblems()
self.labelled_supertree = self.read_labelled_supertree()
self.assessments = self.read_assessments()
#self.broken_taxa = self.read_broken_taxa()
def read_assessments(self):
d = os.path.join(self.top_output_dir, 'assessments')
blob = Extensible()
Expand All @@ -299,6 +302,11 @@ def read_assessments(self):
blob.categories_of_checks_with_errors.append(k)
blob.categories_of_checks_with_errors.sort()
return blob
# def read_broken_taxa(self):
# d = os.path.join(self.top_output_dir, 'labelled_supertree')
# blob = Extensible()
# blob.assessments = read_as_json(os.path.join(d, 'broken_taxa.json'))

def read_labelled_supertree(self):
d = os.path.join(self.top_output_dir, 'labelled_supertree')
p = 'labelled_supertree_out_degree_distribution.txt'
Expand All @@ -309,7 +317,7 @@ def read_labelled_supertree(self):
blob = Extensible()
blob.unprune_stats = read_as_json(os.path.join(d, 'input_output_stats.json'))
blob.non_monophyletic_taxa = read_as_json(os.path.join(d, 'broken_taxa.json'))
if not blob.non_monophyletic_taxa['non_monophyletic_taxa'] is None:
if blob.non_monophyletic_taxa['non_monophyletic_taxa'] is None:
blob.non_monophyletic_taxa['non_monophyletic_taxa'] = {}
return blob
def read_subproblem_solutions(self):
Expand Down
7 changes: 5 additions & 2 deletions bin/make_tarballs.sh
Expand Up @@ -50,6 +50,7 @@ cp -p $outputdir/grafted_solution/grafted_solution_ottnames.tre $tar_dir1/grafte
cp -p $outputdir/annotated_supertree/annotations.json $tar_dir1/

# readme file
echo 'printing readme file'
files_url="http://files.opentreeoflife.org/synthesis/$treeid/output"
touch $tar_dir1/README.md
printf "[Release notes for version %s](https://github.com/OpenTreeOfLife/germinator/blob/release_notes/doc/ot-synthesis-v%s.md)\n" $version > $tar_dir1/README.md
Expand All @@ -63,7 +64,9 @@ printf "\n * \`grafted_solution.tre\` - synthetic tree without taxonomy-only o
printf "\n * \`grafted_solution_ottnames.tre\` - synthetic tree without taxonomy-only outputs; labels are name_ottid" >> $tar_dir1/README.md

# tar these babies up
tar -czvf $tar_dir1.tar.gz $tar_dir1
echo 'creating full archive'
tar -czf $tar_dir1.tgz $tar_dir1

echo 'creating tree-only archive'
# all synthesis outputs
tar -czvf ${outputdir}_output.tar.gz $outputdir
tar -czf ${outputdir}_output.tgz $outputdir

0 comments on commit ee6929f

Please sign in to comment.