Skip to content

Commit

Permalink
Update 1_Proteinminion-functions.R
Browse files Browse the repository at this point in the history
bug fix for the function Generate_UniProtTable()
Following an update of the KEGG API
  • Loading branch information
GeremyClair committed Oct 6, 2023
1 parent baf4f68 commit 76d14a4
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions R/1_Proteinminion-functions.R
Expand Up @@ -336,7 +336,7 @@ generate_UniProtTable_KEGG<- function(organismID="9606",reviewed=TRUE,preloaded_
KEGG_path_ID<-rbind(KEGG_path_ID,read.delim(file=paste0(KEGG_URL,"link/pathway/",KEGG_orglist[i]),header=FALSE,col.names = c("KEGG_ID","Pathway_ID")))
KEGG_path_names<- rbind(KEGG_path_names,read.delim(file=paste0(KEGG_URL,"list/pathway/",KEGG_orglist[i]),header=FALSE,col.names = c("Pathway_ID","Pathway_name")))
}

KEGG_path_ID$Pathway_ID <- sub("path:","",KEGG_path_ID$Pathway_ID)
KEGG_path_ID<-merge(KEGG_path_ID, KEGG_path_names, by = "Pathway_ID")

#now merge the table with the other info from the UniProtTable_KEGG table
Expand Down Expand Up @@ -459,16 +459,19 @@ generate_UniProtTables<-function(type=c("GO","KEGG","REACTOME"),organismID="9606
if(preloaded_UniProtTable==TRUE&&exists("UniProtTable")){
UPT<- UniProtTable
}else{
#general checking

if(missing(organismID)&missing(proteomeID)){warning("The 'organismID' and 'proteomeID' were left empty, 'homo sapiens' (9006) will be used by default")
organismID<-"9606"}

if(missing(reviewed)){reviewed<-FALSE}
if(!is.logical(reviewed)){warning("<reviewed> should be either TRUE or FALSE, by default reviewed=FALSE was used")
reviewed<- FALSE}
if(!is.logical(reviewed)){stop("<reviewed> should be either TRUE or FALSE")}
#download the table
download_UniProtTable(organismID=organismID, reviewed=reviewed)

if(missing(proteomeID)){download_UniProtTable(organismID=organismID, reviewed=reviewed)}
if(missing(organismID)){download_UniProtTable(proteomeID = proteomeID, reviewed=reviewed)}else{
download_UniProtTable(organismID=organismID,proteomeID = proteomeID, reviewed=reviewed)
}
}

if("GO" %in% type){
Expand Down

0 comments on commit 76d14a4

Please sign in to comment.