import datasets import pyarrow def test_local_hf_match(dataset_tag): print(f"For dataset : '{dataset_tag}' testing if local and remote ids match ...") ids_hf = datasets.load_dataset( path = "RosettaCommons/MIP", name = dataset_tag, data_dir = dataset_tag, cache_dir = "/scratch/maom_root/maom0/maom", keep_in_memory = True).data['train'].select(['id']).to_pandas() ids_local = pyarrow.parquet.read_table( source = f"intermediate/{dataset_tag}.parquet", columns = ["id"]).to_pandas() assert ids_local.equals(ids_hf) test_local_hf_match("rosetta_high_quality_models") test_local_hf_match("rosetta_low_quality_models") test_local_hf_match("dmpfold_high_quality_models") test_local_hf_match("dmpfold_low_quality_models") test_local_hf_match("rosetta_high_quality_function_predictions") test_local_hf_match("rosetta_low_quality_function_predictions") test_local_hf_match("dmpfold_high_quality_function_predictions") test_local_hf_match("dmpfold_low_quality_function_predictions") import pandas dataset_long = pyarrow.parquet.read_table( "intermediate/dmpfold_low_quality_function_predictions.parquet").to_pandas() dataset_wide = pandas.pivot( dataset_long[["id", "term_id", "Y_hat"]], columns = "term_id", index = "id", values = "Y_hat")