library(clusterProfiler) data(gcSample) hg <- gcSample[[1]] head(hg) ## [1] "4597" "7111" "5266" "2175" "755" "23046" eg2np <- bitr_kegg(hg, fromType='kegg', toType='ncbi-proteinid', organism='hsa') ## Warning in bitr_kegg(hg, fromType = "kegg", toType = "ncbi-proteinid", ## organism = "hsa"): 3.7% of input gene IDs are fail to map... head(eg2np) ## kegg ncbi-proteinid ## 1 8326 NP_003499 ## 2 58487 NP_001034707 ## 3 139081 NP_619647 ## 4 59272 NP_068576 ## 5 993 NP_001780 ## 6 2676 NP_001487 np2up <- bitr_kegg(eg2np[,2], fromType='ncbi-proteinid', toType='uniprot', organism='hsa') head(np2up) ## ncbi-proteinid uniprot ## 1 NP_005457 O75586 ## 2 NP_005792 P41567 ## 3 NP_005792 Q6IAV3 ## 4 NP_037536 Q13421 ## 5 NP_006054 O60662 ## 6 NP_001092002 O95398The ID type (both fromType & toType) should be one of ‘kegg’, ‘ncbi-geneid’, ‘ncbi-proteinid’ or ‘uniprot’. The ‘kegg’ is the primary ID used ... [Read more...]
set.seed(123) d = data.frame(x=rnorm(10), y=rnorm(10)) imgfile <- tempfile(, fileext=".png") download.file("https://avatars1.githubusercontent.com/u/626539?v=3&u=e731426406dd3f45a73d96dd604bc45ae2e7c36f&s=140", destfile=imgfile, mode='wb') p = ggplot(d, aes(x, y)) subview(p, imgfile, x=d$x[1], y=d$y[1]) + geom_point(size=5)In previous post, I have introduced using annotation_image function for annotating tips with local images. Now with the updated subview function, we can use inset function to annotate nodes/tips with image files and/... [Read more...]
install.packages("emojifont")An example of using emoji font in R plot is showed below: More example can be found in the post and online vignette. I found FontAwesome is quite interesting especially in technical world. In emojifont (... [Read more...]
library(ggtree) phyfile <- system.file("extdata", "sample.phy", package="ggtree") phylip <- read.phylip(phyfile) phylip ## 'phylip' S4 object that stored information of ## '/Users/guangchuangyu/Library/R/3.2/library/ggtree/extdata/sample.phy'. ## ## ...@ tree: ## Phylogenetic tree with 15 tips and 13 internal nodes. ## ## Tip labels: ## K, N, D, L, J, G, ... ## ## Unrooted; no branch lengths. ## ## with sequence alignment available (15 sequences of length 2148) ggtree(phylip) + geom_tiplab()User can view the sequence alignment with the tree via msaplot() function.
msaplot(phylip, offset=1)
set.seed(1) tr = rtree(30) library(ape) plot(tr, main="ape") edgelabels()I don’t see any necessity to label edge numbers, as they are meaningless. The number is labeled as the row index of tr$edge, and edge can ...
Copyright © 2022 | MH Corporate basic by MH Themes