From 5f7686d4198d14e7b42e3db131c07ac0263bee1b Mon Sep 17 00:00:00 2001 From: Diane Trout Date: Wed, 6 May 2009 22:56:29 +0000 Subject: [PATCH] Update htsworkflow.util.fctracker module to work with the newer django db this was needed to support the make-library-tree script --- htsworkflow/util/fctracker.py | 8 ++++---- scripts/make-library-tree | 7 +++++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/htsworkflow/util/fctracker.py b/htsworkflow/util/fctracker.py index 57b5dcf..5ba3389 100644 --- a/htsworkflow/util/fctracker.py +++ b/htsworkflow/util/fctracker.py @@ -81,8 +81,8 @@ class fctracker: attach the library dictionary to the instance """ self.library = self._make_dict_from_table( - 'fctracker_library', - 'library_id') + 'samples_library', + 'id') def _get_species(self): @@ -90,7 +90,7 @@ class fctracker: attach the species dictionary to the instance """ self.species = self._make_dict_from_table( - 'fctracker_species', + 'samples_species', 'id' ) @@ -106,7 +106,7 @@ class fctracker: where = "" self.flowcells = {} c = self.conn.cursor() - c.execute('select * from fctracker_flowcell %s;' % (where)) + c.execute('select * from experiments_flowcell %s;' % (where)) # extract just the field name description = [ f[0] for f in c.description ] for row in c: diff --git a/scripts/make-library-tree b/scripts/make-library-tree index 1c3772e..50ce7a9 100644 --- a/scripts/make-library-tree +++ b/scripts/make-library-tree @@ -42,7 +42,9 @@ def parse_srf_directory(srf_dir): path, filename = os.path.split(pathname) basename, ext = os.path.splitext(filename) record = basename.split('_') - assert len(record) == 6 + if len(record) != 6: + logging.error("Unrecognized srf file: %s expected 6 fields got %d" % (pathname,len(record))) + continue site = record[0] date = record[1] @@ -64,7 +66,7 @@ def carefully_make_hardlink(source, destination, dry_run=False): the same as the link we want to make. If the link already exists and is different, throw an error. """ - logging.debug("%s -> %s", source, destination) + logging.debug("CHECKING: %s -> %s", source, destination) if not os.path.exists(source): logging.warning("%s doesn't exist", source) @@ -72,6 +74,7 @@ def carefully_make_hardlink(source, destination, dry_run=False): if os.path.exists(destination): if os.path.samefile(source, destination): + logging.debug('SAME: %s -> %s' % (source, destination)) return else: raise IOError('%s and %s are different files' % \ -- 2.30.2