diff --git a/deeptools/computeMatrix.py b/deeptools/computeMatrix.py index 62a95657..02cc1fd4 100644 --- a/deeptools/computeMatrix.py +++ b/deeptools/computeMatrix.py @@ -355,6 +355,14 @@ def process_args(args=None): if args.quiet is True: args.verbose = False + # Ensure before and after region length is positive + if args.beforeRegionStartLength < 0: + print(f"beforeRegionStartLength changed from {args.beforeRegionStartLength} into {abs(args.beforeRegionStartLength)}") + args.beforeRegionStartLength = abs(args.beforeRegionStartLength) + if args.afterRegionStartLength < 0: + print(f"afterRegionStartLength changed from {args.afterRegionStartLength} into {abs(args.afterRegionStartLength)}") + args.afterRegionStartLength = abs(args.afterRegionStartLength) + if args.command == 'scale-regions': args.nanAfterEnd = False args.referencePoint = None