def parse_arguments()

in src/main/python/post_oncotator_cleanup.py [0:0]


def parse_arguments(argv):
	sample,oncofile,annofile= None,None,None
	exclude_sample='--exclude--'
	
	try:
		opts, args = getopt.getopt(argv[1:], "s:i:e:o:h", ["sample=", "exclude_sample=","oncotator=", "output="])
	except getopt.GetoptError as err:
		# print help information and exit:
		print str(err)  # will print something like "option -a not recognized"
		usage()

	for opt, arg in opts:
		if opt == '-h':
			usage()
			sys.exit()
		
		elif opt in ("-s", "--sample"):
			sample = arg
		
		elif opt in ("-e", "--exclude_sample"):
			exclude_sample = arg
			
		elif opt in ("-i", "--oncotator"):
			oncofile = arg
			if not os.path.isfile(oncofile):
				raise ArgumentError("Argument Error: Invalid oncotator annotated variant file passed.")
			if annofile == None:
				annofile = oncofile+".clean.tsv"
				
		elif opt in ("-o", "--output"):
			annofile = arg
	
		else:
			raise ArgumentError("Bad argument: I don't know what %s is" % arg)

	if sample is None or oncofile is None:
		raise ArgumentError("You need to supply a sample name and an oncotator annotated results!") 
		
    # return argument values
	return sample,exclude_sample,oncofile,annofile