elif args.dl_reference:
		imp.install_reference_panel(args.dl_reference)

	elif args.add_reference:
		imp.add_custom_reference_panels()

	elif args.action:
		if not args.study:
			raise Exception('You need to define a directory where the study panel is, in order to perform this action (parameter --study)')

		if not args.output:
			raise Exception('You need to define a directory where the output results will be stored (parameter --output')

		if args.action == 'liftover':
			imp.perform_liftover(args.study, args.output, assembly=args.chain_file, backend=args.backend, submit=not args.nosubmit)

		elif args.action == 'phase':
			imp.perform_phase(args.study, args.output, additional_shapeit_parameters=args.additional_shapeit_parameters, backend=args.backend, submit=not args.nosubmit)

		elif args.action == 'impute' or args.action == 'phase_impute' or args.action == 'liftover_phase_impute':
			if not args.reference:
				raise Exception('You need to define a reference panel. Use the --reference parameter. For a list for all available reference panels, use --list')

			imp.perform_impute(args.study, args.output, args.reference, 
					additional_impute2_parameters=args.additional_impute2_parameters, 
					additional_shapeit_parameters=args.additional_impute2_parameters,
					perform_liftover_argument=args.action == 'liftover_phase_impute',
					assembly=args.chain_file,
					perform_phase_argument=args.action == 'phase_impute',
					custom_chromosomes=args.chromosomes,
	elif args.dl_reference:
		imp.install_reference_panel(args.dl_reference)

	elif args.add_reference:
		imp.add_custom_reference_panels()

	elif args.action:
		if not args.study:
			raise Exception('You need to define a directory where the study panel is, in order to perform this action (parameter --study)')

		if not args.output:
			raise Exception('You need to define a directory where the output results will be stored (parameter --output')

		if args.action == 'liftover':
			imp.perform_liftover(args.study, args.output, backend=args.backend, submit=not args.nosubmit)

		elif args.action == 'phase':
			imp.perform_phase(args.study, args.output, additional_shapeit_parameters=args.additional_shapeit_parameters, backend=args.backend, submit=not args.nosubmit)

		elif args.action == 'impute':
			if not args.reference:
				raise Exception('You need to define a reference panel. Use the --reference parameter. For a list for all available reference panels, use --list')

			imp.perform_impute(args.study, args.output, args.reference, 
				additional_impute2_parameters=args.additional_impute2_parameters, 
				custom_chromosomes=args.chromosomes,
				sample_batch_size=args.sample_batch_size,
				position_batch_size=args.position_batch_size,
				backend=args.backend,
				submit=not args.nosubmit)