diff --git a/DESCRIPTION b/DESCRIPTION index ce2403e..82bd53f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -37,6 +37,7 @@ Suggests: covr, testthat (>= 3.0.0), badger, + hexSticker, utils RoxygenNote: 7.1.2 VignetteBuilder: knitr diff --git a/README.Rmd b/README.Rmd index e24a242..d6e4da5 100644 --- a/README.Rmd +++ b/README.Rmd @@ -1,17 +1,17 @@ +```{r, echo=FALSE, include=FALSE} +pkg <- read.dcf("DESCRIPTION", fields = "Package")[1] +description <- read.dcf("DESCRIPTION", fields = "Description")[1] +hex_url <- paste0('https://github.com/RajLabMSSM/',pkg,'raw/master/inst/hex/',pkg,'.png') +``` + --- -title: "README" +title: "" author: "

Author: Brian M. Schilder

" date: "

Updated: `r format( Sys.Date(), '%b-%d-%Y')`

" output: github_document --- -```{r, echo=FALSE, include=FALSE} -pkg <- read.dcf("DESCRIPTION", fields = "Package")[1] -description <- read.dcf("DESCRIPTION", fields = "Description")[1] -``` - - `r badger::badge_github_version(color = "black")` `r badger::badge_github_actions(action = "R-CMD-check-bioc")` @@ -20,14 +20,15 @@ description <- read.dcf("DESCRIPTION", fields = "Description")[1] `r badger::badge_license()` -# echoverse: ``r pkg`` - -## `r description` +## `r gsub("echoverse module: ","", description)` If you use ``r pkg``, please cite: -> Brian M Schilder, Jack Humphrey, Towfique Raj, echolocatoR: an automated end-to-end statistical and functional genomic fine-mapping pipeline, Bioinformatics, 2021;, btab658, [https://doi.org/10.1093/bioinformatics/btab658](https://doi.org/10.1093/bioinformatics/btab658) +> Brian M Schilder, Jack Humphrey, Towfique Raj (2021) +echolocatoR: an automated end-to-end statistical and functional genomic +fine-mapping pipeline, *Bioinformatics*; btab658, [https://doi.org/10.1093/bioinformatics/btab658](https://doi.org/10.1093/bioinformatics/btab658) +## Installation ```R if(!require("remotes")) install.packages("remotes") @@ -35,10 +36,10 @@ if(!require("remotes")) install.packages("remotes") remotes::install_github("RajLabMSSM/`r pkg`") library(`r pkg`) ``` +## Documentation - -## [Documentation website](https://rajlabmssm.github.io/`r pkg`) -## [Getting started vignette](https://rajlabmssm.github.io/`r pkg`/articles/`r pkg`) +### [Website](https://rajlabmssm.github.io/`r pkg`) +### [Getting started](https://rajlabmssm.github.io/`r pkg`/articles/`r pkg`)
diff --git a/README.html b/README.html new file mode 100644 index 0000000..37e5180 --- /dev/null +++ b/README.html @@ -0,0 +1,256 @@ + + + + + + + + + + + + + +README.knit + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + +

R build status License: GPL-3

+
+

echoversePackageDescription.

+

If you use echoverseTemplate, please cite:

+
+

Brian M Schilder, Jack Humphrey, Towfique Raj (2021) echolocatoR: an automated end-to-end statistical and functional genomic fine-mapping pipeline, Bioinformatics; btab658, https://doi.org/10.1093/bioinformatics/btab658

+
+
+
+

Installation

+
if(!require("remotes")) install.packages("remotes")
+
+remotes::install_github("RajLabMSSM/echoverseTemplate")
+library(echoverseTemplate)
+
+
+

Documentation

+ + +
+
+

Creator

+

Brian M. Schilder, Bioinformatician II
+Raj Lab
+Department of Neuroscience, Icahn School of Medicine at Mount Sinai

+
+ + + + +
+ + + + + + + + + + + + + + + diff --git a/README.md b/README.md index e476266..1c85fad 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ README Author: Brian M. Schilder

-Updated: Dec-02-2021 +Updated: Dec-03-2021

