Skip to content

Commit

Permalink
fix network type error
Browse files Browse the repository at this point in the history
  • Loading branch information
DavisWeaver committed Jan 28, 2023
1 parent 9dc50b7 commit 70963ff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions R/filter.R
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ compute_crosstalk <- function(seed_proteins, g = NULL, use_ppi = TRUE,
#check inputs
if(use_ppi == TRUE){
g <- load_ppi(ppi = ppi, species = species, min_score = min_score,
union = union, intersection = intersection, cache = cache,
network_type = network_type)
union = union, intersection = intersection, cache = cache)
} else {
if(!igraph::is.igraph(g)){
stop("g must be an igraph object")
Expand Down
8 changes: 4 additions & 4 deletions R/ppi_ingest.R
Original file line number Diff line number Diff line change
Expand Up @@ -86,20 +86,20 @@ prep_biogrid <- function(cache = NULL) {
tmp <- tempdir()

#Download most recent version of the biogrid
message("Downloading biogrid version 3.5.171")
download.file("https://downloads.thebiogrid.org/Download/BioGRID/Release-Archive/BIOGRID-3.5.171/BIOGRID-ORGANISM-3.5.171.tab2.zip",
message("Downloading biogrid version 4.4.217")
download.file("https://downloads.thebiogrid.org/Download/BioGRID/Release-Archive/BIOGRID-4.4.217/BIOGRID-ORGANISM-4.4.217.tab2.zip",
destfile = paste0(tmp, "/biogrid.zip"))

#Unzip only the homosapiens portion of the biogrid zip file and delete big zip file
unzip(paste0(tmp, '/biogrid.zip'),
files = c("BIOGRID-ORGANISM-Homo_sapiens-3.5.171.tab2.txt"),
files = c("BIOGRID-ORGANISM-Homo_sapiens-4.4.217.tab2.txt"),
exdir = paste0(tmp, "/unzip"))
file.remove(paste0(tmp, "/biogrid.zip"))

#Read in biogrid file from temp directory.
biogrid <-
try(read.delim(
paste0(tmp, "/unzip/BIOGRID-ORGANISM-Homo_sapiens-3.5.171.tab2.txt"),
paste0(tmp, "/unzip/BIOGRID-ORGANISM-Homo_sapiens-4.4.217.tab2.txt"),
header = TRUE
))
if(inherits(biogrid, "try-error")) {
Expand Down

0 comments on commit 70963ff

Please sign in to comment.