Title: | Interactive Multi-Omics Cancers Data Visualization and Analysis |
---|---|
Description: | This package is a Shiny App to visualize and analyse interactively Multi-Assays of Cancer Genomic Data. |
Authors: | Karim Mezhoud [aut, cre] |
Maintainer: | Karim Mezhoud <[email protected]> |
License: | AGPL-3 | file LICENSE |
Version: | 1.35.0 |
Built: | 2024-11-29 04:17:02 UTC |
Source: | https://github.com/bioc/bioCancer |
Does not escape strings, but raises an error if any character expect normal letters and underscores are found in the string.
.dbEscapeString(str, raise.error = TRUE)
.dbEscapeString(str, raise.error = TRUE)
str |
String to test |
raise.error |
Logical, whether to raise an error or not. |
Invisible logical
Gets the table name from the INPARANOID style genus names.
.getTableName(genus)
.getTableName(genus)
genus |
5 character INPARANOID genus name, such as "BOSTA", "HOMSA" or "MUSMU". |
Table name for genus.
Stefan McKinnon Edwards [email protected]
https://www.bioconductor.org/packages/release/bioc/html/AnnotationDbi.html
Do not use it, use pickRefSeq
!
.pickRef(l, priorities, reduce = c("all", "first", "last"))
.pickRef(l, priorities, reduce = c("all", "first", "last"))
l |
List. |
priorities |
How to prioritize. |
reduce |
How to reduce. |
List.
Hey, you found a secret function! Keep it that way!
Stefan McKinnon Edwards [email protected]
Package: | AnnotationFuncs |
Type: | Package |
Version: | 1.3.0 |
Date: | 2011-06-10 |
License: | GPL-2 |
LazyLoad: | yes |
Functions for handling translations between different identifieres using
the Biocore Data Team data-packages (e.g. org.Bt.eg.db
).
Primary functions are translate
for translating
and getOrthologs
for efficient lookup of homologes
using the Inparanoid databases.
Other functions include functions for selecting Refseqs or Gene Ontologies (GO).
Stefan McKinnon Edwards [email protected]
https://www.iysik.com/index.php?page=annotation-functions
library(org.Bt.eg.db) gene.symbols <- c('DRBP1','SERPINA1','FAKE','BLABLA') # Find entrez identifiers of these genes. eg <- translate(gene.symbols, org.Bt.egSYMBOL2EG) # Note that not all symbols were translated. # Go directly to Refseq identifiers. refseq <- translate(gene.symbols, from=org.Bt.egSYMBOL2EG, to=org.Bt.egREFSEQ) # Pick the proteins: pickRefSeq(refseq, priorities=c('NP','XP'), reduce='all')
library(org.Bt.eg.db) gene.symbols <- c('DRBP1','SERPINA1','FAKE','BLABLA') # Find entrez identifiers of these genes. eg <- translate(gene.symbols, org.Bt.egSYMBOL2EG) # Note that not all symbols were translated. # Go directly to Refseq identifiers. refseq <- translate(gene.symbols, from=org.Bt.egSYMBOL2EG, to=org.Bt.egREFSEQ) # Pick the proteins: pickRefSeq(refseq, priorities=c('NP','XP'), reduce='all')
Attribute Color to Gene
attriColorGene(df)
attriColorGene(df)
df |
data frame with mRNA or CNA or mutation frequency or methylation (numeric). Without sampleID column. |
A list colors for every gene
cgds <- cBioPortal( hostname = "www.cbioportal.org", protocol = "https", api = "/api/v2/api-docs" ) ## Not run: getDataByGenes( api = cgds, studyId = "gbm_tcga_pub", genes = c("NF1", "TP53", "ABL1"), by = "hugoGeneSymbol", molecularProfileIds = "gbm_tcga_pub_mrna" ) ## End(Not run)
cgds <- cBioPortal( hostname = "www.cbioportal.org", protocol = "https", api = "/api/v2/api-docs" ) ## Not run: getDataByGenes( api = cgds, studyId = "gbm_tcga_pub", genes = c("NF1", "TP53", "ABL1"), by = "hugoGeneSymbol", molecularProfileIds = "gbm_tcga_pub_mrna" ) ## End(Not run)
Attribute Color to Value
attriColorValue(Value, df, colors=c(a,b,c),feet)
attriColorValue(Value, df, colors=c(a,b,c),feet)
Value |
integer |
df |
data frame with numeric values |
colors |
a vector of 5 colors |
feet |
the interval between two successive colors in the palette (0.1) |
Hex Color Code
cgds <- cBioPortal( hostname = "www.cbioportal.org", protocol = "https", api = "/api/v2/api-docs" ) ## Not run: getDataByGenes( api = cgds, studyId = "gbm_tcga_pub", genes = c("NF1", "TP53", "ABL1"), by = "hugoGeneSymbol", molecularProfileIds = "gbm_tcga_pub_mrna" ) ## End(Not run)
cgds <- cBioPortal( hostname = "www.cbioportal.org", protocol = "https", api = "/api/v2/api-docs" ) ## Not run: getDataByGenes( api = cgds, studyId = "gbm_tcga_pub", genes = c("NF1", "TP53", "ABL1"), by = "hugoGeneSymbol", molecularProfileIds = "gbm_tcga_pub_mrna" ) ## End(Not run)
Attribute color to a vector of numeric values
attriColorVector(Value, vector, colors=c(a,b,c),feet)
attriColorVector(Value, vector, colors=c(a,b,c),feet)
Value |
numeric |
vector |
A vector of numeric data |
colors |
3 colors |
feet |
An interval between two numeric value needed to change the color |
A vetor of colors
cgds <- cBioPortal( hostname = "www.cbioportal.org", protocol = "https", api = "/api/v2/api-docs" ) ## Not run: getDataByGenes( api = cgds, studyId = "gbm_tcga_pub", genes = c("NF1", "TP53", "ABL1"), by = "hugoGeneSymbol", molecularProfileIds = "gbm_tcga_pub_mrna" ) ## End(Not run)
cgds <- cBioPortal( hostname = "www.cbioportal.org", protocol = "https", api = "/api/v2/api-docs" ) ## Not run: getDataByGenes( api = cgds, studyId = "gbm_tcga_pub", genes = c("NF1", "TP53", "ABL1"), by = "hugoGeneSymbol", molecularProfileIds = "gbm_tcga_pub_mrna" ) ## End(Not run)
Attribute shape to nodes
attriShape2Gene(gene, genelist)
attriShape2Gene(gene, genelist)
gene |
Gene symbol |
genelist |
Gene list |
A character "BRCA1[shape = 'circle', "
how <- "runManually" ## Not run: GeneList <- whichGeneList("73") attriShape2Gene("P53", GeneList) attriShape2Gene("GML",GeneList) ## End(Not run)
how <- "runManually" ## Not run: GeneList <- whichGeneList("73") attriShape2Gene("P53", GeneList) attriShape2Gene("GML",GeneList) ## End(Not run)
Attributes shape to Nodes
attriShape2Node(gene, genelist)
attriShape2Node(gene, genelist)
gene |
symbol "TP53" |
genelist |
a vector of gene symbol |
A data frame with egdes attributes
GeneList <- c("DKK3" , "NBN" , "MYO6" , "TP53" , "PML" , "IFI16" ,"BRCA1") NodeShape <- attriShape2Gene("DKK3", GeneList)
GeneList <- c("DKK3" , "NBN" , "MYO6" , "TP53" , "PML" , "IFI16" ,"BRCA1") NodeShape <- attriShape2Gene("DKK3", GeneList)
The Main function to run bioCancer App
bioCancer()
bioCancer()
web page of bioCancer Shiny App
ShinyApp <- 1 ## Not run: bioCancer() ## End(Not run)
ShinyApp <- 1 ## Not run: bioCancer() ## End(Not run)
Creates a CGDS connection object from a CGDS endpoint URL. This object must be passed on to the methods which query the server.
CGDS(url,verbose=FALSE,ploterrormsg='',token=NULL)
CGDS(url,verbose=FALSE,ploterrormsg='',token=NULL)
url |
A CGDS URL (required). |
verbose |
A boolean variable specifying verbose output (default FALSE) |
ploterrormsg |
An optional message to display in plots if an error occurs (default ”) |
token |
An optional 'Authorization: Bearer' token to connect to cBioPortal instances that require authentication (default NULL) |
Check wich Cases and genetic profiles are available for selected study
checkDimensions(StudyID)
checkDimensions(StudyID)
StudyID |
Study reference using cBioPortal index |
A data frame with two column (Cases, Genetic profiles). Every row has a dimension (CNA, mRNA...). The data frame is filled with yes/no response.
cgds <- cBioPortal( hostname = "www.cbioportal.org", protocol = "https", api = "/api/v2/api-docs" ) ## Not run: getDataByGenes( api = cgds, studyId = "gbm_tcga_pub", genes = c("NF1", "TP53", "ABL1"), by = "hugoGeneSymbol", molecularProfileIds = "gbm_tcga_pub_mrna" ) ## End(Not run)
cgds <- cBioPortal( hostname = "www.cbioportal.org", protocol = "https", api = "/api/v2/api-docs" ) ## Not run: getDataByGenes( api = cgds, studyId = "gbm_tcga_pub", genes = c("NF1", "TP53", "ABL1"), by = "hugoGeneSymbol", molecularProfileIds = "gbm_tcga_pub_mrna" ) ## End(Not run)
This is an htmlwidgets-based visualization tool for hierarchical data. It is zoomable, meaning that you can interact with the hierarchy and zoom in/out accordingly.
coffeewheel(treeData, width=600, height=600, main="", partitionAttribute="value")
coffeewheel(treeData, width=600, height=600, main="", partitionAttribute="value")
treeData |
A hierarchical tree data as in example |
width |
600 |
height |
600 |
main |
Title |
partitionAttribute |
"value" |
A circular layout with genetic profile.
How <- "runManually" ## Not run: coffeewheel(treeData = sampleWheelData) ## End(Not run)
How <- "runManually" ## Not run: coffeewheel(treeData = sampleWheelData) ## End(Not run)
Widget output function for use in Shiny
coffeewheelOutput(outputId, width=700, height=700)
coffeewheelOutput(outputId, width=700, height=700)
outputId |
id |
width |
700 |
height |
700 |
A circular layout with genetic profile in Shiny App.
How <- "runManually" ## Not run: coffeewheel(treeData = sampleWheelData) ## End(Not run)
How <- "runManually" ## Not run: coffeewheel(treeData = sampleWheelData) ## End(Not run)
Display dataframe in table using DT package
displayTable(df)
displayTable(df)
df |
a dataframe |
A table
cgds <- cBioPortal( hostname = "www.cbioportal.org", protocol = "https", api = "/api/v2/api-docs" ) ## Not run: getDataByGenes( api = cgds, studyId = "gbm_tcga_pub", genes = c("NF1", "TP53", "ABL1"), by = "hugoGeneSymbol", molecularProfileIds = "gbm_tcga_pub_mrna" ) ## End(Not run)
cgds <- cBioPortal( hostname = "www.cbioportal.org", protocol = "https", api = "/api/v2/api-docs" ) ## Not run: getDataByGenes( api = cgds, studyId = "gbm_tcga_pub", genes = c("NF1", "TP53", "ABL1"), by = "hugoGeneSymbol", molecularProfileIds = "gbm_tcga_pub_mrna" ) ## End(Not run)
get Edges dataframe for Gene/Disease association from geNetClassifier
Edges_Diseases_obj(genesclassdetails)
Edges_Diseases_obj(genesclassdetails)
genesclassdetails |
a dataframe from geNetClassifier |
A data frame with egdes attributes
GenesClassDetails <- structure(list(Genes = c("FANCF", "MLH1", "MSH2", "ATR", "PARP1", "CHEK2", "RAD51"), ranking = c(1L, 1L, 1L, 2L, 3L, 1L, 2L), class = c("brca_tcga", "gbm_tcga", "lihc_tcga", "lihc_tcga", "lihc_tcga", "lusc_tcga", "lusc_tcga"), postProb = c(1, 0.99, 1, 0.99, 0.99, 1, 0.98), exprsMeanDiff = c(180, 256, -373, -268, -1482, 258, 143), exprsUpDw = c("UP", "UP", "DOWN", "DOWN", "DOWN", "UP", "UP")), .Names = c("Genes", "ranking", "class", "postProb", "exprsMeanDiff", "exprsUpDw"), class = "data.frame", row.names = c(NA,-7L)) Ed_Diseases_obj <- Edges_Diseases_obj(genesclassdetails=GenesClassDetails)
GenesClassDetails <- structure(list(Genes = c("FANCF", "MLH1", "MSH2", "ATR", "PARP1", "CHEK2", "RAD51"), ranking = c(1L, 1L, 1L, 2L, 3L, 1L, 2L), class = c("brca_tcga", "gbm_tcga", "lihc_tcga", "lihc_tcga", "lihc_tcga", "lusc_tcga", "lusc_tcga"), postProb = c(1, 0.99, 1, 0.99, 0.99, 1, 0.98), exprsMeanDiff = c(180, 256, -373, -268, -1482, 258, 143), exprsUpDw = c("UP", "UP", "DOWN", "DOWN", "DOWN", "UP", "UP")), .Names = c("Genes", "ranking", "class", "postProb", "exprsMeanDiff", "exprsUpDw"), class = "data.frame", row.names = c(NA,-7L)) Ed_Diseases_obj <- Edges_Diseases_obj(genesclassdetails=GenesClassDetails)
Default dataset of bioCancer
epiGenomics
epiGenomics
An object of class data.frame
with 48 rows and 7 columns.
Karim Mezhoud [email protected]
Check if PhantomJS is installed. Similar to webshot
findPhantom()
findPhantom()
Logic object
How <- "runManually" ## Not run: findPhantom() ## End(Not run)
How <- "runManually" ## Not run: findPhantom() ## End(Not run)
Returns GO evidence codes.
getEvidenceCodes()
getEvidenceCodes()
Matrix of two columns, first column with codes, second column with description of codes.
Stefan McKinnon Edwards [email protected]
?org.Bt.egGO
getEvidenceCodes()
getEvidenceCodes()
get mutation frequency
getFreqMutData(list, geneListLabel)
getFreqMutData(list, geneListLabel)
list |
a list of data frame with mutation data. Each data frame is for one study |
geneListLabel |
file name of geneList examples: "73" |
a data frame with mutation frequency. gene is in rows and study is in column
cgds <- cBioPortal( hostname = "www.cbioportal.org", protocol = "https", api = "/api/v2/api-docs" ) ## Not run: getDataByGenes( api = cgds, studyId = "gbm_tcga_pub", genes = c("NF1", "TP53", "ABL1"), by = "hugoGeneSymbol", molecularProfileIds = "gbm_tcga_pub_mrna" ) ## End(Not run)
cgds <- cBioPortal( hostname = "www.cbioportal.org", protocol = "https", api = "/api/v2/api-docs" ) ## Not run: getDataByGenes( api = cgds, studyId = "gbm_tcga_pub", genes = c("NF1", "TP53", "ABL1"), by = "hugoGeneSymbol", molecularProfileIds = "gbm_tcga_pub_mrna" ) ## End(Not run)
get genes classification
getGenesClassification(checked_Studies, GeneList, samplesize, threshold, listGenProfs, listCases)
getGenesClassification(checked_Studies, GeneList, samplesize, threshold, listGenProfs, listCases)
checked_Studies |
checked studies |
GeneList |
gene list |
samplesize |
sample size |
threshold |
p-value threshold |
listGenProfs |
list of genetic profiles |
listCases |
list of cases |
A table with genes classed by study
cgds <- cBioPortal( hostname = "www.cbioportal.org", protocol = "https", api = "/api/v2/api-docs" ) ## Not run: getDataByGenes( api = cgds, studyId = "gbm_tcga_pub", genes = c("NF1", "TP53", "ABL1"), by = "hugoGeneSymbol", molecularProfileIds = "gbm_tcga_pub_mrna" ) ## End(Not run)
cgds <- cBioPortal( hostname = "www.cbioportal.org", protocol = "https", api = "/api/v2/api-docs" ) ## Not run: getDataByGenes( api = cgds, studyId = "gbm_tcga_pub", genes = c("NF1", "TP53", "ABL1"), by = "hugoGeneSymbol", molecularProfileIds = "gbm_tcga_pub_mrna" ) ## End(Not run)
get list of cases of each selected study in Classifier panel
getList_Cases(checked_Studies)
getList_Cases(checked_Studies)
checked_Studies |
checked studies |
A list of cases
cgds <- cBioPortal( hostname = "www.cbioportal.org", protocol = "https", api = "/api/v2/api-docs" ) ## Not run: getDataByGenes( api = cgds, studyId = "gbm_tcga_pub", genes = c("NF1", "TP53", "ABL1"), by = "hugoGeneSymbol", molecularProfileIds = "gbm_tcga_pub_mrna" ) ## End(Not run)
cgds <- cBioPortal( hostname = "www.cbioportal.org", protocol = "https", api = "/api/v2/api-docs" ) ## Not run: getDataByGenes( api = cgds, studyId = "gbm_tcga_pub", genes = c("NF1", "TP53", "ABL1"), by = "hugoGeneSymbol", molecularProfileIds = "gbm_tcga_pub_mrna" ) ## End(Not run)
get list of genetic profiles of each selected study in Classifier panel
getList_GenProfs(checked_Studies)
getList_GenProfs(checked_Studies)
checked_Studies |
checked studies |
A list of genetics profiles
cgds <- cBioPortal( hostname = "www.cbioportal.org", protocol = "https", api = "/api/v2/api-docs" ) ## Not run: getDataByGenes( api = cgds, studyId = "gbm_tcga_pub", genes = c("NF1", "TP53", "ABL1"), by = "hugoGeneSymbol", molecularProfileIds = "gbm_tcga_pub_mrna" ) ## End(Not run)
cgds <- cBioPortal( hostname = "www.cbioportal.org", protocol = "https", api = "/api/v2/api-docs" ) ## Not run: getDataByGenes( api = cgds, studyId = "gbm_tcga_pub", genes = c("NF1", "TP53", "ABL1"), by = "hugoGeneSymbol", molecularProfileIds = "gbm_tcga_pub_mrna" ) ## End(Not run)
get list of data frame with profiles data (CNA,mRNA, Methylation, Mutation...)
getListProfData(checked_Studies, geneListLabel)
getListProfData(checked_Studies, geneListLabel)
checked_Studies |
checked studies in corresponding panel (input$StudiesIDCircos, input$StudiesIDReactome). |
geneListLabel |
The label of GeneList. There are three cases: "Genes" user gene list, "Reactome_GeneList" GeneList plus genes from reactomeFI "file name" from Examples |
A LIST of profiles data (CNA, mRNA, Methylation, Mutation, miRNA, RPPA). Each dimension content a list of studies.
cgds <- cBioPortal( hostname = "www.cbioportal.org", protocol = "https", api = "/api/v2/api-docs" ) ## Not run: getDataByGenes( api = cgds, studyId = "gbm_tcga_pub", genes = c("NF1", "TP53", "ABL1"), by = "hugoGeneSymbol", molecularProfileIds = "gbm_tcga_pub_mrna" ) ## End(Not run)
cgds <- cBioPortal( hostname = "www.cbioportal.org", protocol = "https", api = "/api/v2/api-docs" ) ## Not run: getDataByGenes( api = cgds, studyId = "gbm_tcga_pub", genes = c("NF1", "TP53", "ABL1"), by = "hugoGeneSymbol", molecularProfileIds = "gbm_tcga_pub_mrna" ) ## End(Not run)
Using the INPARANOID data packages such as hom.Hs.inp.db
is very, very slow and can take up to 11 min (on this particular developers workstation).
This function introduces a new method that can do it in just 20 seconds (on the developers workstation).
In addition, it includes options for translating between different identifers both before and after the mapping.
getOrthologs( values, mapping, genus, threshold = 1, pre.from = NULL, pre.to = NULL, post.from = NULL, post.to = NULL, ... )
getOrthologs( values, mapping, genus, threshold = 1, pre.from = NULL, pre.to = NULL, post.from = NULL, post.to = NULL, ... )
values |
Vector, coerced to character vector, of values needed mapping by homology. |
mapping |
Homology mapping object, such as |
genus |
Character vector. 5 character INPARANOID style genus name of the mapping object, e.g. 'BOSTA' for both |
threshold |
Numeric value between 0 and 1. Only clustered homologues with a parwise score above the threshold is included. The native implementation has this set to 1. |
pre.from |
Mapping object if |
pre.to |
Second part of translation before mapping. |
post.from |
Translate the result from homology mapping to a desired id; just like in |
post.to |
Second part of translation after mapping. |
... |
Additional arguments sent to |
List. Names of list corresponds to values
, except those that could not be mapped nor translated.
Entries are character vectors.
Stefan McKinnon Edwards [email protected]
?hom.Hs.inp.db
- https://inparanoidb.sbc.su.se/
Berglund, A.C., Sjolund, E., Ostlund, G., Sonnhammer, E.L.L. (2008) InParanoid 6: eukaryotic ortholog clusters with inparalogs Nucleic Acids Res. 36:D263–266
O'Brien, K.P., Maido, R., Sonnhammer, E.L.L (2005) Inparanoid: A Comprehensive Database of Eukaryotic Orthologs NAR 33:D476–D480
Remm, M., Storm, C.E.V, Sonnhammer, E.L.L (2001) Automatic clustering of orthologs and in-paralogs from pairwise species comparisons J. Mol. Biol. 314:1041–1052
translate
, .getTableName
, mapLists
tmp <-1
tmp <-1
search and get genetic profiles (CNA,mRNA, Methylation, Mutation...)
getProfData(study,genProf, listGenProf, GeneList, Mut)
getProfData(study,genProf, listGenProf, GeneList, Mut)
study |
Study ID |
genProf |
Genetic Profile id (cancer_study_id_[mutations, cna, methylation, mrna ]). |
listGenProf |
A list of Genetic Profiles for one study. |
GeneList |
A list of genes |
Mut |
Condition to set if the genetic profile is mutation or not (0,1) |
See https://github.com/kmezhoud/bioCancer/wiki
A data frame with Genetic profile
cgds <- cBioPortal( hostname = "www.cbioportal.org", protocol = "https", api = "/api/v2/api-docs" ) ## Not run: getDataByGenes( api = cgds, studyId = "gbm_tcga_pub", genes = c("NF1", "TP53", "ABL1"), by = "hugoGeneSymbol", molecularProfileIds = "gbm_tcga_pub_mrna" ) ## End(Not run)
cgds <- cBioPortal( hostname = "www.cbioportal.org", protocol = "https", api = "/api/v2/api-docs" ) ## Not run: getDataByGenes( api = cgds, studyId = "gbm_tcga_pub", genes = c("NF1", "TP53", "ABL1"), by = "hugoGeneSymbol", molecularProfileIds = "gbm_tcga_pub_mrna" ) ## End(Not run)
get samples size of sequensed genes
getSequensed_SampleSize(StudiesID)
getSequensed_SampleSize(StudiesID)
StudiesID |
Studies ID as a vector |
dataframe with sample size for each selected study.
## Not run: sampleSize <- getSequensed_SampleSize(input$StudiesIDCircos) ## End(Not run)
## Not run: sampleSize <- getSequensed_SampleSize(input$StudiesIDCircos) ## End(Not run)
Combines two lists, A
and B
, such that names(A)
are preserved, mapping to the
values of B
, using names(B)
as look up. Ie. replaces values in A
with values
in B
, using names(B)
as look up for values in A
.
Once more? See examples.
NB! None-mapped entries are returned as NA, but can be removed using removeNAs
.
mapLists(A, B, removeNAs = TRUE)
mapLists(A, B, removeNAs = TRUE)
A |
List, elements are coerced to character for mapping to B. |
B |
List. |
removeNAs |
Boolean, whether to remove the |
List.
Stefan McKinnon Edwards [email protected]
A <- list('a1'='alpha','a2'='beta','a3'=c('gamma','delta')) B <- list('alpha'='b1', 'gamma'=c('b2', 'b3'), 'delta'='b4') mapLists(A, B)
A <- list('a1'='alpha','a2'='beta','a3'=c('gamma','delta')) B <- list('alpha'='b1', 'gamma'=c('b2', 'b3'), 'delta'='b4') mapLists(A, B)
Circular plot of hierarchital data of genetic profile.
metabologram(treeData,width=600,height=600,main="",showLegend=FALSE, legendBreaks=NULL, legendColors=NULL, fontSize=12, legendText="Legend")
metabologram(treeData,width=600,height=600,main="",showLegend=FALSE, legendBreaks=NULL, legendColors=NULL, fontSize=12, legendText="Legend")
treeData |
A hierarchical tree data as in example |
width |
600 |
height |
600 |
main |
Title |
showLegend |
FALSE |
legendBreaks |
NULL |
legendColors |
NULL |
fontSize |
12 |
legendText |
Legend |
A circular layout with genetic profile.
https://github.com/armish/metabologram
How <- "runManually" ## Not run: metabologram(treeData = sampleWheelData, width=600, height=600, main="title", showLegend = TRUE, fontSize = 10, legendBreaks=c("NA","Min","Negative", "0", "Positive", "Max"), legendColors=c("black","blue","cyan","white","yellow","red") , legendText="Legend") ## End(Not run)
How <- "runManually" ## Not run: metabologram(treeData = sampleWheelData, width=600, height=600, main="title", showLegend = TRUE, fontSize = 10, legendBreaks=c("NA","Min","Negative", "0", "Positive", "Max"), legendColors=c("black","blue","cyan","white","yellow","red") , legendText="Legend") ## End(Not run)
Widget output function for use in Shiny
metabologramOutput(outputId, width = 600, height = 500)
metabologramOutput(outputId, width = 600, height = 500)
outputId |
id |
width |
600 |
height |
600 |
A circular plot with genetic profile in Shiny App.
## Not run: library(bioCancer) bioCancer::metabologram(treeData = sampleMetabologramData) ## End(Not run)
## Not run: library(bioCancer) bioCancer::metabologram(treeData = sampleMetabologramData) ## End(Not run)
Atribute mutation frequency to nodes
Mutation_obj(list,FreqMutThreshold, geneListLabel)
Mutation_obj(list,FreqMutThreshold, geneListLabel)
list |
A list of data frame with mutation data. Each data frame to study |
FreqMutThreshold |
threshold Rate of cases (patients) having mutation (0-1). |
geneListLabel |
file name of geneList examples: "73" |
A dat frame with mutation frequency. Ech column corresponds to a study.
cgds <- cBioPortal( hostname = "www.cbioportal.org", protocol = "https", api = "/api/v2/api-docs" ) ## Not run: getDataByGenes( api = cgds, studyId = "gbm_tcga_pub", genes = c("NF1", "TP53", "ABL1"), by = "hugoGeneSymbol", molecularProfileIds = "gbm_tcga_pub_mrna" ) ## End(Not run)
cgds <- cBioPortal( hostname = "www.cbioportal.org", protocol = "https", api = "/api/v2/api-docs" ) ## Not run: getDataByGenes( api = cgds, studyId = "gbm_tcga_pub", genes = c("NF1", "TP53", "ABL1"), by = "hugoGeneSymbol", molecularProfileIds = "gbm_tcga_pub_mrna" ) ## End(Not run)
Attributes size to Nodes depending on number of interaction
Node_df_FreqIn(genelist, freqIn)
Node_df_FreqIn(genelist, freqIn)
genelist |
a vector of genes |
freqIn |
dataframe with Node interaction frequencies |
A data frame with nodes size attributes
Node_df_FreqIn ## Not run: r_data <- new.env() r_data[["FreqIn"]] <- structure(list(Genes = c("ATM", "ATR", "BRCA1", "BRCA2", "CHEK1", "CHEK2", "FANCF", "MDC1", "RAD51"), FreqSum = c(0.04, 0.05, 0.05, 0.03, 0.05, 0.04, 0.03, 0.03, 0.02)), .Names = c("Genes", "FreqSum"), class = "data.frame", row.names = c(NA, -9L)) GeneList <- whichGeneList("DNA_damage_Response") node_df <- Node_df_FreqIn(GeneList, r_data$FreqIn) ## End(Not run)
Node_df_FreqIn ## Not run: r_data <- new.env() r_data[["FreqIn"]] <- structure(list(Genes = c("ATM", "ATR", "BRCA1", "BRCA2", "CHEK1", "CHEK2", "FANCF", "MDC1", "RAD51"), FreqSum = c(0.04, 0.05, 0.05, 0.03, 0.05, 0.04, 0.03, 0.03, 0.02)), .Names = c("Genes", "FreqSum"), class = "data.frame", row.names = c(NA, -9L)) GeneList <- whichGeneList("DNA_damage_Response") node_df <- Node_df_FreqIn(GeneList, r_data$FreqIn) ## End(Not run)
Attributes color and shape to Nodes of Diseases
Node_Diseases_obj(genesclassdetails)
Node_Diseases_obj(genesclassdetails)
genesclassdetails |
a dataframe from geNetClassifier function |
A data frame with nodes Shapes and colors
GenesClassDetails <- structure(list(Genes = c("FANCF", "MLH1", "MSH2", "ATR", "PARP1", "CHEK2", "RAD51"), ranking = c(1L, 1L, 1L, 2L, 3L, 1L, 2L), class = c("brca_tcga", "gbm_tcga", "lihc_tcga", "lihc_tcga", "lihc_tcga", "lusc_tcga", "lusc_tcga"), postProb = c(1, 0.99, 1, 0.99, 0.99, 1, 0.98), exprsMeanDiff = c(180, 256, -373, -268, -1482, 258, 143), exprsUpDw = c("UP", "UP", "DOWN", "DOWN", "DOWN", "UP", "UP")), .Names = c("Genes", "ranking", "class", "postProb", "exprsMeanDiff", "exprsUpDw"), class = "data.frame", row.names = c(NA,-7L)) Node_Diseases_df <- Node_Diseases_obj(genesclassdetails= GenesClassDetails)
GenesClassDetails <- structure(list(Genes = c("FANCF", "MLH1", "MSH2", "ATR", "PARP1", "CHEK2", "RAD51"), ranking = c(1L, 1L, 1L, 2L, 3L, 1L, 2L), class = c("brca_tcga", "gbm_tcga", "lihc_tcga", "lihc_tcga", "lihc_tcga", "lusc_tcga", "lusc_tcga"), postProb = c(1, 0.99, 1, 0.99, 0.99, 1, 0.98), exprsMeanDiff = c(180, 256, -373, -268, -1482, 258, 143), exprsUpDw = c("UP", "UP", "DOWN", "DOWN", "DOWN", "UP", "UP")), .Names = c("Genes", "ranking", "class", "postProb", "exprsMeanDiff", "exprsUpDw"), class = "data.frame", row.names = c(NA,-7L)) Node_Diseases_df <- Node_Diseases_obj(genesclassdetails= GenesClassDetails)
Attribute CNA data to node border
Node_obj_CNA_ProfData(list)
Node_obj_CNA_ProfData(list)
list |
A list of data frame with CNA data. Each data frame corresponds to a study. |
A data frame with node border attributes
cgds <- cBioPortal( hostname = "www.cbioportal.org", protocol = "https", api = "/api/v2/api-docs" ) ## Not run: getDataByGenes( api = cgds, studyId = "gbm_tcga_pub", genes = c("NF1", "TP53", "ABL1"), by = "hugoGeneSymbol", molecularProfileIds = "gbm_tcga_pub_mrna" ) ## End(Not run)
cgds <- cBioPortal( hostname = "www.cbioportal.org", protocol = "https", api = "/api/v2/api-docs" ) ## Not run: getDataByGenes( api = cgds, studyId = "gbm_tcga_pub", genes = c("NF1", "TP53", "ABL1"), by = "hugoGeneSymbol", molecularProfileIds = "gbm_tcga_pub_mrna" ) ## End(Not run)
Attribute interaction frequency to node size
Node_obj_FreqIn(geneList)
Node_obj_FreqIn(geneList)
geneList |
A list of gene symbol |
A data frame with node attributes
r_data <- new.env() r_data[["FreqIn"]] <- structure(list(Genes = c("ATM", "ATR", "BRCA1", "BRCA2", "CHEK1", "CHEK2", "FANCF", "MDC1", "RAD51"), FreqSum = c(0.04, 0.05, 0.05, 0.03, 0.05, 0.04, 0.03, 0.03, 0.02)), .Names = c("Genes", "FreqSum"), class = "data.frame", row.names = c(NA, -9L)) ## Not run: GeneList <- whichGeneList("DNA_damage_Response") nodeObj <- Node_obj_FreqIn(GeneList) ## End(Not run)
r_data <- new.env() r_data[["FreqIn"]] <- structure(list(Genes = c("ATM", "ATR", "BRCA1", "BRCA2", "CHEK1", "CHEK2", "FANCF", "MDC1", "RAD51"), FreqSum = c(0.04, 0.05, 0.05, 0.03, 0.05, 0.04, 0.03, 0.03, 0.02)), .Names = c("Genes", "FreqSum"), class = "data.frame", row.names = c(NA, -9L)) ## Not run: GeneList <- whichGeneList("DNA_damage_Response") nodeObj <- Node_obj_FreqIn(GeneList) ## End(Not run)
Attribute gene Methylation to Nodes
Node_obj_Met_ProfData(list, type, threshold)
Node_obj_Met_ProfData(list, type, threshold)
list |
a list of data frame with methylation data |
type |
HM450 or HM27 |
threshold |
the Rate cases (patients) that have a silencing genes by methylation |
a data frame with node shape attributes
cgds <- cBioPortal( hostname = "www.cbioportal.org", protocol = "https", api = "/api/v2/api-docs" ) ## Not run: getDataByGenes( api = cgds, studyId = "gbm_tcga_pub", genes = c("NF1", "TP53", "ABL1"), by = "hugoGeneSymbol", molecularProfileIds = "gbm_tcga_pub_mrna" ) ## End(Not run)
cgds <- cBioPortal( hostname = "www.cbioportal.org", protocol = "https", api = "/api/v2/api-docs" ) ## Not run: getDataByGenes( api = cgds, studyId = "gbm_tcga_pub", genes = c("NF1", "TP53", "ABL1"), by = "hugoGeneSymbol", molecularProfileIds = "gbm_tcga_pub_mrna" ) ## End(Not run)
Atrribute genes expression to color nodes
Node_obj_mRNA_Classifier(geneList,genesclassdetails)
Node_obj_mRNA_Classifier(geneList,genesclassdetails)
geneList |
A gene list. |
genesclassdetails |
A dataframe with genes classes and genes expression. |
A data frame with node color attributes
r_data <- new.env() input <- NULL r_data[["FreqIn"]] <- structure(list(Genes = c("ATM", "ATR", "BRCA1", "BRCA2", "CHEK1", "CHEK2", "FANCF", "MDC1", "RAD51"), FreqSum = c(0.04, 0.05, 0.05, 0.03, 0.05, 0.04, 0.03, 0.03, 0.02)), .Names = c("Genes", "FreqSum"), class = "data.frame", row.names = c(NA, -9L)) GenesClassDetails <- structure(list(Genes = c("FANCF", "MLH1", "MSH2", "ATR", "PARP1", "CHEK2", "RAD51"), ranking = c(1L, 1L, 1L, 2L, 3L, 1L, 2L), class = c("brca_tcga", "gbm_tcga", "lihc_tcga", "lihc_tcga", "lihc_tcga", "lusc_tcga", "lusc_tcga"), postProb = c(1, 0.99, 1, 0.99, 0.99, 1, 0.98), exprsMeanDiff = c(180, 256, -373, -268, -1482, 258, 143), exprsUpDw = c("UP", "UP", "DOWN", "DOWN", "DOWN", "UP", "UP")), .Names = c("Genes", "ranking", "class", "postProb", "exprsMeanDiff", "exprsUpDw"), class = "data.frame", row.names = c(NA,-7L)) ## Not run: GeneList <- whichGeneList("DNA_damage_Response") nodeObj <- Node_obj_mRNA_Classifier(GeneList, GenesClassDetails) ## End(Not run)
r_data <- new.env() input <- NULL r_data[["FreqIn"]] <- structure(list(Genes = c("ATM", "ATR", "BRCA1", "BRCA2", "CHEK1", "CHEK2", "FANCF", "MDC1", "RAD51"), FreqSum = c(0.04, 0.05, 0.05, 0.03, 0.05, 0.04, 0.03, 0.03, 0.02)), .Names = c("Genes", "FreqSum"), class = "data.frame", row.names = c(NA, -9L)) GenesClassDetails <- structure(list(Genes = c("FANCF", "MLH1", "MSH2", "ATR", "PARP1", "CHEK2", "RAD51"), ranking = c(1L, 1L, 1L, 2L, 3L, 1L, 2L), class = c("brca_tcga", "gbm_tcga", "lihc_tcga", "lihc_tcga", "lihc_tcga", "lusc_tcga", "lusc_tcga"), postProb = c(1, 0.99, 1, 0.99, 0.99, 1, 0.98), exprsMeanDiff = c(180, 256, -373, -268, -1482, 258, 143), exprsUpDw = c("UP", "UP", "DOWN", "DOWN", "DOWN", "UP", "UP")), .Names = c("Genes", "ranking", "class", "postProb", "exprsMeanDiff", "exprsUpDw"), class = "data.frame", row.names = c(NA,-7L)) ## Not run: GeneList <- whichGeneList("DNA_damage_Response") nodeObj <- Node_obj_mRNA_Classifier(GeneList, GenesClassDetails) ## End(Not run)
Cleans up result from org.Xx.egGO and returns GO identifier for either
biological process (BP), cellular component (CC), or molecular function (MF).
Can be used on list of GOs from translate
, or a single list of GOs from an annotation package.
May reduce list, if the (sub)list does not contain the chosen class!
pickGO(l, evidence = NA, category = NA)
pickGO(l, evidence = NA, category = NA)
l |
Character vector, or list of GO identifiers. |
evidence |
Character vector, filters on which kind of evidence to return; for a larger list see |
category |
Character vector, filters on which ontology to return: biological process (BP), cellular component (CC), or molecular function (MF). \*
Leave as |
List with only the picked elements.
Stefan McKinnon Edwards [email protected]
pickRefSeq
, getEvidenceCodes
, translate
library(org.Bt.eg.db) genes <- c(280705, 280706, 100327208) translate(genes, org.Bt.egSYMBOL) symbols <- c("SERPINA1","KERA","CD5") refseq <- translate(symbols, from=org.Bt.egSYMBOL2EG, to=org.Bt.egREFSEQ) # Pick the proteins: pickRefSeq(refseq, priorities=c('NP','XP'), reduce='all') # If you wanted do do some further mapping on the result from # translate, simply use lapply. library(GO.db) GO <- translate(genes, org.Bt.egGO) # Get all biological processes: ## Not run: pickGO(GO, category='BP') # $`280705` # [1] "GO:0006826" "GO:0006879" # $`280706` # [1] "GO:0006590" "GO:0007165" "GO:0042446" # Get all ontologies with experimental evidence: pickGO(GO, evidence=c('IMP','IGI','IPI','ISS','IDA','IEP','IEA')) # $`280705` # [1] "GO:0006826" "GO:0006879" "GO:0005615" "GO:0008199" # $`280706` # [1] "GO:0006590" "GO:0007165" "GO:0042446" "GO:0005615" "GO:0005179" "GO:0042393" ## End(Not run)
library(org.Bt.eg.db) genes <- c(280705, 280706, 100327208) translate(genes, org.Bt.egSYMBOL) symbols <- c("SERPINA1","KERA","CD5") refseq <- translate(symbols, from=org.Bt.egSYMBOL2EG, to=org.Bt.egREFSEQ) # Pick the proteins: pickRefSeq(refseq, priorities=c('NP','XP'), reduce='all') # If you wanted do do some further mapping on the result from # translate, simply use lapply. library(GO.db) GO <- translate(genes, org.Bt.egGO) # Get all biological processes: ## Not run: pickGO(GO, category='BP') # $`280705` # [1] "GO:0006826" "GO:0006879" # $`280706` # [1] "GO:0006590" "GO:0007165" "GO:0042446" # Get all ontologies with experimental evidence: pickGO(GO, evidence=c('IMP','IGI','IPI','ISS','IDA','IEP','IEA')) # $`280705` # [1] "GO:0006826" "GO:0006879" "GO:0005615" "GO:0008199" # $`280706` # [1] "GO:0006590" "GO:0007165" "GO:0042446" "GO:0005615" "GO:0005179" "GO:0042393" ## End(Not run)
When translating to RefSeq, typically multiple identifiers are returned,
referring to different types of products, such as genomic molecule, mature
mRNA or the protein, and they can be predicted, properties that can be read
from the prefix (https://www.ncbi.nlm.nih.gov/refseq/). E.g. "XM_" is
predicted mRNA and "NP_" is a protein. Run ?org.Bt.egREFSEQ
.
pickRefSeq( l, priorities = c("NP", "XP", "NM", "XM"), reduce = c("all", "first", "last") )
pickRefSeq( l, priorities = c("NP", "XP", "NM", "XM"), reduce = c("all", "first", "last") )
l |
Vector or list of RefSeqs accessions to pick from. If list given, applies the prioritation to each element in the list. |
priorities |
Character vector of prioritised prefixes to pick by. Eg. |
reduce |
Reducing method, either return all annotations (one-to-many relation)
or the first or last found annotation. The reducing step is applied
after translating to the goal:
|
If vector given, returns vector. If list given, returns list without element where nothing could be picked.
Stefan McKinnon Edwards [email protected]
library(org.Bt.eg.db) symbols <- c("SERPINA1","KERA","CD5") refseq <- translate(symbols, from=org.Bt.egSYMBOL2EG, to=org.Bt.egREFSEQ) mRNA <- pickRefSeq(refseq, priorities=c('NM','XM')) proteins <- pickRefSeq(refseq, priorities=c('NP','XP'))
library(org.Bt.eg.db) symbols <- c("SERPINA1","KERA","CD5") refseq <- translate(symbols, from=org.Bt.egSYMBOL2EG, to=org.Bt.egREFSEQ) mRNA <- pickRefSeq(refseq, priorities=c('NM','XM')) proteins <- pickRefSeq(refseq, priorities=c('NP','XP'))
NA
from list or vectorRemoves entries equal NA
, but not mixed entries containing, amongst others, NA
.
Good for use after mapLists
that might return entries equal NA
.
removeNAs(l)
removeNAs(l)
l |
Vector or list. |
Stefan McKinnon Edwards [email protected]
removeNAs(list('a'=NA, 'b'=c(NA, 'B'), 'c'='C'))
removeNAs(list('a'=NA, 'b'=c(NA, 'B'), 'c'='C'))
Widget render function for use in Shiny
renderCoffeewheel(expr,env = parent.frame(), quoted = FALSE)
renderCoffeewheel(expr,env = parent.frame(), quoted = FALSE)
expr |
id |
env |
parent.frame() |
quoted |
FALSE |
A circular layout with genetic profile in Shiny App.
How <- "runManually" ## Not run: coffeewheel(treeData = sampleWheelData) ## End(Not run)
How <- "runManually" ## Not run: coffeewheel(treeData = sampleWheelData) ## End(Not run)
Widget render function for use in Shiny
renderMetabologram(expr, env= parent.frame(), quoted = FALSE)
renderMetabologram(expr, env= parent.frame(), quoted = FALSE)
expr |
expression |
env |
parent.frame() |
quoted |
FALSE |
A circular plot with genetic profile in Shiny App.
## Not run: library(bioCancer) bioCancer::metabologram(treeData = sampleMetabologramData) ## End(Not run)
## Not run: library(bioCancer) bioCancer::metabologram(treeData = sampleMetabologramData) ## End(Not run)
Restructure the list of color attributed to the genes in every dimenssion for every studies
reStrColorGene(df)
reStrColorGene(df)
df |
data frame with colors attributed to the genes |
Hierarchical color attribute: gene > color
cgds <- cBioPortal( hostname = "www.cbioportal.org", protocol = "https", api = "/api/v2/api-docs" ) ## Not run: getDataByGenes( api = cgds, studyId = "gbm_tcga_pub", genes = c("NF1", "TP53", "ABL1"), by = "hugoGeneSymbol", molecularProfileIds = "gbm_tcga_pub_mrna" ) ## End(Not run)
cgds <- cBioPortal( hostname = "www.cbioportal.org", protocol = "https", api = "/api/v2/api-docs" ) ## Not run: getDataByGenes( api = cgds, studyId = "gbm_tcga_pub", genes = c("NF1", "TP53", "ABL1"), by = "hugoGeneSymbol", molecularProfileIds = "gbm_tcga_pub_mrna" ) ## End(Not run)
Restructure the list of color attributed to the genes in every study for every dimensions
reStrDimension(LIST)
reStrDimension(LIST)
LIST |
list of hierarchical dimensions |
Hierarchical structure of: Study > dimensions > gene > color
cgds <- cBioPortal( hostname = "www.cbioportal.org", protocol = "https", api = "/api/v2/api-docs" ) ## Not run: getDataByGenes( api = cgds, studyId = "gbm_tcga_pub", genes = c("NF1", "TP53", "ABL1"), by = "hugoGeneSymbol", molecularProfileIds = "gbm_tcga_pub_mrna" ) ## End(Not run)
cgds <- cBioPortal( hostname = "www.cbioportal.org", protocol = "https", api = "/api/v2/api-docs" ) ## Not run: getDataByGenes( api = cgds, studyId = "gbm_tcga_pub", genes = c("NF1", "TP53", "ABL1"), by = "hugoGeneSymbol", molecularProfileIds = "gbm_tcga_pub_mrna" ) ## End(Not run)
Restructure the list of color attributed to the genes in every disease
reStrDisease(List)
reStrDisease(List)
List |
of data frame with color attributes |
Hierarchy of dimensions in the same study: dimensions > gene > color
cgds <- cBioPortal( hostname = "www.cbioportal.org", protocol = "https", api = "/api/v2/api-docs" ) ## Not run: getDataByGenes( api = cgds, studyId = "gbm_tcga_pub", genes = c("NF1", "TP53", "ABL1"), by = "hugoGeneSymbol", molecularProfileIds = "gbm_tcga_pub_mrna" ) ## End(Not run)
cgds <- cBioPortal( hostname = "www.cbioportal.org", protocol = "https", api = "/api/v2/api-docs" ) ## Not run: getDataByGenes( api = cgds, studyId = "gbm_tcga_pub", genes = c("NF1", "TP53", "ABL1"), by = "hugoGeneSymbol", molecularProfileIds = "gbm_tcga_pub_mrna" ) ## End(Not run)
Return message when the filter formula is not correct (mRNA > 500)
returnTextAreaInput(inputId, label= NULL, rows = 2, placeholder = NULL, resize= "vertical", value = "")
returnTextAreaInput(inputId, label= NULL, rows = 2, placeholder = NULL, resize= "vertical", value = "")
inputId |
The ID of the object |
label |
Text describes the box area |
rows |
Number of rows |
placeholder |
Error message if needed |
resize |
orientation of text |
value |
default text in the area box |
text message
ShinyApp <- 1 ## Not run: returnTextAreaInput(inputId = "data-filter", label = "Error message", rows = 2, placeholder = "Provide a filter (e.g., Genes == 'ATM') and press return", resize = "vertical", value="") ## End(Not run)
ShinyApp <- 1 ## Not run: returnTextAreaInput(inputId = "data-filter", label = "Error message", rows = 2, placeholder = "Provide a filter (e.g., Genes == 'ATM') and press return", resize = "vertical", value="") ## End(Not run)
get object for grViz. Link Studies to genes
Studies_obj(df)
Studies_obj(df)
df |
data frame with gene classes |
grViz object. a data frame with Study attributes
Studies_obj(data.frame("col1", "col2", "col3", "col4", "col5", "col6")) ## Not run: Genes ranking class postProb exprsMeanDiff exprsUpDw 1 FANCF 1 brca_tcga 1.00000 179.9226 UP 2 MLH1 1 gbm_tcga 0.99703 256.3173 UP ## End(Not run)
Studies_obj(data.frame("col1", "col2", "col3", "col4", "col5", "col6")) ## Not run: Genes ranking class postProb exprsMeanDiff exprsUpDw 1 FANCF 1 brca_tcga 1.00000 179.9226 UP 2 MLH1 1 gbm_tcga 0.99703 256.3173 UP ## End(Not run)
To be used with CSS script 'button.css' stored in a 'www' folder in your Shiny app folder
switchButton(inputId, label = NULL, value = FALSE, col = "GB", type = "TF")
switchButton(inputId, label = NULL, value = FALSE, col = "GB", type = "TF")
inputId |
The input slot that will be used to access the value. |
label |
Display label for the control, or NULL for no label. |
value |
Initial value (TRUE or FALSE). |
col |
Color set of the switch button. Choose between "GB" (Grey-Blue) and "RG" (Red-Green) |
type |
Text type of the button. Choose between "TF" (TRUE - FALSE), "OO" (ON - OFF) or leave empty for no text. |
S3 method to test cBioPortal connection
## S3 method for class 'CGDS' test(x, ...)
## S3 method for class 'CGDS' test(x, ...)
x |
connection object |
... |
not used |
Function for translating from one annotation to another, eg. from RefSeq to Ensemble. This function takes a vector of annotation values and translates first to the primary annotation in the Biocore Data Team package (ie. entrez gene identifier for org.Bt.eg.db) and then to the desired product, while removing non-translated annotations and optionally reducing the result so there is only a one-to-one relation.
translate( values, from, to = NULL, reduce = c("all", "first", "last"), return.list = TRUE, remove.missing = TRUE, simplify = FALSE, ... )
translate( values, from, to = NULL, reduce = c("all", "first", "last"), return.list = TRUE, remove.missing = TRUE, simplify = FALSE, ... )
values |
Vector of annotations that needs translation. Coerced to character vector. |
from |
Type of annotation |
to |
Desired goal, eg. |
reduce |
Reducing method, either return all annotations (one-to-many relation)
or the first or last found annotation. The reducing step is applied
after translating to the goal:
|
return.list |
Logical, when |
remove.missing |
Logical, whether to remove non-translated values, defaults |
simplify |
Logical, unlists the result. Defaults to FALSE. Usefull when using |
... |
Additional arguments sent to |
If you want to do some further mapping on the result, you will have to use
either unlist
og lapply
, where the first returns all the end-products
of the first mapping, returning a new list, and the latter produces a list-within-list.
If from
returns GO identifiers (e.g. from = org.Bt.egGO
), then the
returned resultset is more complex and consists of several layers of lists instead of
the usual list of character vectors. If to
has also been specified, the GO IDs
must be extracted (internally) and you have the option of filtering for evidence and category at this point.
See pickGO
.
List; names of elements are values
and the elements are the translated elements,
or NULL
if not translatable with remove.missing = TRUE
.
Requires user to deliver the annotation packages such as org.Bt.egREFSEQ.
Stefan McKinnon Edwards [email protected]
library(org.Bt.eg.db) genes <- c(280705, 280706, 100327208) translate(genes, org.Bt.egSYMBOL) symbols <- c("SERPINA1","KERA","CD5") refseq <- translate(symbols, from=org.Bt.egSYMBOL2EG, to=org.Bt.egREFSEQ) # Pick the proteins: pickRefSeq(refseq, priorities=c('NP','XP'), reduce='all') # If you wanted do do some further mapping on the result from # translate, simply use lapply. library(GO.db) GO <- translate(genes, org.Bt.egGO)
library(org.Bt.eg.db) genes <- c(280705, 280706, 100327208) translate(genes, org.Bt.egSYMBOL) symbols <- c("SERPINA1","KERA","CD5") refseq <- translate(symbols, from=org.Bt.egSYMBOL2EG, to=org.Bt.egREFSEQ) # Pick the proteins: pickRefSeq(refseq, priorities=c('NP','XP'), reduce='all') # If you wanted do do some further mapping on the result from # translate, simply use lapply. library(GO.db) GO <- translate(genes, org.Bt.egGO)
Unify row names in data frame with the same order of gene list.
UnifyRowNames(x,geneList)
UnifyRowNames(x,geneList)
x |
data frame with gene symbol in the row name |
geneList |
a gene list |
a data frame having the gene in row name ordered as in gene list.
cgds <- cBioPortal( hostname = "www.cbioportal.org", protocol = "https", api = "/api/v2/api-docs" ) ## Not run: getDataByGenes( api = cgds, studyId = "gbm_tcga_pub", genes = c("NF1", "TP53", "ABL1"), by = "hugoGeneSymbol", molecularProfileIds = "gbm_tcga_pub_mrna" ) ## End(Not run)
cgds <- cBioPortal( hostname = "www.cbioportal.org", protocol = "https", api = "/api/v2/api-docs" ) ## Not run: getDataByGenes( api = cgds, studyId = "gbm_tcga_pub", genes = c("NF1", "TP53", "ABL1"), by = "hugoGeneSymbol", molecularProfileIds = "gbm_tcga_pub_mrna" ) ## End(Not run)
Example of Copy Number Alteration (CNA) dataset
user_CNA
user_CNA
An object of class data.frame
with 579 rows and 13 columns.
Karim Mezhoud [email protected]
Example of Methylation HM27 dataset
user_MetHM27
user_MetHM27
An object of class data.frame
with 600 rows and 13 columns.
Karim Mezhoud [email protected]
Example of Methylation HM450 dataset
user_MetHM450
user_MetHM450
An object of class data.frame
with 10 rows and 13 columns.
Karim Mezhoud [email protected]
Example of mRNA expression dataset
user_mRNA
user_mRNA
An object of class data.frame
with 307 rows and 13 columns.
Karim Mezhoud [email protected]
Example of Mutation dataset
user_Mut
user_Mut
An object of class data.frame
with 37 rows and 23 columns.
Karim Mezhoud [email protected]
Verify which gene list is selected
whichGeneList(geneListLabel)
whichGeneList(geneListLabel)
geneListLabel |
The label of GeneList. There are three cases: "Genes" user gene list, "Reactome_GeneList" GeneList plus genes from reactomeFI "file name" from Examples |
Gene List label
How <- "runManually" ## Not run: whichGeneList("102") ## End(Not run)
How <- "runManually" ## Not run: whichGeneList("102") ## End(Not run)
Capture html output widget as .png in R
widgetThumbnail(p, thumbName, width = 1024, height = 1024)
widgetThumbnail(p, thumbName, width = 1024, height = 1024)
p |
is the html widget |
thumbName |
is the name of the new png file |
width |
1024 |
height |
1024 |
3 files .html, .js and .png
How <- "runManually" ## Not run: # Load package library(networkD3) library(htmlwidgets) # Create fake data src <- c("A", "A", "A", "A", "B", "B", "C", "C", "D") target <- c("B", "C", "D", "J", "E", "F", "G", "H", "I") networkData <- data.frame(src, target) # Plot plot = simpleNetwork(networkData) # Save html as png widgetThumbnail(p = plot, thumbName = "plot", width = 1024, height = 1024) ## End(Not run)
How <- "runManually" ## Not run: # Load package library(networkD3) library(htmlwidgets) # Create fake data src <- c("A", "A", "A", "A", "B", "B", "C", "C", "D") target <- c("B", "C", "D", "J", "E", "F", "G", "H", "I") networkData <- data.frame(src, target) # Plot plot = simpleNetwork(networkData) # Save html as png widgetThumbnail(p = plot, thumbName = "plot", width = 1024, height = 1024) ## End(Not run)