-
Notifications
You must be signed in to change notification settings - Fork 19
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
Showing
28 changed files
with
3,877 additions
and
67 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,7 +1,7 @@ | ||
Package: g3viz | ||
Type: Package | ||
Title: Interactively Visualize Genetic Mutation Data using a Lollipop-Diagram | ||
Version: 1.1.2 | ||
Version: 1.1.3 | ||
Authors@R: c( | ||
person("Xin", "Guo", email = "[email protected]", role = c("aut", "cre")) | ||
) | ||
|
@@ -25,5 +25,5 @@ Suggests: | |
kableExtra | ||
URL: https://github.com/G3viz/g3viz | ||
BugReports: https://github.com/G3viz/g3viz/issues | ||
RoxygenNote: 6.1.1 | ||
RoxygenNote: 7.1.1 | ||
VignetteBuilder: knitr |
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,84 @@ | ||
#' Map from Hugo symbol to Pfam domains | ||
#' | ||
#' @description Mapping from Hugo symbol to Pfam-A domain composition. | ||
#' If the given Hugo symbol has multiple UniProt ID mappings, | ||
#' and \code{guess == TRUE}, | ||
#' the longest UniProt protein is selected. Return is either a list of a JSON. | ||
#' @examples | ||
#' # general usage | ||
#' hgnc2pfam("TP53") | ||
#' hgnc2pfam("TP53", output.format = "json") | ||
#' hgnc2pfam("TP53", output.format = "list") | ||
#' hgnc2pfam("TP53", output.format = "json", uniprot.id = "P04637") # OK | ||
#' | ||
#' # for gene mapping to multiple UniProt enties | ||
#' hgnc2pfam("GNAS", guess = TRUE) | ||
#' hgnc2pfam("GNAS", guess = FALSE) | ||
#' hgnc2pfam("GNAS", output.format = "list") | ||
#' hgnc2pfam("GNAS", output.format = "list", uniprot.id = "P84996") | ||
#' \dontrun{ | ||
#' hgnc2pfam("GNAS", output.format = "list", uniprot.id = "P84997") # not exists, returns FALSE | ||
#' } | ||
#' | ||
#' hgnc2pfam("PRAMEF9", output.format = "list") # no Pfam mappings | ||
#' | ||
#' @param hgnc.symbol primary Hugo symbol | ||
#' @param output.format output format: JSON or list | ||
#' @param uniprot.id UniProt ID, in case that gene symbol maps to multiple UniProt entries. | ||
#' @param guess if the given Hugo symbol links to multiple UniProt IDs, | ||
#' choose the longest one (\code{guess == TRUE}); | ||
#' otherwise \code{NA} (\code{guess == FALSE}). Default \code{TRUE}. | ||
#' @return A list or a JSON with attributes: | ||
#' \emph{symbol}, \emph{uniprot}, \emph{length}, and a list of \emph{Pfam} entries, including | ||
#' \emph{hmm.acc}, \emph{hmm.name}, \emph{start}, \emph{end}, and \emph{type}. | ||
#' | ||
#' @importFrom utils capture.output | ||
#' @importFrom jsonlite toJSON | ||
#' @export | ||
proteinDomain <- function(protein.length, | ||
domain.df, | ||
domain.name.col = "Name", | ||
domain.start.col = "Start", | ||
domain.end.col = "End"){ | ||
|
||
if(is.na(protein.length)){ | ||
stop("Please provide the length of protein") | ||
} | ||
|
||
if(!domain.name.col %in% colnames(domain.df)){ | ||
stop("domain.name.col ", domain.name.col, " not exists") | ||
} | ||
if(!domain.start.col %in% colnames(domain.df)){ | ||
stop("domain.start.col ", domain.start.col, " not exists") | ||
} | ||
if(!domain.end.col %in% colnames(domain.df)){ | ||
stop("domain.end.col ", domain.end.col, " not exists") | ||
} | ||
|
||
#-- | ||
protein.length <- 393 | ||
domain.fn = "data-raw/TP53_P04637_interpro.csv" | ||
domain.df = read.csv(domain.fn) | ||
domain.name.col = "Name" | ||
domain.start.col = "Start" | ||
domain.end.col = "End" | ||
#-- | ||
|
||
|
||
|
||
domain.list <- list( | ||
length = protein.length, | ||
details = domain.list | ||
) | ||
|
||
# domain data format | ||
domain.default.format <- list( | ||
length = "length", | ||
details = list( | ||
start = "start", | ||
end = "end", | ||
name = "name" | ||
) | ||
) | ||
|
||
} |
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,3 +1,3 @@ | ||
.onAttach <- function(libname, pkgname){ | ||
packageStartupMessage("g3viz: visualizing gene/genome/gentics data for fun.\nAny questions, please send emails to <[email protected]>") | ||
packageStartupMessage("g3viz: visualizing gene/genome/gentics data for fun.\nAny questions, please send emails to <[email protected]> or post on GitHub <https://github.com/G3viz/g3viz/issues>.") | ||
} |
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
Binary file not shown.
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,23 @@ | ||
library(g3viz) | ||
|
||
#maf.file <- system.file("extdata", "TCGA.BRCA.varscan.somatic.maf.gz", package = "g3viz") | ||
#mutation.dat <- readMAF(maf.file) | ||
|
||
|
||
domain.fn <- "data-raw/TP53_P04637_interpro.csv" | ||
domain.df <- read.csv(domain.fn) | ||
|
||
Start.col = "Start" | ||
End.col = "End" | ||
Domain.ID = "Name" | ||
|
||
all(c(Start.col, End.col, Domain.ID) %in% colnames(domain.df)) | ||
|
||
hgnc2pfam("TP53", output.format = "list") | ||
|
||
library(biomaRt) | ||
|
||
# select human ensembl | ||
ensembl = useMart("ensembl",dataset="hsapiens_gene_ensembl") | ||
|
||
# |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.