wyxu commited on
Commit
7c79f21
·
1 Parent(s): 1b01694

Update Genome_database.py

Browse files
Files changed (1) hide show
  1. Genome_database.py +3 -2
Genome_database.py CHANGED
@@ -46,6 +46,7 @@ class GenomeDataset(datasets.GeneratorBasedBuilder):
46
 
47
  def _generate_examples(self, filepaths: List[str]) -> Tuple[str, Dict[str, Any]]:
48
  split_regex = re.compile('-')
 
49
  for filepath in filepaths:
50
  if filepath.endswith(".seq.gz"):
51
  with gzip.open(filepath, 'rt') as handle:
@@ -83,7 +84,7 @@ class GenomeDataset(datasets.GeneratorBasedBuilder):
83
  region_type = feature.type
84
  specific_class = 'NA'
85
  translation = 'NA'
86
- yield record.id, {
87
  'DNA_id': record.id,
88
  'organism': organism,
89
  'year': year,
@@ -96,4 +97,4 @@ class GenomeDataset(datasets.GeneratorBasedBuilder):
96
  'start_postion': start_position,
97
  'end_position': end_position
98
  }
99
-
 
46
 
47
  def _generate_examples(self, filepaths: List[str]) -> Tuple[str, Dict[str, Any]]:
48
  split_regex = re.compile('-')
49
+ id_ = 0
50
  for filepath in filepaths:
51
  if filepath.endswith(".seq.gz"):
52
  with gzip.open(filepath, 'rt') as handle:
 
84
  region_type = feature.type
85
  specific_class = 'NA'
86
  translation = 'NA'
87
+ yield str(id_), {
88
  'DNA_id': record.id,
89
  'organism': organism,
90
  'year': year,
 
97
  'start_postion': start_position,
98
  'end_position': end_position
99
  }
100
+ id_+ = 1