Exemple #1
0
def features_selection():
	"""
	-> Perform a features selection procedure:
		- get arguments from the command line
			- i : the input file (mandatory)
			- o : the output folder (mandatory)
			- r : the name of the report file (optionnal, default is report.html)
		- run analysis (analysis type set to "all")
		- write report 
	"""
	
	## Collect arguments
	parser = argparse.ArgumentParser(prog='netabio_stuff') # not sure what does the instanciation
	parser.add_argument('-i', nargs='?', help='the input data file')
	parser.add_argument('-o', nargs='?', help='the output directory')
	parser.add_argument('-r', nargs='?', help='the name of the report file')
	args = parser.parse_args()

	## Init optionnal arguments
	if(not args.r):
		args.r = "report.html"
	collected_inputs = {'i': args.i,
	                    'r': args.r,
					    'o': args.o}

	## Get the name of the prepared data file
	report_file = str(collected_inputs["o"])+"/"+str(collected_inputs["r"])
	data_file = str(collected_inputs["i"])
	result_folder = str(collected_inputs["o"])

	## Run analysis
	feature_selection.run_analyser(data_file, result_folder, "all")

	## write report
	feature_selection.write_html_report(report_file, data_file, result_folder)
Exemple #2
0
def features_selection_workspace():
	"""
	[IN PROGRESS]

	-> Grand bazar, scavange stuff from this function
	-> TODO:
		- get a list of args
		- implement the feature selection procedure ...
		- include the fudction in entry point
	"""

	
	## Collect arguments
	parser = argparse.ArgumentParser(prog='netabio_stuff') # not sure what does the instanciation
	parser.add_argument('-i', nargs='?', help='the input data file')
	parser.add_argument('-gp', nargs='?', help='the group position (label) in the reformated file')
	parser.add_argument('-gn', nargs='?', help='the group name (colname of the label) in the reformated file')
	parser.add_argument('-ph', nargs='?', help='the phase we want in the reformated dile')
	parser.add_argument('-o', nargs='?', help='the output directory')

	args = parser.parse_args()

	## Init optionnal arguments
	if(not args.gp):
		args.gp = "start"
	if(not args.gn):
		args.gn = "Disease"
	if(not args.ph):
		args.ph = "all"

	collected_inputs = {'i': args.i,
	                    'gp': args.gp,
					    'gn': args.gn,
					    'ph': args.ph,
					    'o': args.o}

	## Prepare data file
	#data_extraction.generate_Luminex_data_file(collected_inputs['i'], group_pos=collected_inputs['gp'], group_name=collected_inputs['gn'], phase=collected_inputs['ph'])

	## Get the name of the prepared data file
	report_file = "C:\\Users\\NaturalKiller01\\Desktop\\Nathan\\Spellcraft\\TRASH\\report.html"
	data_file = "C:\\Users\\NaturalKiller01\\Desktop\\Nathan\\Spellcraft\\Luminex_data_NA_filtered.csv"
	result_folder = "C:\\Users\\NaturalKiller01\\Desktop\\Nathan\\Spellcraft\\TRASH"

	## Run analysis
	feature_selection.run_analyser(data_file, result_folder, "all")

	## write report
	feature_selection.write_html_report(report_file, data_file, result_folder)  
Exemple #3
0
def run():

    ## general parameters
    data_file_name = TEST_DATA
    separator = ","
    test_value = "53,7%"
    input_vector = ["5", "3", "4", "6", "89", "5", "6"]
    col_number = 1
    header_detected = True
    output_folder = "output"
    analysis = "all"
    report_file = "report.html"

    ## biotoolbox module
    print "[TEST] Testing biotoolbox module from netabio package"
    biotoolbox.detect_file_format(data_file_name)
    biotoolbox.change_file_format(data_file_name, separator)
    biotoolbox.fix_file_name(data_file_name)

    ## na_manager module
    print "[TEST] Testing na_manager module from netabio package"
    na_manager.check_NA_proportion_in_file(data_file_name)
    na_manager.display_NA_proportions(data_file_name)
    na_manager.filter_NA_values(data_file_name)

    ## quality_control module
    print "[TEST] Testing quality_control module from netabio package"
    quality_control.check_pourcentages(test_value)
    quality_control.looking_for_outliers(input_vector, col_number)
    quality_control.basic_check(data_file_name)
    quality_control.check_standard_deviation(data_file_name)
    quality_control.check_zscore(data_file_name, separator, header_detected)

    ## feature_selection module
    print "[TEST] Testing feature_selection module from netabio package"
    feature_selection.run_analyser(data_file_name, output_folder, analysis)
    feature_selection.write_html_report(report_file, data_file_name,
                                        output_folder)