Skip to content

Commit c2bd995

Browse files
committed
Check sequence length even if taken from the VCF
See #1028 - however we still have an out-by-one error when taking the sequence length from the VCF contig
1 parent 3364349 commit c2bd995

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

tsinfer/formats.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2649,13 +2649,12 @@ def process_array(
26492649
logger.info(
26502650
f"Number of individuals after applying mask: {self.num_individuals}"
26512651
)
2652-
if sequence_length is not None:
2653-
if sequence_length <= self.sites_position[-1]:
2654-
raise ValueError(
2655-
"`sequence_length` cannot be less than or equal to the maximum "
2656-
"unmasked variant position"
2657-
)
26582652
self._sequence_length = sequence_length
2653+
if self.sequence_length <= self.sites_position[-1]:
2654+
raise ValueError(
2655+
"`sequence_length` cannot be less than or equal to the maximum "
2656+
"unmasked variant position"
2657+
)
26592658

26602659
@classmethod
26612660
def from_arrays(

0 commit comments

Comments
 (0)