Skip to content

Commit ec2fd9b

Browse files
committed
estimateSTR throws helpful error when any median coverage is less than 1. fixes #38
1 parent 0750d30 commit ec2fd9b

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

scripts/estimateSTR.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ def parse_genomecov(filename):
9494
mediancov = pd.read_table(filename, delim_whitespace = True, header = None).iloc[0,0]
9595
except pd.io.common.EmptyDataError:
9696
sys.exit('ERROR: file {0} was empty.\n'.format(filename))
97+
if mediancov < 1:
98+
sys.exit('ERROR: Median coverage in file {0} was {1}.\nSuch a low value could indicate median coverage was not correctly calculated,\nfor example an incorrect target region was specified or the WGS pipeline was used for exome data.'.format(filename, mediancov))
9799
genomecov_data = pd.DataFrame({'sample': [sample_id], 'genomecov': [mediancov]})
98100
return(genomecov_data)
99101

0 commit comments

Comments
 (0)