'cannot do this until we are setting metadata'

def regenerate_primary_file(self, dataset):

    log.debug(('Velvet    log    info        %s' % 'JJ    regenerate_primary_file'))
    gen_msg = ''
    try:
        efp = dataset.extra_files_path
        log_path = os.path.join(efp, 'Log')
        f = open(log_path, 'r')
        log_content = f.read(1000)
        f.close()
        log_msg = re.sub('/\\S*/', '', log_content)
        log.debug(('Velveth    log    info        %s' % log_msg))
        paired_end_reads = (re.search('-(short|long)Paired', log_msg) is not None)
        dataset.metadata.paired_end_reads = paired_end_reads
        long_reads = (re.search('-long', log_msg) is not None)
        dataset.metadata.long_reads = long_reads
        short2_reads = (re.search('-short(Paired)?2', log_msg) is not None)
        dataset.metadata.short2_reads = short2_reads
        dataset.info = re.sub('.*velveth    \\S+', 'hash_length', re.sub('\n', '    ', log_msg))
        if paired_end_reads:
            gen_msg = (gen_msg + '    Paired-End    Reads')
        if long_reads:
            gen_msg = (gen_msg + '    Long    Reads')
        if (len(gen_msg) > 0):
            gen_msg = ('Uses:    ' + gen_msg)
    except:
        log.debug(('Velveth    could    not    read    Log    file    in    %s' % efp))
    log.debug(('Velveth    log    info        %s' % gen_msg))
    rval = ['<html><head><title>Velvet    Galaxy    Composite    Dataset    </title></head><p/>']
    rval.append(('<div>Generated:<p/>    %s    </div>' % gen_msg))
    rval.append('<div>Velveth    dataset:<p/><ul>')
    for (composite_name, composite_file) in self.get_composite_files(dataset=dataset).items():
        fn = composite_name
        log.debug(('Velvet    log    info        %s    %s    %s' % ('JJ    regenerate_primary_file', fn, composite_file)))
        if (re.search('Log', fn) is None):
            opt_text = ''
            if composite_file.optional:
                opt_text = '    (optional)'
            if composite_file.get('description'):
                rval.append(('<li><a    href="%s"    type="text/plain">%s    (%s)</a>%s</li>' % (fn, fn, composite_file.get('description'), opt_text)))
            else:
                rval.append(('<li><a    href="%s"    type="text/plain">%s</a>%s</li>' % (fn, fn, opt_text)))
    rval.append('</ul></div></html>')
    with open(dataset.file_name, 'w') as f:
        f.write('\n'.join(rval))
        f.write('\n')
