diff --git a/deeptools/computeMatrix.py b/deeptools/computeMatrix.py index 62a95657..05d7086f 100644 --- a/deeptools/computeMatrix.py +++ b/deeptools/computeMatrix.py @@ -354,6 +354,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