tpierrot commited on
Commit
ab2b870
1 Parent(s): 6884927

Update human_reference_genome.py

Browse files
Files changed (1) hide show
  1. human_reference_genome.py +8 -13
human_reference_genome.py CHANGED
@@ -50,7 +50,6 @@ _URLS = {
50
 
51
  _CHUNK_LENGTHS = [6000, 12000]
52
  _OVERLAP = 100
53
- _THRESHOLD_FILTER_N = 0.05
54
 
55
 
56
  def filter_fn(char: str) -> str:
@@ -190,15 +189,11 @@ class HumanReferenceGenome(datasets.GeneratorBasedBuilder):
190
  end_pos = min(seq_length, (i+1) * chunk_length + 2 * _OVERLAP)
191
  chunk_sequence = sequence[start_pos:end_pos]
192
 
193
- # compute ratio of Ns
194
- n_ratio = chunk_sequence.count("N") / len(chunk_sequence)
195
-
196
- # yield chunk only if not too many Ns
197
- if n_ratio < _THRESHOLD_FILTER_N:
198
- yield key, {
199
- 'sequence': chunk_sequence,
200
- 'chromosome': chromosome,
201
- 'start_pos': start_pos,
202
- 'end_pos': end_pos
203
- }
204
- key += 1
 
50
 
51
  _CHUNK_LENGTHS = [6000, 12000]
52
  _OVERLAP = 100
 
53
 
54
 
55
  def filter_fn(char: str) -> str:
 
189
  end_pos = min(seq_length, (i+1) * chunk_length + 2 * _OVERLAP)
190
  chunk_sequence = sequence[start_pos:end_pos]
191
 
192
+ # yield chunk
193
+ yield key, {
194
+ 'sequence': chunk_sequence,
195
+ 'chromosome': chromosome,
196
+ 'start_pos': start_pos,
197
+ 'end_pos': end_pos
198
+ }
199
+ key += 1