Skip to content

Commit

Permalink
Do not require CN or RD_CN to be defined for all samples for CNVs in …
Browse files Browse the repository at this point in the history
…get_called_samples()
  • Loading branch information
mwalker174 committed Oct 3, 2024
1 parent f786f0e commit 7a20df4
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/svtk/svtk/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,7 @@ def get_called_samples(record, include_null=False):
for sample, gt in record.samples.items():
# Get CN, or RD_CN if it doesn't exist
cn = gt.get('CN', gt.get('RD_CN', None))
if cn is None:
raise ValueError(f"Genotype for {sample} in CNV record {record.id} has neither CN nor RD_CN assigned")
elif cn != 2:
if cn is not None and cn != 2:
samples.append(sample)

return sorted(samples)
Expand Down

0 comments on commit 7a20df4

Please sign in to comment.