library(cisPath)
sprotFile <- system.file("extdata", "uniprot_sprot_human10.dat", package="cisPath")
output <- file.path(tempdir(), "mappingFile.txt")
getMappingFile(sprotFile, output, taxonId="9606")
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)
# Download protein information file for humans only from UniProt (decompressed:~246M)
destfile <- file.path(outputDir, "uniprot_sprot_human.dat.gz");
cat("Downloading...\n")
download.file("ftp://ftp.uniprot.org/pub/databases/uniprot/current_release/knowledgebase/taxonomic_divisions/uniprot_sprot_human.dat.gz", destfile)
gunzip(destfile, overwrite=TRUE, remove=FALSE)
destfile <- file.path(outputDir, "uniprot_trembl_human.dat.gz");
cat("Downloading...\n")
download.file("ftp://ftp.uniprot.org/pub/databases/uniprot/current_release/knowledgebase/taxonomic_divisions/uniprot_trembl_human.dat.gz", destfile)
gunzip(destfile, overwrite=TRUE, remove=FALSE)
# Generate identifier mapping file
sprotFile <- file.path(outputDir, "uniprot_sprot_human.dat")
tremblFile <- file.path(outputDir, "uniprot_trembl_human.dat")
mappingFile <- file.path(outputDir, "mappingFile.txt")
getMappingFile(sprotFile, output=mappingFile, tremblFile)Run the code above in your browser using DataLab