diff --git a/figaroSupport/fastqHandler.py b/figaroSupport/fastqHandler.py index 33e3c48..f5d74bf 100644 --- a/figaroSupport/fastqHandler.py +++ b/figaroSupport/fastqHandler.py @@ -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)