File tree 3 files changed +20
-9
lines changed
3 files changed +20
-9
lines changed Original file line number Diff line number Diff line change 1
- # 0.0.5 2024-04-XX
1
+ # 0.0.5 2024-04-17
2
2
3
3
- Fix bug in schema handling (compressor settings ignored)
4
4
- Move making ICF field partition directories into per-partition processing.
5
5
Remove progress on the init mkdirs step.
6
6
- Turn off progress monitor on dexplode-partition
7
+ - Fix empty partition bug
7
8
8
9
# 0.0.4 2024-04-08
9
10
Original file line number Diff line number Diff line change @@ -435,6 +435,22 @@ def variants(self, region):
435
435
if var .POS >= start :
436
436
yield var
437
437
438
+ def _filter_empty (self , regions ):
439
+ """
440
+ Return all regions in the specified list that have one or more records.
441
+
442
+ Sometimes with Tabix indexes these seem to crop up:
443
+
444
+ - https://github.com/sgkit-dev/bio2zarr/issues/45
445
+ - https://github.com/sgkit-dev/bio2zarr/issues/120
446
+ """
447
+ ret = []
448
+ for region in regions :
449
+ variants = self .variants (region )
450
+ if next (variants , None ) is not None :
451
+ ret .append (region )
452
+ return ret
453
+
438
454
def partition_into_regions (
439
455
self ,
440
456
num_parts : Optional [int ] = None ,
@@ -511,4 +527,4 @@ def partition_into_regions(
511
527
if self .index .record_counts [ri ] > 0 :
512
528
regions .append (Region (self .sequence_names [ri ]))
513
529
514
- return regions
530
+ return self . _filter_empty ( regions )
Original file line number Diff line number Diff line change 9
9
10
10
11
11
def assert_part_counts_non_zero (part_counts , index_file ):
12
- # We may have one zero count value at the end in Tabix indexes.
13
- # Should probably try to get rid of it, but probably no harm
14
- # https://github.com/jeromekelleher/bio2zarr/issues/45
15
- if index_file .endswith (".tbi" ):
16
- assert np .all (part_counts [:- 1 ] > 0 )
17
- else :
18
- assert np .all (part_counts > 0 )
12
+ assert np .all (part_counts > 0 )
19
13
20
14
21
15
class TestIndexedVcf :
You can’t perform that action at this time.
0 commit comments