McTavishLab / physcraper

Welcome to Physcraper’s repository! Automatic gene tree updating using the Open Tree of Life.
https://physcraper.readthedocs.io/en/main/
GNU General Public License v3.0
13 stars 6 forks source link

KeyError: '^ot:ottId' #182

Open LunaSare opened 2 years ago

LunaSare commented 2 years ago

Error running Lucia's example on my local Phsycraper docker:

time physcraper_run.py --study_id pg_2407 --tree_id tree5076 --search_taxon ott:913935 --alignment project/linked_dir/alignments/M585.nex --aln_schema nexus --bootstrap_reps 2 --output /project/linked_dir/luna_lucia_primates

Runs everything but stops right after finishing bootstrap summary. Maybe because we only ran 2 bootstrap reps?

SumTrees: Writing primary results to: '<stdout>'
SumTrees: Summarization completed
SumTrees: Started at: 2021-12-09 11:02:04.465981
SumTrees: Ended at: 2021-12-09 11:02:04.844560
SumTrees: Total elapsed time: 0.378579 seconds
SumTrees: Actual analysis time: 0.021959 seconds
Traceback (most recent call last):
  File "/usr/local/bin/physcraper_run.py", line 7, in <module>
    exec(compile(f.read(), __file__, 'exec'))
  File "/project/physcraper/bin/physcraper_run.py", line 370, i
n <module>
    scraper.calculate_final_tree(boot_reps = boot_reps)
  File "/project/physcraper/physcraper/scrape.py", line 1038, i
n calculate_final_tree
    self.replace_tre(sumtreepath, schema="nexus")
  File "/project/physcraper/physcraper/scrape.py", line 873, in
 replace_tre
    newtre = root_tree_from_synth(newtre, self.data.otu_dict)
  File "/project/physcraper/physcraper/opentree_helpers.py", li
ne 59, in root_tree_from_synth
    spp = {otu_dict[otu]['^ot:ottId'] for otu in leaves}
  File "/project/physcraper/physcraper/opentree_helpers.py", li
ne 59, in <setcomp>
    spp = {otu_dict[otu]['^ot:ottId'] for otu in leaves}
KeyError: '^ot:ottId'