-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1cddefe
commit 9f55be1
Showing
16 changed files
with
295 additions
and
288 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,22 @@ | ||
Package: UniprotR | ||
Title: Retrieving Information of Proteins from Uniprot | ||
Version: 2.0.7 | ||
Version: 2.1.0 | ||
Authors@R: c(person("Mohamed", "Soudy", email = "MohmedSoudy2009@gmail.com", role=c("aut", "cre")), person("Ali", "Mostafa", email = "ali.mo.anwar@std.agr.cu.edu.eg", role = "aut")) | ||
Author: Mohamed Soudy [aut, cre], | ||
Ali Mostafa [aut] | ||
Maintainer: Mohamed Soudy <MohmedSoudy2009@gmail.com> | ||
Description: Connect to Uniprot <https://www.uniprot.org/> to retrieve information about proteins using their accession number such information could be name or taxonomy information, For detailed information kindly read the publication <https://www.sciencedirect.com/science/article/pii/S1874391919303859>. | ||
License: GPL-3 | ||
Encoding: UTF-8 | ||
RoxygenNote: 7.1.1 | ||
RoxygenNote: 7.1.2 | ||
Imports: utils , grDevices , stats , grid , graphics , httr , plyr , | ||
dplyr , scales , magrittr , magick , data.tree , ggplot2 , | ||
tidyverse , gridExtra , ggpubr , curl, networkD3, | ||
stringr , qdapRegex , htmlwidgets , alakazam (>= 1.0.0), gprofiler2, progress | ||
tidyverse , gridExtra , ggpubr , curl, networkD3, stringr , | ||
qdapRegex , htmlwidgets , alakazam (>= 1.0.0), gprofiler2, | ||
progress, ggsci | ||
URL: https://github.com/Proteomicslab57357/UniprotR | ||
BugReports: https://github.com/Proteomicslab57357/UniprotR/issues | ||
NeedsCompilation: no | ||
Packaged: 2021-04-06 10:17:45 UTC; RSH | ||
Packaged: 2021-09-22 14:25:38 UTC; RSH | ||
Repository: CRAN | ||
Date/Publication: 2020-07-26 13:20:05 UTC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#' Connect and parse UniProt information | ||
#' | ||
#' This function is used to generate a combined plot for the enriched Gene Ontology terms | ||
#' | ||
#' @usage PlotEnrichedGO(Accs,OS="hsapiens",p_value=0.05,Path=NULL,theme="aaas",width=7,height=7) | ||
#' | ||
#' @param Accs Vector of UniProt Accession/s or genes | ||
#' | ||
#' @param OS organism name Example: human - 'hsapiens', mouse - 'mmusculus' | ||
#' | ||
#' @param p_value custom p-value threshold for significance, default = 0.05 | ||
#' | ||
#' @param theme optional parameter to generate specific theme for journals ex: "aaas", "nature", "lancet", "jama" | ||
#' | ||
#' @param Path Path to save output plot | ||
#' | ||
#' @param width width of the generated plot | ||
#' | ||
#' @param height height of the generated plot | ||
#' | ||
#' @export | ||
#' | ||
#' @author Mohmed Soudy \email{Mohamed.soudy@57357.com} and Ali Mostafa \email{ali.mo.anwar@std.agr.cu.edu.eg} | ||
#' | ||
PlotEnrichedGO <- function(Accs,OS="hsapiens",p_value=0.05,Path=NULL,theme="aaas",width=7,height= 7) | ||
{ | ||
Enr.data <- gost(Accs) | ||
|
||
Enr.frame <- Enr.data$result | ||
|
||
GOs <- Enr.frame[Enr.frame$source %in% c("GO:BP", "GO:CC", "GO:MF"),] | ||
GOs$`-log10 (p)` <- -log10(GOs$p_value) | ||
|
||
P <- ggbarplot(GOs, x = "term_name", y = "-log10 (p)", | ||
fill = "source", | ||
color = "white", | ||
palette = "jco", | ||
sort.val = "asc", | ||
sort.by.groups = TRUE, | ||
x.text.angle = 90 | ||
) | ||
if (tolower(theme) == "aaas") | ||
P <- P + scale_fill_aaas() + xlab("") + coord_flip() | ||
if (tolower(theme) == "lancet") | ||
P <- P + scale_fill_lancet() + xlab("") + coord_flip() | ||
if (tolower(theme) == "jama") | ||
P <- P + scale_fill_jama() + xlab("") + coord_flip() | ||
if (tolower(theme) == "nature") | ||
P <- P + scale_fill_nejm() + xlab("") + coord_flip() | ||
|
||
if (!is.null(Path)) | ||
{ | ||
if (dim(GOs)[1] < 50) | ||
ggsave(path = Path, filename = "Significant GOs.jpeg", plot = P,width = width, height = height, dpi = 300) | ||
if (dim(GOs)[1] > 50) | ||
ggsave(path = Path, filename = "Significant GO.jppeg", plot = P,width = width, height =height, dpi = 300) | ||
} | ||
plot(P) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#' Connect and parse UniProt information | ||
#' | ||
#' This function is used to generate a combined plot for the enriched pathways from KEGG and REACTOME | ||
#' | ||
#' @usage PlotEnrichedPathways(Accs,OS="hsapiens",p_value=0.05,Path=NULL,theme="aaas",w=w,h=h) | ||
#' | ||
#' @param Accs Vector of UniProt Accession/s or genes | ||
#' | ||
#' @param OS organism name Example: human - 'hsapiens', mouse - 'mmusculus' | ||
#' | ||
#' @param p_value custom p-value threshold for significance, default = 0.05 | ||
#' | ||
#' @param theme optional parameter to generate specific theme for journals ex: "aaas", "nature", "lancet", "jama" | ||
#' | ||
#' @param Path Path to save output plot | ||
#' | ||
#' @param w width of the generated plot | ||
#' | ||
#' @param h height of the generated plot | ||
#' | ||
#' @export | ||
#' | ||
#' @author Mohmed Soudy \email{Mohamed.soudy@57357.com} and Ali Mostafa \email{ali.mo.anwar@std.agr.cu.edu.eg} | ||
#' | ||
PlotEnrichedPathways <- function(Accs,OS="hsapiens",p_value=0.05,Path=NULL,theme="aaas",w=w,h=h) | ||
{ | ||
Enr.data <- gost(Accs) | ||
|
||
Enr.frame <- Enr.data$result | ||
|
||
Pathways <- Enr.frame[Enr.frame$source %in% c("KEGG", "REAC"),] | ||
Pathways$`-log10 (p)` <- -log10(Pathways$p_value) | ||
|
||
P <- ggbarplot(Pathways, x = "term_name", y = "-log10 (p)", | ||
fill = "source", | ||
color = "white", | ||
palette = "jco", | ||
sort.val = "asc", | ||
sort.by.groups = TRUE, | ||
x.text.angle = 90 | ||
) | ||
if (tolower(theme) == "aaas") | ||
P <- P + scale_fill_aaas() + xlab("") + coord_flip() | ||
if (tolower(theme) == "lancet") | ||
P <- P + scale_fill_lancet() + xlab("") + coord_flip() | ||
if (tolower(theme) == "jama") | ||
P <- P + scale_fill_jama() + xlab("") + coord_flip() | ||
if (tolower(theme) == "nature") | ||
P <- P + scale_fill_nejm() + xlab("") + coord_flip() | ||
|
||
if (!is.null(Path)) | ||
{ | ||
if (dim(Pathways)[1] < 50) | ||
ggsave(path = Path, filename = "Significant Pathways.jpeg", plot = P,width = w, height = h, dpi = 300) | ||
if (dim(Pathways)[1] > 50) | ||
ggsave(path = Path, filename = "Significant Pathways.jpeg", plot = P,width = w, height = h, dpi = 300) | ||
} | ||
plot(P) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#' Connect and parse UniProt information. | ||
#' | ||
#' This Function is used to plot the retrieved Gene Ontology from function 'GetProteinGOInfo'. | ||
#' | ||
#' @usage PlotGOAll(GOObj, Top = 10, directorypath = NULL, width = width, height = height) | ||
#' | ||
#' @param GOObj Dataframe returned from UniprotR Function "GetProteinGOInfo" | ||
#' | ||
#' @param Top Number of molecular functions to be visualized | ||
#' | ||
#' @param directorypath path to save Output plot. | ||
#' | ||
#' @param width width of the generated plot | ||
#' | ||
#' @param height height of the generated plot | ||
#' | ||
#' @author Mohmed Soudy \email{Mohamed.soudy@57357.com} and Ali Mostafa \email{ali.mo.anwar@std.agr.cu.edu.eg} | ||
#' | ||
#' @export | ||
#' | ||
PlotGOAll <- function(GOObj, Top = 10, directorypath = NULL, width = width, height = height) | ||
{ | ||
BiologicalDF <- Goparse(GOObj, 3) | ||
if (dim(BiologicalDF)[1] < 10) | ||
Top <- dim(BiologicalDF)[1] | ||
BiologicalDF <- BiologicalDF[1:Top, ] | ||
BiologicalDF <- na.omit(BiologicalDF) | ||
BiologicalDF$source <- "BP" | ||
|
||
CellularDF <- Goparse(GOObj, 5) | ||
if (dim(CellularDF)[1] < 10) | ||
Top <- dim(CellularDF)[1] | ||
CellularDF <- CellularDF[1:Top, ] | ||
CellularDF <- na.omit(CellularDF) | ||
CellularDF$source <- "CC" | ||
|
||
|
||
MolecularDF <- Goparse(GOObj, 4) | ||
if (dim(MolecularDF)[1] < 10) | ||
Top <- dim(MolecularDF)[1] | ||
MolecularDF <- MolecularDF[1:Top, ] | ||
MolecularDF <- na.omit(MolecularDF) | ||
MolecularDF$source <- "MF" | ||
|
||
GO.terms <- rbind(BiologicalDF, CellularDF) | ||
GO.terms <- rbind(GO.terms, MolecularDF) | ||
|
||
P <- ggbarplot(GO.terms, x = "Goterm", y = "Count", | ||
fill = "source", | ||
color = "white", | ||
palette = "jco", | ||
sort.val = "asc", | ||
sort.by.groups = TRUE, | ||
x.text.angle = 90 | ||
) | ||
P <- P + scale_fill_lancet() + coord_flip() | ||
if(!is.null(directorypath)) | ||
{ | ||
ggsave(plot = P, filename = paste0(directorypath, "/", "GO All.jpeg"), device = "jpeg", width = width, height = height) | ||
} | ||
plot(P) | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.