File size: 2,510 Bytes
b111af8 f356ef8 b111af8 f356ef8 b111af8 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# consistency between models and function predictions
source("src/summarize_map.R")
dataset1_name <- arrow::read_parquet(
"intermediate/dataset1.parquet",
col_select = "name") |>
dplyr::mutate(
WT_name = name |> stringr::str_replace("pdb_[A-Z][0-9]+[A-Z]", "pdb")) |>
dplyr::filter(
!(WT_name |> stringr::str_detect("[0-9][A-Z0-9a-z]{3}([.]pdb)?")),
!(WT_name |> stringr::str_detect("ruler")))
names_joined |> dplyr::filter(is.na(name_models)) |> dplyr::select(-name_models) |> dplyr::filter(!(WT_name |> stringr::str_detect("ruler")), !(WT_name |> stringr::str_detect("set")), !(WT_name |> stringr::str_detect("_del")), !(WT_name |> stringr::str_detect("_ins")), !(WT_name |> stringr::str_detect("_wt[a-z]")), !(WT_name |> stringr::str_detect("scramble")), !(WT_name |> stringr::str_detect("(PP5|ZF5)[.]3")), !(WT_name |> stringr::str_detect("(UAH|SAH)-p53-8R"))) |> dplyr::filter(WT_name |> stringr::str_detect("pdb"))
models_name <- arrow::read_parquet(
"intermediate/AlphaFold_model_PDBs.parquet",
col_select = "name") |>
dplyr::mutate(
name = name |> stringr::str_replace(":", "[|]"))
names_joined <- dplyr::full_join(
dataset1_name |> dplyr::mutate(name_dataset1 = WT_name),
models_name |> dplyr::mutate(name_models = name),
by = c("WT_name" = "name"))
names_joined_summary <- names_joined |>
summarize_map(
x_cols = name_dataset1,
y_cols = name_models,
verbose = TRUE)
check_id_consistency <- function(
dataset_tag,
split,
verbose = FALSE) {
if (verbose) {
cat("Loading model ids...\n")
}
dataset1 <- arrow::read_parquet(
paste0("intermediate/", dataset_tag, "_", split, ".parquet"),
col_select = "id")
if (verbose) {
cat("Loading function prediction ids...\n")
}
ids_anno <- arrow::read_parquet(
paste0("intermediate/", dataset_tag, "_function_predictions.parquet"),
col_select = "id") |>
dplyr::distinct(id)
problems <- dplyr::full_join(
ids_model |>
dplyr::mutate(model_id = id),
ids_anno |>
dplyr::mutate(anno_id = id),
by = "id") |>
summarize_map(
x_cols = model_id,
y_cols = anno_id,
verbose = verbose)
problems
}
check_id_consistency("rosetta_high_quality")
check_id_consistency("rosetta_low_quality")
check_id_consistency("dmpfold_high_quality")
check_id_consistency("dmpfold_low_quality")
|