Skip to content

Commit

Permalink
Merge pull request #116 from indralab/mti
Browse files Browse the repository at this point in the history
Add MTI reader to DB workflow
  • Loading branch information
bgyori committed Jun 28, 2020
2 parents 8ced690 + bd9f932 commit bd6bbe1
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ We have read all available content, and every day we run the following readers:
we read all new content with the following readers:
- [Eidos](https://github.com/clulab/eidos)
- [ISI](https://github.com/sgarg87/big_mech_isi_gg)
- [MTI](https://ii.nlm.nih.gov/MTI/index.shtml) - used specifically to tag
content with topic terms.

we read a limited subset of new content with the following readers:
- [TRIPS](http://trips.ihmc.us/parser/cgi/drum)
Expand Down
3 changes: 2 additions & 1 deletion indra_db/databases.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class formats(_map_class):
EKB = 'ekb'


readers = {'REACH': 1, 'SPARSER': 2, 'TRIPS': 3, 'ISI': 4, 'EIDOS': 5}
readers = {'REACH': 1, 'SPARSER': 2, 'TRIPS': 3, 'ISI': 4, 'EIDOS': 5, 'MTI': 6}


# Specify versions of readers, and preference. Later in the list is better.
Expand All @@ -145,6 +145,7 @@ class formats(_map_class):
'trips': ['STATIC', '2019Nov14'],
'isi': ['20180503'],
'eidos': ['0.2.3-SNAPSHOT'],
'mti': ['1.0'],
}


Expand Down
13 changes: 8 additions & 5 deletions indra_db/managers/reading_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@ def _get_latest_updatetime(self, db, reader_name):
db.ReadingUpdates.reader == reader_name
)
if not len(update_list):
logger.warning("The database has not had an initial upload, or "
"else the updates table has not been populated.")
logger.warning("The database has not had an initial upload "
"for %s, or else the updates table has not "
"been populated." % reader_name)
return None

return max([u.latest_datetime for u in update_list])
Expand Down Expand Up @@ -144,8 +145,8 @@ def read_new(self, db, reader_name):
if latest_updatetime is not None:
self.begin_datetime = latest_updatetime - self.buffer
else:
raise ReadingUpdateError("There are no previous updates. "
"Please run_all.")
raise ReadingUpdateError("There are no previous updates for %s. "
"Please run_all." % reader_name)

constraints = self._get_constraints(db, reader_name)

Expand Down Expand Up @@ -182,6 +183,7 @@ class BulkAwsReadingManager(BulkReadingManager):
'isi': 2400,
'trips': 300,
'eidos': 1200,
'mti': 5400,
}

ids_per_job = {
Expand All @@ -190,6 +192,7 @@ class BulkAwsReadingManager(BulkReadingManager):
'isi': 5000,
'trips': 500,
'eidos': 5000,
'mti': 1000,
}

def __init__(self, *args, **kwargs):
Expand Down Expand Up @@ -387,7 +390,7 @@ def main():
else:
db = get_db(args.database)

readers = ['SPARSER', 'REACH', 'TRIPS', 'ISI', 'EIDOS']
readers = ['SPARSER', 'REACH', 'TRIPS', 'ISI', 'EIDOS', 'MTI']
if args.method == 'local':
bulk_manager = BulkLocalReadingManager(readers,
buffer_days=args.buffer,
Expand Down
2 changes: 2 additions & 0 deletions indra_db/reading/submit_reading_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ class DbReadingSubmitter(Submitter):
_purpose = 'db_reading'
_job_queue_dict = {'run_db_reading_queue': ['reach', 'sparser', 'isi',
'eidos'],
'run_db_lite_queue': ['mti'],
'run_db_trips_queue': ['trips']}
_job_def_dict = {'run_db_reading_jobdef': ['reach', 'sparser'],
'run_db_lite_jobdef': ['mti'],
'run_db_reading_isi_jobdef': ['isi'],
'run_db_reading_trips_jobdef': ['trips'],
'run_db_reading_eidos_jobdef': ['eidos']}
Expand Down
2 changes: 1 addition & 1 deletion indra_db/schemas/readonly_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,4 +550,4 @@ class MeshMeta(Base, ReadonlyTable):
'bel_lc', 'signor', 'biogrid', 'tas',
'lincs_drug', 'hprd', 'trrust'],
'reading': ['geneways', 'tees', 'isi', 'trips', 'rlimsp',
'medscan', 'sparser', 'reach', 'eidos']}
'medscan', 'sparser', 'reach', 'eidos', 'mti']}

0 comments on commit bd6bbe1

Please sign in to comment.