Skip to content

Commit

Permalink
Merge pull request #12 from Zymo-Research/fixVarianceCrashWithNequals1
Browse files Browse the repository at this point in the history
Fixed variance calculation crash
  • Loading branch information
michael-weinstein authored Sep 10, 2019
2 parents f67f59a + 9e9bfd0 commit bc8c5e4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion figaroSupport/fastqHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,10 @@ def estimateReadLength(path:str, samplesize:int=100, getVariance = False):
meanReadLength = sum(lengths)/len(lengths)
if getVariance:
import statistics
lengthVariance = statistics.variance(lengths)
if len(lengths) > 1:
lengthVariance = statistics.variance(lengths)
else:
lengthVariance = 0
return round(meanReadLength), lengthVariance
return round(meanReadLength)

Expand Down

0 comments on commit bc8c5e4

Please sign in to comment.