Skip to content

Commit

Permalink
estimateSTR throws helpful error when any median coverage is less tha…
Browse files Browse the repository at this point in the history
…n 1. fixes #38
  • Loading branch information
hdashnow committed Oct 27, 2018
1 parent 0750d30 commit ec2fd9b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scripts/estimateSTR.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ def parse_genomecov(filename):
mediancov = pd.read_table(filename, delim_whitespace = True, header = None).iloc[0,0]
except pd.io.common.EmptyDataError:
sys.exit('ERROR: file {0} was empty.\n'.format(filename))
if mediancov < 1:
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))
genomecov_data = pd.DataFrame({'sample': [sample_id], 'genomecov': [mediancov]})
return(genomecov_data)

Expand Down

0 comments on commit ec2fd9b

Please sign in to comment.