-
Notifications
You must be signed in to change notification settings - Fork 26
Getting information on trees that intersect with a clade of interest
Hopefully you have peyotl installed and if not check this out. So I assume that you have a working peyotl and you understand virtualenv (if you use it).
##Getting information on studies with taxa of interest## Put this in a file
from peyotl.api import APIWrapper
a = APIWrapper()
oti = a.oti
b = oti.find_trees(ottTaxonName='Lonicera')
You will get a list of studies that include the taxon Lonicera
. If you wanted to search by ottId instead, you simply would change the line to b = oti.find_trees(ottId=649885)
. b
will be a list that includes the relevant study ids and for each study, the relevant tree ids. To see that list, you can just add to the file that you have these lines
for i in b:
print i['ot:studyId']
which will produce
pg_424
pg_422
and then you can get the tree ids with this
for i in b:
for j in i['matched_trees']:
print j['oti_tree_id']
which will produce
pg_424_tree532
pg_422_tree531
You can check out these studies on the curator here pg_424 and pg_422. We are going to look at downloading the files associated with these in the next tutorial.