Spaces:
Sleeping
Sleeping
update app
Browse filesFiles changed (2)
- app.py+3-23
- src/bin/PROBE.py+40
8 unmodified lines910111213144 unmodified lines192021222324252627282930313233343536374 unmodified lines424344454647484950515253545556578 unmodified linesimport yamlfrom src.about import *global data_component, filter_component4 unmodified linesdf = df[present_columns]return dfdef update_yaml(representation_name, benchmark_type, human_file_path, skempi_file_path):with open("./src/bin/probe_config.yaml", 'r') as file:yaml_data = yaml.safe_load(file)yaml_data['representation_name'] = representation_nameyaml_data['benchmark'] = benchmark_typeyaml_data['representation_file_human'] = human_fileyaml_data['representation_file_affinity'] = skempi_filewith open("./src/bin/probe_config.yaml", "w") as file:yaml.dump(yaml_data, file)return Nonedef add_new_eval(human_file,4 unmodified lines):representation_name = model_name_textbox if revision_name_textbox == '' else revision_name_textboxupdate_yaml(representation_name, benchmark_type, human_file, skempi_file)# Save human and skempi files under ./src/data/representation_vectors using pandasprint(human_file)df = pd.read_csv(human_file)print(df.head().to_string())return Noneif human_file is not None:human_df = pd.read_csv(human_file)human_df.to_csv(f"./src/data/representation_vectors/{representation_name}_human.csv", index=False)return None8 unmodified lines91011121314154 unmodified lines2021222324254 unmodified lines30313233343536378 unmodified linesimport yamlfrom src.about import *from src.bin.PROBE import run_probeglobal data_component, filter_component4 unmodified linesdf = df[present_columns]return dfdef add_new_eval(human_file,4 unmodified lines):representation_name = model_name_textbox if revision_name_textbox == '' else revision_name_textboxrun_probe(benchmark_type, representation_name, human_file, skempi_file)return None
58 unmodified lines5960616258 unmodified linesbae.predict_affinities_and_report_results()print("\n\nPROBE (Protein RepresentatiOn Benchmark) run is finished...\n")58 unmodified lines596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110258 unmodified linesbae.predict_affinities_and_report_results()print("\n\nPROBE (Protein RepresentatiOn Benchmark) run is finished...\n")def run_probe(benchmarks, representation_name, representation_file_human, representation_file_affinity, similarity_tasks=["Sparse","200","500"], function_prediction_aspec="All_Aspects", function_prediction_dataset="All_Data_Sets", family_prediction_dataset=["nc","uc50","uc30","mm15"], detailed_output=False):print("\n\nPROBE (Protein RepresentatiOn Benchmark) run is started...\n\n")if any(item in ['similarity', 'function', 'family', 'all'] for item in benchmarks):print("\nRepresentation vectors are loading...\n")human_representation_dataframe = load_representation(representation_file_human)if "similarity" in benchmarks:print("\nSemantic similarity Inference Benchmark is running...\n")ssi.representation_dataframe = human_representation_dataframessi.representation_name = representation_namessi.protein_names = ssi.representation_dataframe['Entry'].tolist()ssi.similarity_tasks = similarity_tasksssi.detailed_output = detailed_outputssi.calculate_all_correlations()if "function" in benchmarks:print("\n\nOntology-based protein function prediction benchmark is running...\n")fp.aspect_type = function_prediction_aspectfp.dataset_type = function_prediction_datasetfp.representation_dataframe = human_representation_dataframefp.representation_name = representation_namefp.detailed_output = detailed_outputfp.pred_output()if "family" in benchmarks:print("\n\nDrug target protein family classification benchmark is running...\n")tfc.representation_path = representation_file_humantfc.representation_name = representation_nametfc.detailed_output = detailed_outputfor dataset in family_prediction_dataset:tfc.score_protein_rep(dataset)if "affinity" in benchmarks:print("\n\nProtein-protein binding affinity estimation benchmark is running...\n")bae.skempi_vectors_path = representation_file_affinitybae.representation_name = representation_namebae.predict_affinities_and_report_results()print("\n\nPROBE (Protein RepresentatiOn Benchmark) run is finished...\n")return 0
app.py+3-23
src/bin/PROBE.py+40