Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions ontobio/assoc_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def __init__(self):
initializes based on an ontology name
"""

def create(self, ontology=None,subject_category=None,object_category=None,evidence=None,taxon=None,relation=None, file=None, fmt=None, skim=True):
def create(self, ontology=None,subject_category=None,object_category=None,evidence=None,taxon=None, relation=None, file=None, fmt=None, skim=True):
"""
creates an AssociationSet

Expand Down Expand Up @@ -60,6 +60,7 @@ def create(self, ontology=None,subject_category=None,object_category=None,eviden
logging.info("Fetching assocs from store")
assocs = bulk_fetch_cached(subject_category=subject_category,
object_category=object_category,
relation=relation,
evidence=evidence,
taxon=taxon)

Expand All @@ -70,11 +71,12 @@ def create(self, ontology=None,subject_category=None,object_category=None,eviden
amap = {}
subject_label_map = {}
for a in assocs:
rel = a['relation']
subj = a['subject']
subject_label_map[subj] = a['subject_label']
amap[subj] = a['objects']

if subj in amap:
amap[subj].extend(a['objects'])
else:
amap[subj] = a['objects']

aset = AssociationSet(ontology=ontology,
meta=meta,
Expand Down