Exemple #1
0
 def do_add_dir(self, args):
     dir = args
     result = list(list_exp_files(dir))
     print 'found files for %d experiments in %s' % (len(result), dir)
     with DomDb(self.session_factory, self.ion_mode, self.config) as domdb:
         for d in result:
             name = d['name']
             path = os.path.join(dir,d['data'])
             mdpath = os.path.join(dir,d['metadata'])
             print 'loading experiment %s from:' % name
             print '- data file %s' % path
             print '- metadata file %s' % mdpath
             etl(domdb.session,name,path,mdpath,self.ion_mode,log=console_log)
             n = domdb.mtab_count(self.ion_mode)
             print '%d metabolites in database' % n
Exemple #2
0
 def do_add_dir(self, args):
     dir = args
     result = list(list_exp_files(dir))
     print 'found files for %d experiments in %s' % (len(result), dir)
     with DomDb(self.session_factory, self.ion_mode, self.config) as domdb:
         for d in result:
             name = d['name']
             path = os.path.join(dir, d['data'])
             mdpath = os.path.join(dir, d['metadata'])
             print 'loading experiment %s from:' % name
             print '- data file %s' % path
             print '- metadata file %s' % mdpath
             etl(domdb.session,
                 name,
                 path,
                 mdpath,
                 self.ion_mode,
                 log=console_log)
             n = domdb.mtab_count(self.ion_mode)
             print '%d metabolites in database' % n
Exemple #3
0
 def do_add(self,args):
     try:
         exp, path, mdpath = args.split(' ')
     except ValueError:
         print 'ERROR: add takes [exp name] [data file] [metadata file]'
         return
     if not os.path.exists(path):
         print 'data file %s does not exist' % path
         return
     if not os.path.exists(mdpath):
         print 'metadata file %s does not exist' % mdpath
         return
     print 'loading experiment %s from:' % exp
     print 'data file %s' % path
     print 'metadata file %s' % mdpath
     session = self.session_factory()
     etl(session,exp,path,mdpath,self.ion_mode,log=console_log)
     session.close()
     with DomDb(self.session_factory, self.ion_mode, self.config) as domdb:
         n = domdb.mtab_count()
     print '%d metabolites in database' % n
Exemple #4
0
 def do_add(self, args):
     try:
         exp, path, mdpath = args.split(' ')
     except ValueError:
         print 'ERROR: add takes [exp name] [data file] [metadata file]'
         return
     if not os.path.exists(path):
         print 'data file %s does not exist' % path
         return
     if not os.path.exists(mdpath):
         print 'metadata file %s does not exist' % mdpath
         return
     print 'loading experiment %s from:' % exp
     print 'data file %s' % path
     print 'metadata file %s' % mdpath
     session = self.session_factory()
     etl(session, exp, path, mdpath, self.ion_mode, log=console_log)
     session.close()
     with DomDb(self.session_factory, self.ion_mode, self.config) as domdb:
         n = domdb.mtab_count()
     print '%d metabolites in database' % n