'Set the number of sequences and the number of data lines
in dataset.
FIXME: This does not properly handle line wrapping'

def set_meta(self, dataset, **kwd):

    if ((self.max_optional_metadata_filesize >= 0) and (dataset.get_size() > self.max_optional_metadata_filesize)):
        dataset.metadata.data_lines = None
        dataset.metadata.sequences = None
        return
    data_lines = 0
    sequences = 0
    seq_counter = 0
    with compression_utils.get_fileobj(dataset.file_name) as in_file:
        for line in in_file:
            line = line.strip()
            if (line and line.startswith('#') and (not data_lines)):
                continue
            seq_counter += 1
            data_lines += 1
            if (line and line.startswith('@')):
                if (seq_counter >= 4):
                    sequences += 1
                    seq_counter = 1
        if (seq_counter >= 4):
            sequences += 1
        dataset.metadata.data_lines = data_lines
        dataset.metadata.sequences = sequences
