<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def parse(self, limit: Optional[int]=None):
 """ Here we parse each row of the gene to phenotype file We create anonymous variants along with their attributes (allelic requirement, functional consequence) and connect these to genes and diseases genes are connected to variants via global_terms['has_affected_locus'] variants are connected to attributes via: global_terms['has_allelic_requirement'] global_terms['has_functional_consequence'] variants are connected to disease based on mappings to the DDD category column, see the translationtable specific to this source for mappings For cases where there are no disease OMIM id, we either use a disease cache file with mappings to MONDO that has been manually curated :param limit: {int} number of rows to parse :return: None """

        if limit is not None:
            LOG.info("Only parsing first %d rows", limit)

        LOG.info("Parsing files...")
        file_path = '/'.join((
            self.rawdir, self.files['developmental_disorders']['file']))

        with gzip.open(file_path, 'rt') as csvfile:
            reader = csv.reader(csvfile)
            next(reader)  # header
            for row in reader:
                if limit is None or reader.line_num <= (limit + 1):
                    self._add_gene_disease(row)
                else:
                    break

        LOG.info("Done parsing.")