From: Diane Trout Date: Wed, 17 Nov 2010 05:39:25 +0000 (-0800) Subject: Cache the attributes for each type of fastq file. X-Git-Tag: 0.5.0~8 X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=htsworkflow.git;a=commitdiff_plain;h=3d4fcb9d0965e4b2566910950cd364e73017f5b7 Cache the attributes for each type of fastq file. Previously it was just using whatever was last as the set of attributes. Which led to everything being flagged as FastqRd2 --- diff --git a/extra/ucsc_encode_submission/ucsc_gather.py b/extra/ucsc_encode_submission/ucsc_gather.py index 72d7f32..d160b21 100755 --- a/extra/ucsc_encode_submission/ucsc_gather.py +++ b/extra/ucsc_encode_submission/ucsc_gather.py @@ -268,6 +268,7 @@ def make_submission_ini(host, apidata, library_result_map, paired=True): # write other lines submission_files = os.listdir(result_dir) fastqs = {} + fastq_attributes = {} for f in submission_files: attributes = view_map.find_attributes(f, lib_id) if attributes is None: @@ -278,6 +279,7 @@ def make_submission_ini(host, apidata, library_result_map, paired=True): continue elif attributes.get("type", None) == 'fastq': fastqs.setdefault(ext, set()).add(f) + fastq_attributes[ext] = attributes else: inifile.extend( make_submission_section(line_counter, @@ -287,13 +289,13 @@ def make_submission_ini(host, apidata, library_result_map, paired=True): ) inifile += [''] line_counter += 1 + # add in fastqs on a single line. - # add in fastqs on a single line. - for extension, fastq_set in fastqs.items(): + for extension, fastq_files in fastqs.items(): inifile.extend( make_submission_section(line_counter, - fastq_set, - attributes[extension]) + fastq_files, + fastq_attributes[extension]) ) inifile += [''] line_counter += 1