Skip to content

Commit

Permalink
handle missing cites
Browse files Browse the repository at this point in the history
  • Loading branch information
snacktavish committed Nov 13, 2019
1 parent f97a109 commit 7ee8afd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion physcraper/opentree_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ def get_tree_from_synth(ott_ids, label_format="name", citation="cites.txt"):
query = {"ot:studyId":study}
new_cite = oti.find_studies(query_dict = query, verbose=True)
#print new_cite[0].keys()
cites = cites + '\n' + to_string(new_cite[0]['ot:studyPublicationReference']) + '\n' + new_cite[0]['ot:studyPublication']
if new_cite:
cites = cites + '\n' + to_string(new_cite[0]['ot:studyPublicationReference']) + '\n' + new_cite[0]['ot:studyPublication']
# cites = cites + '\n' +phylesystemref + synthref
with open(citation,'w') as citfile:
citfile.write(cites)
Expand Down

0 comments on commit 7ee8afd

Please sign in to comment.