library(cisPath)
# Generate the identifier mapping file
input <- system.file("extdata", "uniprot_sprot_human10.dat", package="cisPath")
mappingFile <- file.path(tempdir(), "mappingFile.txt")
getMappingFile(input, output=mappingFile, taxonId="9606")
# Format the file downloaded from STRING database
output <- file.path(tempdir(), "STRINGPPI.txt")
fileFromSTRING <- system.file("extdata", "protein.links.txt", package="cisPath")
formatSTRINGPPI(fileFromSTRING, mappingFile, "9606", output, 700)
source("http://bioconductor.org/biocLite.R")
biocLite("R.utils")
library(R.utils)
outputDir <- file.path(getwd(), "cisPath_test")
dir.create(outputDir, showWarnings=FALSE, recursive=TRUE)
# Generate the identifier mapping file
fileFromUniProt <- file.path(outputDir, "uniprot_sprot_human.dat")
mappingFile <- file.path(outputDir, "mappingFile.txt")
getMappingFile(fileFromUniProt, output=mappingFile)
# Download STRING PPI for Homo sapiens (compressed:~27M, decompressed:~213M)
destfile <- file.path(outputDir, "9606.protein.links.v9.1.txt.gz")
cat("Downloading...\n")
download.file("http://string-db.org/newstring_download/protein.links.v9.1/9606.protein.links.v9.1.txt.gz", destfile)
cat("Uncompressing...\n")
gunzip(destfile, overwrite=TRUE, remove=FALSE)
# Format STRING PPI
fileFromSTRING <- file.path(outputDir, "9606.protein.links.v9.1.txt")
STRINGPPI <- file.path(outputDir, "STRINGPPI.txt")
formatSTRINGPPI(fileFromSTRING, mappingFile, "9606", output=STRINGPPI, 700)Run the code above in your browser using DataLab