@@ -24,11 +24,13 @@ GPL-3](https://img.shields.io/badge/license-GPL--3-blue.svg)](https://cran.r-pro If you use `echoverseTemplate`, please cite: -> Brian M Schilder, Jack Humphrey, Towfique Raj, echolocatoR: an +> Brian M Schilder, Jack Humphrey, Towfique Raj (2021) echolocatoR: an > automated end-to-end statistical and functional genomic fine-mapping -> pipeline, Bioinformatics, 2021;, btab658, +> pipeline, *Bioinformatics*; btab658, > +## Installation + ``` r if(!require("remotes")) install.packages("remotes") @@ -36,9 +38,11 @@ remotes::install_github("RajLabMSSM/echoverseTemplate") library(echoverseTemplate) ``` -## [Documentation website](https://rajlabmssm.github.io/echoverseTemplate) +## Documentation + +### [Website](https://rajlabmssm.github.io/echoverseTemplate) -## [Getting started vignette](https://rajlabmssm.github.io/echoverseTemplate/articles/echoverseTemplate) +### [Getting started](https://rajlabmssm.github.io/echoverseTemplate/articles/echoverseTemplate)
diff --git a/inst/CITATION b/inst/CITATION index 9e35029..4694710 100644 --- a/inst/CITATION +++ b/inst/CITATION @@ -1,4 +1,4 @@ -citHeader("To cite echodata in publications use:") +citHeader("To cite this echoverse package, please use:") citEntry( entry = "Article", diff --git a/inst/hex/echoverseTemplate.png b/inst/hex/echoverseTemplate.png new file mode 100644 index 0000000..c8721ec Binary files /dev/null and b/inst/hex/echoverseTemplate.png differ diff --git a/inst/hex/hexSticker.Rmd b/inst/hex/hexSticker.Rmd new file mode 100644 index 0000000..e702041 --- /dev/null +++ b/inst/hex/hexSticker.Rmd @@ -0,0 +1,125 @@ +--- +title: "hexSticker" +author: "

Author: Brian M. Schilder

" +date: "

Updated: `r format( Sys.Date(), '%b-%d-%Y')`

" +output: + BiocStyle::html_document +vignette: > + %\VignetteIndexEntry{hexSticker} + %\VignetteEngine{knitr::rmarkdown} + %\VignetteEncoding{UTF-8} +--- + +```{r, echo=FALSE, include=FALSE} +pkg <- read.dcf("DESCRIPTION", fields = "Package")[1] +description <- read.dcf("DESCRIPTION", fields = "Description")[1] +``` + +You can make awesome hex stickers for your R packages using: + +- [hexSticker](https://github.com/GuangchuangYu/hexSticker) +- [ggimage](https://github.com/GuangchuangYu/ggimage) +lets you render images as data points. +- [ggpattern](https://coolbutuseless.github.io/package/ggpattern/) +lets you fill objects with patterns or images. +- [magick](https://cran.r-project.org/web/packages/magick/vignettes/intro.html) +modify PNGs. + +# `r pkg` + +```{r setup} +# If you're using R<4.1.1, need this version of rvcheck +# devtools::install_version('rvcheck',version='0.1.8') +library(hexSticker) +library(dplyr) +library(ggplot2) +library(ggimage) +# library(ggpattern)# remotes::install_github("coolbutuseless/ggpattern") +``` + +## File path + +Create file path. + +```{r} +filename <- here::here("inst/hex", paste0(pkg,".png")) +# filename <- file.path(tempdir(), paste0(pkg,".png")) +dir.create(dirname(filename), showWarnings = FALSE, recursive = TRUE) +``` + +## Bat logo + +Download bat logo from the +[*Fine_Mapping*](https://github.com/RajLabMSSM/Fine_Mapping) GitHub repo. + +```{r} +tmp <- tempfile() +#### Side view #### +URL <- "https://github.com/RajLabMSSM/Fine_Mapping/raw/master/echolocatoR/images/bat_silhouette.png" +#### Front view #### +# URL <- "https://github.com/RajLabMSSM/Fine_Mapping/raw/master/echolocatoR/images/bat_silhouette_front.png" +download.file(URL, tmp) +``` + +## Background + +Create background with `ggplot2`. + +```{r} +set.seed(1234) +n_bats <- 20 +d <- data.frame(x = -rexp(n_bats, rate = 3), + y = rexp(n_bats, rate = 3) + ) %>% + dplyr::mutate(image = URL, + bsize = abs(x*y^2)) %>% + dplyr::arrange(dplyr::desc(x), dplyr::desc(y)) +qplot(d$x, d$y, size=d$bsize) + +``` + + +```{r} +gg_bats <- ggplot(d, aes(x = x, y = y, color=bsize, image=image)) + + geom_image(aes(size=I(bsize)), alpha=1) + + scale_color_gradient(low = "#194f68", high = "#56ffff") + + coord_cartesian(clip = "off") + + labs(title = "echoverse") + + theme_void() + + theme(plot.title = element_text(color = "#56ffff", size = 25, + hjust = .5, vjust = 5, family = "Aller_Rg"), + legend.position = "none") + +print(gg_bats) +``` + +## hexSticker + +```{r, eval=FALSE} +s_size = 1 +stick <- hexSticker::sticker( + subplot = gg_bats, + #### Package name #### + package = pkg, p_size=14, p_y = 1.4, + #### Subplot ##### + s_x=1, s_y=.8, s_height = s_size, s_width = s_size, + #### Fill & border #### + h_fill = "#25355c", h_color = "#41c6c8", #56ffff + #### Spotlight #### + spotlight = TRUE, l_alpha = .3, l_width = 10, + #### File output #### + filename = filename, dpi = 300) +print(stick) +``` + + +# Session Info + +
+ +```{r Session Info} +utils::sessionInfo() +``` + +
+