diff --git a/renv.lock b/renv.lock index 5e7a305..ff44fe9 100644 --- a/renv.lock +++ b/renv.lock @@ -232,6 +232,30 @@ "crayon" ] }, + "ComplexHeatmap": { + "Package": "ComplexHeatmap", + "Version": "2.10.0", + "Source": "Bioconductor", + "git_url": "https://git.bioconductor.org/packages/ComplexHeatmap", + "git_branch": "RELEASE_3_14", + "git_last_commit": "170df82", + "git_last_commit_date": "2021-10-26", + "Hash": "964941c376127a2eccfb0d89d43442d2", + "Requirements": [ + "GetoptLong", + "GlobalOptions", + "IRanges", + "RColorBrewer", + "circlize", + "clue", + "colorspace", + "digest", + "doParallel", + "foreach", + "matrixStats", + "png" + ] + }, "DBI": { "Package": "DBI", "Version": "1.1.2", @@ -518,6 +542,26 @@ "XVector" ] }, + "GetoptLong": { + "Package": "GetoptLong", + "Version": "1.0.5", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "61fac01c73abf03ac72e88dc3952c1e3", + "Requirements": [ + "GlobalOptions", + "crayon", + "rjson" + ] + }, + "GlobalOptions": { + "Package": "GlobalOptions", + "Version": "0.1.2", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "c3f7b221e60c28f5f3533d74c6fef024", + "Requirements": [] + }, "HDInterval": { "Package": "HDInterval", "Version": "0.2.2", @@ -737,10 +781,10 @@ }, "Rcpp": { "Package": "Rcpp", - "Version": "1.0.7", + "Version": "1.0.10", "Source": "Repository", "Repository": "CRAN", - "Hash": "dab19adae4440ae55aa8a9d238b246bb", + "Hash": "e749cae40fa9ef469b6050959517453c", "Requirements": [] }, "RcppArmadillo": { @@ -766,10 +810,10 @@ }, "RcppParallel": { "Package": "RcppParallel", - "Version": "5.1.5", + "Version": "5.1.7", "Source": "Repository", "Repository": "CRAN", - "Hash": "f3e94e34ff656a7c8336ce01207bc2b8", + "Hash": "a45594a00f5dbb073d5ec9f48592a08a", "Requirements": [] }, "RedeR": { @@ -1196,19 +1240,27 @@ "Hash": "0baa960e3b49c6176a4f42addcbacc59", "Requirements": [] }, + "brio": { + "Package": "brio", + "Version": "1.1.3", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "976cf154dfb043c012d87cddd8bca363", + "Requirements": [] + }, "broom": { "Package": "broom", - "Version": "0.7.11", + "Version": "1.0.4", "Source": "Repository", "Repository": "CRAN", - "Hash": "e4487657db580ae1fe0f85237a88ff1f", + "Hash": "f62b2504021369a2449c54bbda362d30", "Requirements": [ "backports", "dplyr", "ellipsis", "generics", - "ggplot2", "glue", + "lifecycle", "purrr", "rlang", "stringr", @@ -1330,6 +1382,18 @@ "backports" ] }, + "circlize": { + "Package": "circlize", + "Version": "0.4.15", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "2bb47a2fe6ab009b1dcc5566d8c3a988", + "Requirements": [ + "GlobalOptions", + "colorspace", + "shape" + ] + }, "class": { "Package": "class", "Version": "7.3-19", @@ -1356,6 +1420,37 @@ "Hash": "ebaa97ac99cc2daf04e77eecc7b781d7", "Requirements": [] }, + "clock": { + "Package": "clock", + "Version": "0.6.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "db6b0e88fa092982ecf56322b47be0fe", + "Requirements": [ + "cpp11", + "rlang", + "tzdb", + "vctrs" + ] + }, + "clue": { + "Package": "clue", + "Version": "0.3-64", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "f013e45eb656a4bb17b39cb24827a51f", + "Requirements": [ + "cluster" + ] + }, + "cluster": { + "Package": "cluster", + "Version": "2.1.4", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "5edbbabab6ce0bf7900a74fd4358628e", + "Requirements": [] + }, "clusterProfiler": { "Package": "clusterProfiler", "Version": "4.2.1", @@ -1415,6 +1510,14 @@ "Hash": "0f22be39ec1d141fd03683c06f3a6e67", "Requirements": [] }, + "concatenate": { + "Package": "concatenate", + "Version": "1.0.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "94b165d30bf16386c2f096409d502463", + "Requirements": [] + }, "conquer": { "Package": "conquer", "Version": "1.2.1", @@ -1531,6 +1634,16 @@ "Hash": "fe1a3788cf243db3eca07ae661860793", "Requirements": [] }, + "diffobj": { + "Package": "diffobj", + "Version": "0.3.5", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "bcaa8b95f8d7d01a5dedfd959ce88ab8", + "Requirements": [ + "crayon" + ] + }, "digest": { "Package": "digest", "Version": "0.6.29", @@ -1591,13 +1704,13 @@ }, "dplyr": { "Package": "dplyr", - "Version": "1.0.7", + "Version": "1.1.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "36f1ae62f026c8ba9f9b5c9a08c03297", + "Hash": "dea6970ff715ca541c387de363ff405e", "Requirements": [ "R6", - "ellipsis", + "cli", "generics", "glue", "lifecycle", @@ -1651,6 +1764,19 @@ "proxy" ] }, + "easylayout": { + "Package": "easylayout", + "Version": "0.1.0", + "Source": "GitHub", + "RemoteType": "github", + "RemoteHost": "api.github.com", + "RemoteRepo": "easylayout", + "RemoteUsername": "daniloimparato", + "RemoteRef": "dadamorais", + "RemoteSha": "fdb800aec4852dddcdaec11a4bae1dc1c5d770b9", + "Hash": "555092182283a7b6537406811f0053a6", + "Requirements": [] + }, "edgeR": { "Package": "edgeR", "Version": "3.36.0", @@ -1991,10 +2117,10 @@ }, "generics": { "Package": "generics", - "Version": "0.1.1", + "Version": "0.1.3", "Source": "Repository", "Repository": "CRAN", - "Hash": "3f6bcfb0ee5d671d9fd1893d2faa79cb", + "Hash": "15e9634c0fcd294799e9b2e929ed1b86", "Requirements": [] }, "ggdist": { @@ -2073,20 +2199,22 @@ }, "ggplot2": { "Package": "ggplot2", - "Version": "3.3.5", + "Version": "3.4.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "d7566c471c7b17e095dd023b9ef155ad", + "Hash": "3a147ee02e85a8941aad9909f1b43b7b", "Requirements": [ "MASS", - "digest", + "cli", "glue", "gtable", "isoband", + "lifecycle", "mgcv", "rlang", "scales", "tibble", + "vctrs", "withr" ] }, @@ -2189,10 +2317,10 @@ }, "glue": { "Package": "glue", - "Version": "1.6.0", + "Version": "1.6.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "b8bb7aaf248e45bac08ebed86f3a0aa4", + "Hash": "4f2596dfb05dac67b9dc558e5c6fba2e", "Requirements": [] }, "googledrive": { @@ -2307,6 +2435,47 @@ "Hash": "2ace6c4a06297d0b364e0444384a2b82", "Requirements": [] }, + "gwasrapidd": { + "Package": "gwasrapidd", + "Version": "0.99.12", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "56be6fbe33e1892fea54591d36881510", + "Requirements": [ + "assertthat", + "concatenate", + "dplyr", + "glue", + "httr", + "jsonlite", + "lubridate", + "magrittr", + "pingr", + "plyr", + "progress", + "purrr", + "rlang", + "stringr", + "testthat", + "tibble", + "tidyr", + "urltools" + ] + }, + "hardhat": { + "Package": "hardhat", + "Version": "1.3.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "b56b42c50bb7c76a683e8e61f415d828", + "Requirements": [ + "cli", + "glue", + "rlang", + "tibble", + "vctrs" + ] + }, "haven": { "Package": "haven", "Version": "2.4.3", @@ -2495,6 +2664,27 @@ "Hash": "64778782a89480e9a644f69aad9a2877", "Requirements": [] }, + "janitor": { + "Package": "janitor", + "Version": "2.2.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "5baae149f1082f466df9d1442ba7aa65", + "Requirements": [ + "dplyr", + "hms", + "lifecycle", + "lubridate", + "magrittr", + "purrr", + "rlang", + "snakecase", + "stringi", + "stringr", + "tidyr", + "tidyselect" + ] + }, "jquerylib": { "Package": "jquerylib", "Version": "0.1.4", @@ -2599,11 +2789,12 @@ }, "lifecycle": { "Package": "lifecycle", - "Version": "1.0.1", + "Version": "1.0.3", "Source": "Repository", "Repository": "CRAN", - "Hash": "a6b6d352e3ed897373ab19d8395c98d0", + "Hash": "001cecbeac1cff9301bdc3775ee46a86", "Requirements": [ + "cli", "glue", "rlang" ] @@ -2870,6 +3061,18 @@ "askpass" ] }, + "openxlsx": { + "Package": "openxlsx", + "Version": "4.2.5.2", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "c03b4c18d42da881fb8e15a085c2b9d6", + "Requirements": [ + "Rcpp", + "stringi", + "zip" + ] + }, "org.Hs.eg.db": { "Package": "org.Hs.eg.db", "Version": "3.14.0", @@ -2963,21 +3166,30 @@ }, "pillar": { "Package": "pillar", - "Version": "1.6.4", + "Version": "1.9.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "60200b6aa32314ac457d3efbb5ccbd98", + "Hash": "15da5a8412f317beeee6175fbc76f4bb", "Requirements": [ "cli", - "crayon", - "ellipsis", "fansi", + "glue", "lifecycle", "rlang", "utf8", "vctrs" ] }, + "pingr": { + "Package": "pingr", + "Version": "2.0.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "e293e79be42ffd336d938937fd3017fb", + "Requirements": [ + "processx" + ] + }, "pkgbuild": { "Package": "pkgbuild", "Version": "1.3.1", @@ -3003,6 +3215,23 @@ "Hash": "01f28d4278f15c76cddbea05899c5d6f", "Requirements": [] }, + "pkgload": { + "Package": "pkgload", + "Version": "1.3.2", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "6b0c222c5071efe0f3baf3dae9aa40e2", + "Requirements": [ + "cli", + "crayon", + "desc", + "fs", + "glue", + "rlang", + "rprojroot", + "withr" + ] + }, "plogr": { "Package": "plogr", "Version": "0.2.0", @@ -3087,6 +3316,14 @@ "tidyr" ] }, + "praise": { + "Package": "praise", + "Version": "1.0.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "a555924add98c99d2f411e37e7d25e9f", + "Requirements": [] + }, "prettyunits": { "Package": "prettyunits", "Version": "1.1.1", @@ -3174,13 +3411,16 @@ }, "purrr": { "Package": "purrr", - "Version": "0.3.4", + "Version": "1.0.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "97def703420c8ab10d8f0e6c72101e02", + "Hash": "d71c815267c640f17ddbf7f16144b4bb", "Requirements": [ + "cli", + "lifecycle", "magrittr", - "rlang" + "rlang", + "vctrs" ] }, "quadprog": { @@ -3218,14 +3458,6 @@ "reshape2" ] }, - "rJava": { - "Package": "rJava", - "Version": "1.0-6", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "0415819f6baa75d86d52483f7292b623", - "Requirements": [] - }, "ranger": { "Package": "ranger", "Version": "0.13.1", @@ -3281,17 +3513,20 @@ }, "recipes": { "Package": "recipes", - "Version": "0.1.17", + "Version": "1.0.6", "Source": "Repository", "Repository": "CRAN", - "Hash": "443951ef5d9e72a96405cbb0157bb1d4", + "Hash": "eb53ffc9674dc9a52c3a7e22d96d3f56", "Requirements": [ "Matrix", + "cli", + "clock", "dplyr", "ellipsis", "generics", "glue", "gower", + "hardhat", "ipred", "lifecycle", "lubridate", @@ -3483,10 +3718,10 @@ }, "rstudioapi": { "Package": "rstudioapi", - "Version": "0.13", + "Version": "0.14", "Source": "Repository", "Repository": "CRAN", - "Hash": "06c85365a03fdaf699966cc1d3cf53ea", + "Hash": "690bd2acc42a9166ce34845884459320", "Requirements": [] }, "rsvd": { @@ -3557,10 +3792,10 @@ }, "scales": { "Package": "scales", - "Version": "1.1.1", + "Version": "1.2.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "6f76f71042411426ec8df6c54f34e6dd", + "Hash": "906cb23d2f1c5680b8ce439b44c6fa63", "Requirements": [ "R6", "RColorBrewer", @@ -3568,6 +3803,7 @@ "labeling", "lifecycle", "munsell", + "rlang", "viridisLite" ] }, @@ -3607,6 +3843,14 @@ "scales" ] }, + "shape": { + "Package": "shape", + "Version": "1.4.6", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "9067f962730f58b14d8ae54ca885509f", + "Requirements": [] + }, "shiny": { "Package": "shiny", "Version": "1.7.1", @@ -3646,6 +3890,17 @@ "Rcpp" ] }, + "snakecase": { + "Package": "snakecase", + "Version": "0.11.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "4079070fc210c7901c0832a3aeab894f", + "Requirements": [ + "stringi", + "stringr" + ] + }, "snow": { "Package": "snow", "Version": "0.4-4", @@ -3719,14 +3974,18 @@ }, "stringr": { "Package": "stringr", - "Version": "1.4.0", + "Version": "1.5.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "0759e6b6c0957edb1311028a49a35e76", + "Hash": "671a4d384ae9d32fc47a14e98bfa3dc8", "Requirements": [ + "cli", "glue", + "lifecycle", "magrittr", - "stringi" + "rlang", + "stringi", + "vctrs" ] }, "survival": { @@ -3763,14 +4022,40 @@ "Hash": "fd792ceac77f96b647fa8d6e1788969a", "Requirements": [] }, + "testthat": { + "Package": "testthat", + "Version": "3.1.7", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "7eb5fd202a61d2fb78af5869b6c08998", + "Requirements": [ + "R6", + "brio", + "callr", + "cli", + "desc", + "digest", + "ellipsis", + "evaluate", + "jsonlite", + "lifecycle", + "magrittr", + "pkgload", + "praise", + "processx", + "ps", + "rlang", + "waldo", + "withr" + ] + }, "tibble": { "Package": "tibble", - "Version": "3.1.6", + "Version": "3.2.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "8a8f02d1934dfd6431c671361510dd0b", + "Hash": "a84e2cc86d07289b3b6f5069df7a004c", "Requirements": [ - "ellipsis", "fansi", "lifecycle", "magrittr", @@ -3822,19 +4107,20 @@ }, "tidyr": { "Package": "tidyr", - "Version": "1.1.4", + "Version": "1.3.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "c8fbdbd9fcac223d6c6fe8e406f368e1", + "Hash": "e47debdc7ce599b070c8e78e8ac0cfcf", "Requirements": [ + "cli", "cpp11", "dplyr", - "ellipsis", "glue", "lifecycle", "magrittr", "purrr", "rlang", + "stringr", "tibble", "tidyselect", "vctrs" @@ -3842,16 +4128,17 @@ }, "tidyselect": { "Package": "tidyselect", - "Version": "1.1.1", + "Version": "1.2.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "7243004a708d06d4716717fa1ff5b2fe", + "Hash": "79540e5fcd9e0435af547d885f184fd5", "Requirements": [ - "ellipsis", + "cli", "glue", - "purrr", + "lifecycle", "rlang", - "vctrs" + "vctrs", + "withr" ] }, "tidytree": { @@ -3947,6 +4234,16 @@ "tidytree" ] }, + "triebeard": { + "Package": "triebeard", + "Version": "0.3.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "847a9d113b78baca4a9a8639609ea228", + "Requirements": [ + "Rcpp" + ] + }, "tweenr": { "Package": "tweenr", "Version": "1.0.2", @@ -4000,14 +4297,25 @@ }, "tzdb": { "Package": "tzdb", - "Version": "0.2.0", + "Version": "0.3.0", "Source": "Repository", "Repository": "CRAN", - "Hash": "5e069fb033daf2317bd628d3100b75c5", + "Hash": "b2e1cbce7c903eaf23ec05c58e59fb5e", "Requirements": [ "cpp11" ] }, + "urltools": { + "Package": "urltools", + "Version": "1.7.3", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "e86a704261a105f4703f653e05defa3e", + "Requirements": [ + "Rcpp", + "triebeard" + ] + }, "utf8": { "Package": "utf8", "Version": "1.2.2", @@ -4038,13 +4346,14 @@ }, "vctrs": { "Package": "vctrs", - "Version": "0.3.8", + "Version": "0.6.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "ecf749a1b39ea72bd9b51b76292261f1", + "Hash": "a745bda7aff4734c17294bb41d4e4607", "Requirements": [ - "ellipsis", + "cli", "glue", + "lifecycle", "rlang" ] }, @@ -4091,6 +4400,22 @@ "withr" ] }, + "waldo": { + "Package": "waldo", + "Version": "0.4.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "035fba89d0c86e2113120f93301b98ad", + "Requirements": [ + "cli", + "diffobj", + "fansi", + "glue", + "rematch2", + "rlang", + "tibble" + ] + }, "withr": { "Package": "withr", "Version": "2.5.0", @@ -4107,27 +4432,6 @@ "Hash": "e2e5fb1a74fbb68b27d6efc5372635dc", "Requirements": [] }, - "xlsx": { - "Package": "xlsx", - "Version": "0.6.5", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "d24d579f59a3b6da1e1cf4660425443e", - "Requirements": [ - "rJava", - "xlsxjars" - ] - }, - "xlsxjars": { - "Package": "xlsxjars", - "Version": "0.6.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "4c4b3bc29a916f33f1298dd951133351", - "Requirements": [ - "rJava" - ] - }, "xml2": { "Package": "xml2", "Version": "1.3.3", @@ -4160,6 +4464,14 @@ "Hash": "922e11dcf40bb5dfcf3fe5e714d0dc35", "Requirements": [] }, + "zip": { + "Package": "zip", + "Version": "2.3.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "d98c94dacb7e0efcf83b0a133a705504", + "Requirements": [] + }, "zlibbioc": { "Package": "zlibbioc", "Version": "1.40.0", diff --git a/scripts/gwas_intersections.R b/scripts/gwas_intersections.R index 91c9733..51f0706 100644 --- a/scripts/gwas_intersections.R +++ b/scripts/gwas_intersections.R @@ -3,13 +3,15 @@ library(dplyr) library(purrr) +library(gwasrapidd) +library(biomaRt) # Get studies related to 'major depressive disorder' and 'unipolar depression'. efo_id <- c( unipolar_depression = "EFO_0003761", major_depressive_disorder = "MONDO_0002009" ) -mdd_results <- get_studies(efo_id = efo_id, set_operation = "intersection") +mdd_results <- get_studies(efo_id = efo_id, set_operation = "intersection") mdd_filtered <- mdd_results@publications %>% filter(publication_date > "2018-01-01") @@ -39,7 +41,7 @@ map_dfr(studies, function(study_id) { assoc_2 <- associations@associations %>% dplyr::select(association_id, pvalue, pvalue_description, range, beta_number, beta_direction) - associations_data <- reduce(list(assoc_1, assoc_2), inner_join, by = "association_id") + associations_data <- purrr::reduce(list(assoc_1, assoc_2), inner_join, by = "association_id") associations_data diff --git a/scripts/plots.rmd b/scripts/plots.rmd index f469e59..4aceaaf 100644 --- a/scripts/plots.rmd +++ b/scripts/plots.rmd @@ -412,7 +412,7 @@ diff_df %>% ) ggsave("results/plots_paper/percentage_gt.pdf", height = 5, width = 10, device = cairo_pdf) -ggsave("results/plots_paper/percentage_gt.png", height = 5, width = 10) +ggsave("results/plots_paper/percentage_gt.png", height = 5, width = 10, dpi = 300) ``` # Supplementary Figure 6 diff --git a/scripts/teste b/scripts/teste deleted file mode 100644 index 9bd7ec1..0000000 --- a/scripts/teste +++ /dev/null @@ -1,125 +0,0 @@ -import feyn -import pandas as pd -from sklearn.model_selection import train_test_split - - -def get_train_test_types(dataset, random_seed=1024, target="phenotype_reg"): - UNWANTED_COLUMNS_FOR_TRAINING = ["run", "phenotype"] - data = dataset[dataset.columns.difference(UNWANTED_COLUMNS_FOR_TRAINING)].dropna() - - # Let's record the categorical data types in our dataset (note features will be treated as numerical by default). - stypes = {} - for f in data.columns: - if data[f].dtype == "object": - stypes[f] = "c" - - # Split - train, test = train_test_split( - data, test_size=0.33, stratify=data[target], random_state=random_seed - ) - - return train, test, stypes - - -def get_models( - training_data, stypes, priors, target="phenotype_reg", epochs=20, random_seed=1024 -): - - ql = feyn.QLattice(random_seed=random_seed) - ql.update_priors(priors) - - models = ql.auto_run( - data=training_data, - output_name=target, - kind="classification", - stypes=stypes, - n_epochs=epochs, - ) - - return models - - -def save_model(model, train, test, filename): - model.plot(train, test, filename=f"results/sym_reg/{filename}_summary.html") - model.plot_signal(train, filename=f"results/sym_reg/{filename}_signal.svg") - model.save(f"results/sym_reg/{filename}_model.json") - - -# From https://github.com/abzu-ai/QLattice-clinical-omics/blob/main/notebooks/functions.py -def get_models_table(models, train, test, model_name): - model_list = [] - auc_list_train = [] - auc_list_test = [] - bic_list = [] - accuracy_train = [] - accuracy_test = [] - feat_list = [] - function_list = [] - loss_list = [] - i = 0 - for x in models: - model_list.append(str(i)) - auc_list_train.append(str(x.roc_auc_score(train).round(2))) - auc_list_test.append(str(x.roc_auc_score(test).round(2))) - accuracy_train.append(str(x.accuracy_score(train).round(2))) - accuracy_test.append(str(x.accuracy_score(test).round(2))) - bic_list.append(str(x.bic.round(2))) - feat_list.append(len(x.features)) - function_list.append( - x.sympify(symbolic_lr=False, symbolic_cat=True, include_weights=False) - ) - loss_list.append(x.loss_value) - i += 1 - df = pd.DataFrame( - list( - zip( - model_list, - auc_list_train, - auc_list_test, - accuracy_train, - accuracy_test, - bic_list, - feat_list, - function_list, - loss_list, - ) - ), - columns=[ - "Model", - "AUC Train", - "AUC Test", - "Accuracy Train", - "Accuracy Test", - "BIC", - "N. Features", - "Functional form", - "Loss", - ], - ) - - df.to_csv(f"results/sym_reg/{model_name}_table.csv", index=False) - - -def run_models(): - - three_gene_data = pd.read_table("results/sym_reg/selected_genes_for_reg.tsv") - full_data = pd.read_table("results/sym_reg/genes_for_reg.tsv") - - threeg_train, threeg_test, threeg_types = get_train_test_types(three_gene_data) - full_train, full_test, full_types = get_train_test_types(full_data) - - threeg_priors = feyn.tools.estimate_priors(threeg_train, "phenotype_reg", floor=0.1) - full_priors = feyn.tools.estimate_priors(full_train, "phenotype_reg", floor=0.1) - - threeg_models = get_models(threeg_train, threeg_types, threeg_priors) - full_models = get_models(full_train, full_types, full_priors) - - get_models_table(threeg_models, threeg_train, threeg_test, "three_gene") - get_models_table(full_models, full_train, full_test, "all_genes") - - save_model(threeg_models[0], threeg_train, threeg_test, "three_gene") - save_model(full_models[0], full_train, full_test, "all_genes") - - -if __name__ == "__main__": - run_models()