Skip to content

Commit

Permalink
version 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
phoeguo committed Mar 24, 2019
1 parent 606cd57 commit 297a80a
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 49 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ inst/doc
.RData
.Ruserdata
packrat/lib*/
data-raw/temp/
data-raw/
R/temp/
inst/backup/
inst/extdata/backup/
Expand Down
16 changes: 8 additions & 8 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
Package: g3lollipop
Package: g3viz
Type: Package
Title: Visualize Genomic Mutation Data via an Interactive Lollipop Diagram
Version: 0.3
Title: Visualize Genomic Mutation Data using a Rich Interactive Lollipop Diagram
Version: 1.0.0
Authors@R: c(
person("Xin", "Guo", email = "[email protected]", role = c("aut", "cre"))
)
Maintainer: Xin Guo <[email protected]>
Description: R interface for 'g3viz' JavaScript library.
Visualize Genomic Mutation Data Using a rich interactive lollipop diagram in Rstudio or your browser.
Description: R interface for 'g3lollipop' JavaScript library.
Visualize genomic mutation data Using a rich interactive lollipop diagram in Rstudio or your browser.
License: MIT + file LICENSE
Encoding: UTF-8
LazyData: true
Depends:
R (>= 3.0.2)
R (>= 3.0.0)
Imports:
jsonlite,
cgdsr,
Expand All @@ -22,7 +22,7 @@ Suggests:
shiny (>= 1.0.0),
knitr,
rmarkdown
URL: https://github.com/G3viz/g3lollipop
BugReports: https://github.com/G3viz/g3lollipop/issues
URL: https://github.com/G3viz/g3viz
BugReports: https://github.com/G3viz/g3viz/issues
RoxygenNote: 6.1.1
VignetteBuilder: knitr
31 changes: 22 additions & 9 deletions R/getMutationsFromCbioportal.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,29 @@
#' @param gene.symbol HGNC gene symbol.
#' @param output.file if specified, output to a file in \emph{CSV} format. Default is \code{NA}.
#' @param mutation.type.to.class.df mapping table from mutation type to class.
#' @param cgds.url the URL for the public CGDS server, refer to
#' @param test.cbioportal test CGDS connection
#' See \code{\link{mapMutationTypeToMutationClass}} for details.
#' Default \code{NA}, which indicates to use default mappings.
#' @param cgds.url the URL for the public CGDS server (Cancer Genomic Data Server).
#' Default is \url{http://www.cbioportal.org/}.
#' Check \href{https://cran.r-project.org/web/packages/cgdsr/}{cgdsr} package for details.
#' @param test.cgds if test CGDS connection. Default is \code{FALSE}
#' @examples
#' \dontrun{
#' # Note: internet access required. May need more than 10 seconds.
#' # list all studies of cBioPortal
#' # Usage:
#' # Connection to CGDS (Cange Genomic Data Server). Internet access required.
#' # Note: this may need more than 10 seconds, and sometimes it may fail.
#' library(cgdsr)
#' cgds <- CGDS("http://www.cbioportal.org/")
#'
#' # test if connection is OK (warning: sometimes it may fail)
#' test(cgds)
#'
#' # list all studies of cBioPortal
#' all.studies <- getCancerStudies(cgds)
#'
#' # pick a "caner_study_id" (contain a mutation data set)
#' # pick a primary HGNC gene symbol to query
#' # First, select a cancer study that contains mutation data set ("caner_study_id")
#' # then, query genomic mutation data using a HGNC gene symbol,
#' # for example
#' mutation.dat <- getMutationsFromCbioportal("msk_impact_2017", "TP53")
#' mutation.dat <- getMutationsFromCbioportal("all_stjude_2016", "TP53")
#' }
Expand All @@ -47,16 +54,22 @@ getMutationsFromCbioportal <- function(study.id,
gene.symbol,
output.file = NA,
mutation.type.to.class.df = NA,
cbioportal.url = "http://www.cbioportal.org/",
test.cbioportal = FALSE){
cgds.url = "http://www.cbioportal.org/",
test.cgds = FALSE){
# =============================
# define mutation columns
aa.pos.col <- "AA_Position"
mutation.class.col <- "Mutation_Class"

# ========================
# cgds server
cgds <- CGDS("http://www.cbioportal.org/public-portal/")
cgds <- cgdsr::CGDS(cgds.url)

# ========================
# test cgds
if(test.cgds){
cgdsr::test(cgds)
}

# ========================
# get study information
Expand Down
47 changes: 24 additions & 23 deletions R/mapMutationTypeToMutationClass.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,35 +17,38 @@
#' }
#' \item Truncating
#' \itemize{
#' \item \emph{Frame_Shift_Ins} --- insertion that moves the coding sequence out of frame.
#' \item \emph{Frame_Shift} --- moves the coding sequence out of frame.
#' However, insertion or deletion can not be determined.
#' See \url{https://en.wikipedia.org/wiki/Frameshift_mutation}.
#' \item \emph{Frame_Shift_Del} --- deletion that moves the coding sequence out of frame.
#' \item \emph{Frame_Shift_Ins} --- an insertion that moves the coding sequence out of frame.
#' See \url{https://en.wikipedia.org/wiki/Frameshift_mutation}.
#' \item \emph{Nonsense_Mutation} --- a premature stop codon is created by the variant.
#' \item \emph{Frame_Shift_Del} --- a deletion that moves the coding sequence out of frame.
#' See \url{https://en.wikipedia.org/wiki/Frameshift_mutation}.
#' \item \emph{Nonsense_Mutation} --- a premature stop codon that is created by the variant.
#' See \url{https://en.wikipedia.org/wiki/Nonsense_mutation}.
#' \item \emph{Nonstop_Mutation} --- variant removes stop codon.
#' \item \emph{Splice_Site} --- the variant is within two bases of a splice site.
#' \item \emph{Splice_Region} --- the variant is within splice region.
#' \item \emph{Nonstop_Mutation} --- a variant that removes stop codon.
#' \item \emph{Splice_Site} --- a variant that is within two bases of a splice site.
#' \item \emph{Splice_Region} --- a variant that is within splice region.
#' }
#' \item Other
#' \itemize{
#' \item \emph{5'UTR} --- variant is on the 5'UTR for the chosen transcript
#' \item \emph{3'UTR} --- variant is on the 3'UTR for the chosen transcript
#' \item \emph{5'Flank} --- the variant is upstream of the chosen transcript (within 3kb)
#' \item \emph{3'Flank} --- the variant is downstream of the chosen transcript (within 3kb)
#' \item \emph{Fusion} --- gene fusion
#' \item \emph{IGR} --- intergenic region. Does not overlap any transcript.
#' \item \emph{Intron} --- variant lies between exons within the bounds of the chosen transcript.
#' \item \emph{Translation_Start_Site} --- variant in translation start site.
#' \item \emph{De_novo_Start_InFrame} --- New start codon is created by the given variant using the chosen transcript.
#' \item \emph{5'UTR} --- a variant that is on the 5'UTR for the chosen transcript.
#' \item \emph{3'UTR} --- a variant that is on the 3'UTR for the chosen transcript.
#' \item \emph{5'Flank} --- a variant that is upstream of the chosen transcript (generally within 3kb).
#' \item \emph{3'Flank} --- a variant that is downstream of the chosen transcript (generally within 3kb).
#' \item \emph{Fusion} --- a gene fusion.
#' \item \emph{IGR} --- an intergenic region. Does not overlap any transcript.
#' \item \emph{Intron} --- a variant that lies between exons within the bounds of the chosen transcript.
#' \item \emph{Translation_Start_Site} --- a variant that is in translation start site.
#' \item \emph{De_novo_Start_InFrame} --- a novel start codon that is created by the given variant using the chosen transcript.
#' However, it is in frame relative to the coded protein.
#' \item \emph{De_novo_Start_OutOfFrame} --- New start codon is created by the given variant using the chosen transcript.
#' \item \emph{De_novo_Start_OutOfFrame} --- a novel start codon that is created by the given variant using the chosen transcript.
#' However, it is out of frame relative to the coded protein.
#' \item \emph{Start_Codon_SNP} --- point mutation that overlaps the start codon.
#' \item \emph{Start_Codon_Ins} --- insertion that overlaps the start codon.
#' \item \emph{Start_Codon_Del} --- selection that overlaps the start codon.
#' \item \emph{RNA} --- variant lies on one of the RNA transcripts.
#' \item \emph{lincRNA} --- variant lies on one of the lincRNAs.
#' \item \emph{Start_Codon_SNP} --- a point mutation that overlaps the start codon.
#' \item \emph{Start_Codon_Ins} --- an insertion that overlaps the start codon.
#' \item \emph{Start_Codon_Del} --- a deletion that overlaps the start codon.
#' \item \emph{RNA} --- a variant that lies on one of the RNA transcripts.
#' \item \emph{lincRNA} --- a variant that lies on one of the lincRNAs.
#' \item \emph{Unknown} --- Unknown
#' }
#' }
Expand Down Expand Up @@ -83,5 +86,3 @@ mapMutationTypeToMutationClass <- function(mutation.type.vec,
mutation.class.vec <- Map.df[match(mutation.type.vec, Map.df$Mutation_Type), "Mutation_Class"]
mutation.class.vec
}


1 change: 0 additions & 1 deletion data-raw/g3viz-package.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.onLoad <- function(libname, pkgname){
packageStartupMessage("G3viz: visualize gene/genome/genetics.")
# data(list = c("hgnc2pfam.df", "mutation.table.df"), package = pkgname, envir = parent.env(enviroment()))
}
2 changes: 1 addition & 1 deletion g3viz.Rproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ StripTrailingWhitespace: Yes
BuildType: Package
PackageUseDevtools: Yes
PackageInstallArgs: --no-multiarch --with-keep.source
PackageRoxygenize: rd,collate,namespace
PackageRoxygenize: rd,collate,namespace,vignette
26 changes: 20 additions & 6 deletions man/getMutationsFromCbioportal.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 297a80a

Please sign in to comment.