diff --git a/DESCRIPTION b/DESCRIPTION index da2d853b..a293f5c5 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -38,6 +38,7 @@ Depends: R (>= 4.5.0) URL: https://um-applied-algorithms-lab.github.io/PTMsToPathways/ BugReports: https://github.com/UM-Applied-Algorithms-Lab/PTMsToPathways/issues/new +LazyData: true Config/testthat/edition: 3 Additional_repositories: https://bioconductor.org/packages/3.21/bioc biocViews: Software, Proteomics, PostTranslationalModifications, Pathways, Network diff --git a/man/BRCA_PCN.data.Rd b/man/BRCA_PCN.data.Rd index 81edcfcb..7fa73c7e 100644 --- a/man/BRCA_PCN.data.Rd +++ b/man/BRCA_PCN.data.Rd @@ -8,7 +8,7 @@ An object of class \code{list} of length 3. } \usage{ -data(BRCA_PCN.data) +BRCA_PCN.data } \description{ Output of BuildPathwayCrosstalkNetwork on the BRCA data diff --git a/man/BRCA_genemania.edges.Rd b/man/BRCA_genemania.edges.Rd index 1ff7d494..6ae3981f 100644 --- a/man/BRCA_genemania.edges.Rd +++ b/man/BRCA_genemania.edges.Rd @@ -8,7 +8,7 @@ An object of class \code{data.frame} with 18836 rows and 4 columns. } \usage{ -data(BRCA_genemania.edges) +BRCA_genemania.edges } \description{ Edges from the Genemania database for the genes in the BRCA dataset diff --git a/man/BRCA_stringdb.edges.Rd b/man/BRCA_stringdb.edges.Rd index 10735c35..d26d59d3 100644 --- a/man/BRCA_stringdb.edges.Rd +++ b/man/BRCA_stringdb.edges.Rd @@ -8,7 +8,7 @@ An object of class \code{data.frame} with 6095 rows and 4 columns. } \usage{ -data(BRCA_stringdb.edges) +BRCA_stringdb.edges } \description{ Edges from the STRINGdb database for the genes in the BRCA dataset diff --git a/man/brca_CCCN_data.Rd b/man/brca_CCCN_data.Rd index e7869fe8..fc388326 100644 --- a/man/brca_CCCN_data.Rd +++ b/man/brca_CCCN_data.Rd @@ -8,7 +8,7 @@ An object of class \code{list} of length 3. } \usage{ -data(brca_CCCN_data) +brca_CCCN_data } \description{ Output of MakeCorrelationNetwork on the BRCA data diff --git a/man/brca_clusterlist_data.Rd b/man/brca_clusterlist_data.Rd index 13878a1e..95b19e0a 100644 --- a/man/brca_clusterlist_data.Rd +++ b/man/brca_clusterlist_data.Rd @@ -16,7 +16,7 @@ list containing the 3 outputs of MakeClusterList "MakeClusterList on the BRCA data" } \usage{ -data(brca_clusterlist_data) +brca_clusterlist_data } \description{ Output of MakeClusterList on the BRCA data diff --git a/man/ex_PCNedgelist.Rd b/man/ex_PCNedgelist.Rd index 96df172a..3094fd63 100644 --- a/man/ex_PCNedgelist.Rd +++ b/man/ex_PCNedgelist.Rd @@ -17,7 +17,7 @@ Dataframe of 19 rows and 4 columns "Produced by BuildPathwayCrosstalkNetwork" } \usage{ -data(ex_PCNedgelist) +ex_PCNedgelist } \description{ The Pathway Crosstalk Network but with direct values for both weight types diff --git a/man/ex_adj_consensus.Rd b/man/ex_adj_consensus.Rd index 716fd3f5..2c463da4 100644 --- a/man/ex_adj_consensus.Rd +++ b/man/ex_adj_consensus.Rd @@ -16,7 +16,7 @@ Dataframe of 908 rows and columns: "Produced by MakeClusterList" } \usage{ -data(ex_adj_consensus) +ex_adj_consensus } \description{ A matrix containing values of 0s and 1s depending on if the PTMs are in a cocluster with other PTMs. diff --git a/man/ex_bioplanet.Rd b/man/ex_bioplanet.Rd index 8353888a..c3399f38 100644 --- a/man/ex_bioplanet.Rd +++ b/man/ex_bioplanet.Rd @@ -17,7 +17,7 @@ Dataframe of 196 rows and 4 columns "https://www.frontiersin.org/journals/pharmacology/articles/10.3389/fphar.2019.00445/full" } \usage{ -data(ex_bioplanet) +ex_bioplanet } \description{ A database file from the bioplanet website diff --git a/man/ex_cfn.Rd b/man/ex_cfn.Rd index 78ed7db9..d6fb76ae 100644 --- a/man/ex_cfn.Rd +++ b/man/ex_cfn.Rd @@ -17,7 +17,7 @@ Dataframe of 196 rows and 4 columns "Produced by BuildClusterFilteredNetwork" } \usage{ -data(ex_cfn) +ex_cfn } \description{ The Cluster Filtered Network is a filtered version of the Combined PPIs but only for proteins found to interact via t-SNE clusters diff --git a/man/ex_combined_ppi.Rd b/man/ex_combined_ppi.Rd index c173775c..ea165b98 100644 --- a/man/ex_combined_ppi.Rd +++ b/man/ex_combined_ppi.Rd @@ -17,7 +17,7 @@ Dataframe of 8849 rows and 4 columns "Produced by BuildClusterFilteredNetwork" } \usage{ -data(ex_combined_ppi) +ex_combined_ppi } \description{ Combines all Protein to Protein interaction data and combines their weights into one score from a range of 0 to 1 diff --git a/man/ex_common_clusters.Rd b/man/ex_common_clusters.Rd index 98b8e9bb..fa81561c 100644 --- a/man/ex_common_clusters.Rd +++ b/man/ex_common_clusters.Rd @@ -14,7 +14,7 @@ List of 140 lists: "Produced by MakeClusterList" } \usage{ -data(ex_common_clusters) +ex_common_clusters } \description{ Clusters that contain PTMs that are found to cocluster in all 3 T-SNE lists. diff --git a/man/ex_full_ptm_table.Rd b/man/ex_full_ptm_table.Rd index 19b6d8dc..f3838cde 100644 --- a/man/ex_full_ptm_table.Rd +++ b/man/ex_full_ptm_table.Rd @@ -16,7 +16,7 @@ Dataframe of 9215 rows and 70 columns: "Mass Spectrometry Data" } \usage{ -data(ex_full_ptm_table) +ex_full_ptm_table } \description{ Post-translational modification data under certain environmental conditions. diff --git a/man/ex_gene_cccn_edges.Rd b/man/ex_gene_cccn_edges.Rd index 320f15a0..a474a89d 100644 --- a/man/ex_gene_cccn_edges.Rd +++ b/man/ex_gene_cccn_edges.Rd @@ -17,7 +17,7 @@ Data Frame of 2279 rows and 4 columns "Produced by MakeCorrelationNetwork" } \usage{ -data(ex_gene_cccn_edges) +ex_gene_cccn_edges } \description{ Gene Co-Cluster Correlation Network as an Edgelist diff --git a/man/ex_gene_cccn_nodes.Rd b/man/ex_gene_cccn_nodes.Rd index a57f81c8..f10dd22a 100644 --- a/man/ex_gene_cccn_nodes.Rd +++ b/man/ex_gene_cccn_nodes.Rd @@ -14,7 +14,7 @@ Character Vector of length 390 "Produced by MakeCorrelationNetwork" } \usage{ -data(ex_gene_cccn_nodes) +ex_gene_cccn_nodes } \description{ List of Genes gotten from PTMs diff --git a/man/ex_genemania_edges.Rd b/man/ex_genemania_edges.Rd index 2c78a2db..8cf6297d 100644 --- a/man/ex_genemania_edges.Rd +++ b/man/ex_genemania_edges.Rd @@ -17,7 +17,7 @@ Dataframe of 5 rows and 4 columns "Produced by GetGeneMANIA.edges" } \usage{ -data(ex_genemania_edges) +ex_genemania_edges } \description{ Edges from gene_cccn_nodes that are also found within the Genemania database diff --git a/man/ex_pathway_crosstalk_network.Rd b/man/ex_pathway_crosstalk_network.Rd index 8461cffe..3fe16b39 100644 --- a/man/ex_pathway_crosstalk_network.Rd +++ b/man/ex_pathway_crosstalk_network.Rd @@ -17,7 +17,7 @@ Dataframe of 37 rows and 4 columns "Produced by BuildPathwayCrosstalkNetwork" } \usage{ -data(ex_pathway_crosstalk_network) +ex_pathway_crosstalk_network } \description{ Specific genes from the bioplanet file that we found in Common Clusters and their respective cell signaling pathway relationships diff --git a/man/ex_pathways_list.Rd b/man/ex_pathways_list.Rd index 9ffb1da8..a15ca768 100644 --- a/man/ex_pathways_list.Rd +++ b/man/ex_pathways_list.Rd @@ -14,7 +14,7 @@ list of 9 character vectors "Produced by BuildPathwayCrosstalkNetwork" } \usage{ -data(ex_pathways_list) +ex_pathways_list } \description{ A list of pathway names and the genes that make them up diff --git a/man/ex_ptm_cccn_edges.Rd b/man/ex_ptm_cccn_edges.Rd index 49a5fc77..14adad5f 100644 --- a/man/ex_ptm_cccn_edges.Rd +++ b/man/ex_ptm_cccn_edges.Rd @@ -17,7 +17,7 @@ Data Frame of 5710 rows and 4 columns "Produced by MakeCorrelationNetwork" } \usage{ -data(ex_ptm_cccn_edges) +ex_ptm_cccn_edges } \description{ PTM Co-Cluster Correlation Network as an Edgelist diff --git a/man/ex_ptm_correlation_matrix.Rd b/man/ex_ptm_correlation_matrix.Rd index c0a25706..891ff1b4 100644 --- a/man/ex_ptm_correlation_matrix.Rd +++ b/man/ex_ptm_correlation_matrix.Rd @@ -15,7 +15,7 @@ Square matrix of 908 rows and columns: "Produced by MakeClusterList" } \usage{ -data(ex_ptm_correlation_matrix) +ex_ptm_correlation_matrix } \description{ Matrix relating the correlation values between ptms based on Spearman Similarity. diff --git a/man/ex_small_ptm_table.Rd b/man/ex_small_ptm_table.Rd index 276da841..31b35154 100644 --- a/man/ex_small_ptm_table.Rd +++ b/man/ex_small_ptm_table.Rd @@ -16,7 +16,7 @@ Dataframe of 908 rows and 18 columns: "An .rda version of phospho_cleaned_mapped.txt found in inst/extdata" } \usage{ -data(ex_small_ptm_table) +ex_small_ptm_table } \description{ Post-translational modification data under certain environmental conditions. diff --git a/man/ex_stringdb_edges.Rd b/man/ex_stringdb_edges.Rd index cc78db2d..eac7c3a8 100644 --- a/man/ex_stringdb_edges.Rd +++ b/man/ex_stringdb_edges.Rd @@ -17,7 +17,7 @@ Dataframe of 8844 rows and 4 columns: "Produced by GetSTRINGdb.edges" } \usage{ -data(ex_stringdb_edges) +ex_stringdb_edges } \description{ List of edges between genes in dataset. diff --git a/man/ex_tiny_ptm_table.Rd b/man/ex_tiny_ptm_table.Rd index 7f674284..37472f6b 100644 --- a/man/ex_tiny_ptm_table.Rd +++ b/man/ex_tiny_ptm_table.Rd @@ -16,7 +16,7 @@ Dataframe of 125 rows and 7 columns: "Sub-data frame of the small PTM table" } \usage{ -data(ex_tiny_ptm_table) +ex_tiny_ptm_table } \description{ Post-translational modification data under certain environmental conditions. diff --git a/man/function_key.Rd b/man/function_key.Rd index 6215bfa7..2c91dc5d 100644 --- a/man/function_key.Rd +++ b/man/function_key.Rd @@ -21,7 +21,7 @@ Data frame with 24339 rows and 8 columns: \code{FunctionKey.txt} processed into a package data object. } \usage{ -data(function_key) +function_key } \description{ Gene-level annotation data used to build Cytoscape node metadata. diff --git a/tests/testthat/test_buildclusterfilterednetwork.R b/tests/testthat/test_buildclusterfilterednetwork.R index 037fd6d0..66f9b165 100644 --- a/tests/testthat/test_buildclusterfilterednetwork.R +++ b/tests/testthat/test_buildclusterfilterednetwork.R @@ -2,12 +2,12 @@ test_that("BuildClusterFilteredNetwork() gives right answer", { - # Get example data + # Run the function to test + gene_cccn_edges <- PTMsToPathways::ex_gene_cccn_edges stringdb_edges <- PTMsToPathways::ex_stringdb_edges genemania_edges <- PTMsToPathways::ex_genemania_edges - - # Run the function to test + output <- BuildClusterFilteredNetwork(gene_cccn_edges, stringdb_edges, genemania_edges, NULL) # Test the combined PPI output diff --git a/tests/testthat/test_buildpathwaycrosstalknetwork.R b/tests/testthat/test_buildpathwaycrosstalknetwork.R index 0c7e7beb..8b4bc02e 100644 --- a/tests/testthat/test_buildpathwaycrosstalknetwork.R +++ b/tests/testthat/test_buildpathwaycrosstalknetwork.R @@ -1,13 +1,8 @@ # THESE USE DATA GENERATED FROM THE SMALL PTM TABLE -# Get data from package -common_clusters <- PTMsToPathways::ex_common_clusters -pathways_list <- PTMsToPathways::ex_pathways_list - - test_that("BuildPathwayCrosstalkNetwork() gives right answer", { - - output <- suppressMessages(BuildPathwayCrosstalkNetwork(common_clusters, pathways_list, createfile = FALSE)) + + output <- suppressMessages(BuildPathwayCrosstalkNetwork(ex_common_clusters, ex_pathways_list, createfile = FALSE)) pathway_crosstalk_network <- output[[1]] @@ -53,9 +48,9 @@ test_that("BuildPathwayCrosstalkNetwork() gives right answer", { test_that("ReadBioplanetFile() gives right answer", { # read pathways.csv from inst/extdata and compare to ex_pathways_list bioplanet_pathways <- ReadBioplanetFile(system.file("extdata", "pathway.csv", package = "PTMsToPathways")) - expect_equal(length(bioplanet_pathways), length(pathways_list)) - for (pathway_name in names(pathways_list)) { + expect_equal(length(bioplanet_pathways), length(ex_pathways_list)) + for (pathway_name in names(ex_pathways_list)) { expect_true(pathway_name %in% names(bioplanet_pathways)) - expect_equal(sort(bioplanet_pathways[[pathway_name]]), sort(pathways_list[[pathway_name]])) + expect_equal(sort(bioplanet_pathways[[pathway_name]]), sort(ex_pathways_list[[pathway_name]])) } }) \ No newline at end of file diff --git a/tests/testthat/test_gatherppidata.R b/tests/testthat/test_gatherppidata.R index eb09ee4f..c0e379e6 100644 --- a/tests/testthat/test_gatherppidata.R +++ b/tests/testthat/test_gatherppidata.R @@ -1,13 +1,9 @@ # THESE USE DATA GENERATED FROM THE SMALL PTM TABLE -# Get data from package -gene_cccn_edges <- PTMsToPathways::ex_gene_cccn_edges -gene_cccn_nodes <- PTMsToPathways::ex_gene_cccn_nodes - test_that("GetGeneMANIA.edges() gives right answer", { path <- system.file('extdata/ex_genemania_interactions.txt', package='PTMsToPathways') # Accesses the path to this file even run on github or devtools::test - genemania_edges <- GetGeneMANIA.edges(path, gene_cccn_nodes) # Run function and filter data + genemania_edges <- GetGeneMANIA.edges(path, ex_gene_cccn_nodes) # Run function and filter data col_1 <- as.list(genemania_edges[,1]) row_2 <- as.list(genemania_edges[2,]) @@ -23,7 +19,7 @@ test_that("GetGeneMANIA.edges() gives right answer", { test_that("GetSTRINGdb.edges() gives right answer with local file", { path <- system.file('extdata/small_string_hs_hugo.tsv', package='PTMsToPathways') - stringdb_edges <- suppressMessages(GetSTRINGdb.edges(gene_cccn_edges, gene_cccn_nodes, local = TRUE, string.local.path = path)) + stringdb_edges <- suppressMessages(GetSTRINGdb.edges(ex_gene_cccn_edges, ex_gene_cccn_nodes, local = TRUE, string.local.path = path)) # Expected values exp_row_100 <- data.frame(source = "PLEKHA7", target = "EPB41L2", interaction = "experimental", Weight = 292) @@ -36,7 +32,7 @@ test_that("GetSTRINGdb.edges() gives right answer with local file", { test_that("GetKinsub.edges() gives right answer", { path <- system.file('extdata/Kinase_Substrate_Dataset.txt', package='PTMsToPathways') - kinsub_edges <- GetKinsub.edges(path, gene_cccn_nodes) + kinsub_edges <- GetKinsub.edges(path, ex_gene_cccn_nodes) # Expected values exp_row_1 <- data.frame(source = "EGFR", target = "PLCG1", interaction = "pp", Weight = 1) diff --git a/tests/testthat/test_makeclusterlist.R b/tests/testthat/test_makeclusterlist.R index be41ee2d..3e4176b7 100644 --- a/tests/testthat/test_makeclusterlist.R +++ b/tests/testthat/test_makeclusterlist.R @@ -7,8 +7,7 @@ test_that("MakeClusterList() gives right answer", { clust1 <- list("RACK1 p T229", "ATP6V1H p Y388", "TNK2 p T829", "IRS2 p Y632") clust2 <- list("EIF2S1 p Y147", "ACTG1 p T297; ACTB p T297", "PDLIM5 p T248", "LSR p S365", "DCP1A p Y64", "MAPK13 p T185", "ALK p S1509", "GAREM1 p S700") - # Get data from package - ptmtable <- PTMsToPathways::ex_tiny_ptm_table + ptmtable <- ex_tiny_ptm_table clusterlist_data <- suppressMessages(MakeClusterList(ptmtable, keeplength = 2, toolong = 3.5)) common_clusters <- clusterlist_data[[1]] diff --git a/tests/testthat/test_makecorrelationnetwork.R b/tests/testthat/test_makecorrelationnetwork.R index 142fea7a..30ef7914 100644 --- a/tests/testthat/test_makecorrelationnetwork.R +++ b/tests/testthat/test_makecorrelationnetwork.R @@ -2,12 +2,8 @@ test_that("MakeCorrelationNetwork() gives right answer", { - # Get data from package - adj_consensus <- PTMsToPathways::ex_adj_consensus - ptm_correlation_matrix <- PTMsToPathways::ex_ptm_correlation_matrix - - # Run the function and get results - correlationnetwork_data <- suppressMessages(MakeCorrelationNetwork(adj_consensus, ptm_correlation_matrix)) + # now run MakeCorrelationNetwork + correlationnetwork_data <- suppressMessages(MakeCorrelationNetwork(ex_adj_consensus, ex_ptm_correlation_matrix)) ptm_cccn_edges <- correlationnetwork_data[[1]] gene_cccn_edges <- correlationnetwork_data[[2]] gene_cccn_nodes <- correlationnetwork_data[[3]] diff --git a/vignettes/BRCANetworks.Rmd b/vignettes/BRCANetworks.Rmd index 8e365a8f..6b510ac5 100644 --- a/vignettes/BRCANetworks.Rmd +++ b/vignettes/BRCANetworks.Rmd @@ -61,8 +61,6 @@ available: ```{r eval = TRUE} library(PTMsToPathways) -data_names <- data(package = "PTMsToPathways")$results[, "Item"] -data(list = data_names, package = "PTMsToPathways") ``` ### Preprocess data for PTMsToPathways functions diff --git a/vignettes/CreatingNetworks.Rmd b/vignettes/CreatingNetworks.Rmd index 475f9733..bdabaf6b 100644 --- a/vignettes/CreatingNetworks.Rmd +++ b/vignettes/CreatingNetworks.Rmd @@ -71,8 +71,6 @@ And load the package: ```{r eval = TRUE, echo = TRUE} library(PTMsToPathways) -data_names <- data(package = "PTMsToPathways")$results[, "Item"] -data(list = data_names, package = "PTMsToPathways") ``` # Starting Data diff --git a/vignettes/CytoscapeGraphing.Rmd b/vignettes/CytoscapeGraphing.Rmd index c7ac147b..75a379fc 100644 --- a/vignettes/CytoscapeGraphing.Rmd +++ b/vignettes/CytoscapeGraphing.Rmd @@ -58,9 +58,6 @@ built-in P2P function [ReadBioplanetFile()](reference/ReadBioplanetFile.html). ```{r eval = TRUE, echo = FALSE} library(PTMsToPathways) -data_names <- data(package = "PTMsToPathways")$results[, "Item"] -data(list = data_names, package = "PTMsToPathways") -funckey <- function_key pathways.list <- ReadBioplanetFile(system.file("extdata", "bioplanet_pathway_June2025.csv", package = "PTMsToPathways")) ``` diff --git a/vignettes/RawDataProcessing.Rmd b/vignettes/RawDataProcessing.Rmd index 3d289979..3f7c3336 100644 --- a/vignettes/RawDataProcessing.Rmd +++ b/vignettes/RawDataProcessing.Rmd @@ -72,8 +72,6 @@ data will dictate the names of modifications. First, let's load the P2P package, since it contains some helpful pre-processing functions. ```{r eval = TRUE} library(PTMsToPathways) -data_names <- data(package = "PTMsToPathways")$results[, "Item"] -data(list = data_names, package = "PTMsToPathways") ``` The example raw data file for this