positive = True, folder = "", extra = data['extra']) ric_test = functions.convert_ric(filename = args.test, length = length, output = "test_ric_" + args.output, folder = "") #Apply algorithms if algorithm == "CROSSED": crossed_output = functions.run_crossed(filename=crossed_test, model=os.path.join(model, data['crossed_model']), output="test_crossed_results_" + args.output, base_folder=base_folder, folder="") else: if algorithm != "rRIC": ric_output = functions.run_ric(test_file = ric_test, length = length, base_folder = base_folder, training_file = os.path.join(os.path.join( base_folder, "Data"), "classic_mouse_" + str( length-16) + ".fasta"), output = "test_ric_results_" + args.output, folder="") if algorithm != "RIC": rric_output = functions.run_ric(test_file = ric_test, length = length, base_folder = base_folder, training_file = os.path.join(model, data['ric_template']), output = "test_rric_results_" + args.output, folder = "") if algorithm == "REC": crossed_output = functions.run_crossed( filename = crossed_test, model = os.path.join(model, data['rec_crossed_model']), output = "test_crossed_results_" + args.output, base_folder = base_folder, folder="")
#Check if output folder exists and remove if os.path.exists(unique): shutil.rmtree(unique) os.mkdir(unique) #Convert input files to RIC format ric_positives = functions.convert_ric( filename=args.positive, length=length, output="train_ric_positives.fasta", folder=unique) ric_negatives = functions.convert_ric( filename=args.negative, length=length, output="train_ric_negatives.fasta", folder=unique) #Aply RIC to the test files ric_positives_output = functions.run_ric(test_file=ric_positives, length=length, base_folder=base_folder, training_file=ric_positives, output="test_ric_positives", folder=unique) ric_negatives_output = functions.run_ric(test_file=ric_negatives, length=length, base_folder=base_folder, training_file=ric_positives, output="test_ric_negatives", folder=unique) os.remove(ric_negatives) #Read scores ric_positive_scores = functions.read_ric( filename=ric_positives_output) os.remove(ric_positives_output) ric_negative_scores = functions.read_ric( filename=ric_negatives_output) os.remove(ric_negatives_output) ric_value_fdr = functions.get_threshold_unique( positive = ric_positive_scores,