generate_aRt

Post Image

Setting the scene

Here is an attempt to do some generative art. I got a lot of inspiration from the following sources:

Some R packages for this project:

remotes::install_github("thomasp85/ambient")
remotes::install_github("cutterkom/generativeart")
remotes::install_github("djnavarro/jasmines")

Loading libraries…

require(tidyverse)
## Loading required package: tidyverse
## ── Attaching packages ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── tidyverse 1.3.0 ──
## ✔ ggplot2 3.3.3     ✔ purrr   0.3.4
## ✔ tibble  3.0.5     ✔ dplyr   1.0.3
## ✔ tidyr   1.1.2     ✔ stringr 1.4.0
## ✔ readr   1.4.0     ✔ forcats 0.5.0
## ── Conflicts ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
require(jasmines)
## Loading required package: jasmines

Trying jasmines package out

d <- use_seed(1) %>%
    entity_droplet(grain = 1000) %>% 
    unfold_warp(
        iterations = 1,
        scale = .1
    ) %>%
    unfold_tempest(iterations = 30)
style_ribbon(data = d)


A more personnal project: a piece of art for everybody

The generative art packages that are out there are a tiny bit too obscure for me. This most likely comes from the fact that I have little knowledge in the maths behind the noise generative functions from ambient. So I decided to write my own package to create generative art.

The aim here is to create a piece of art corresponding to a specific individual, based on two different specific values:

  • Given name
  • D.O.B

name will be used to pick a random seed. dob will be used to pick a spot in a genome.

The package I wrote to generate this artistic “view” of someone’s genome is called dnaRt.

remotes::install_github('js2264/dnaRt')
library(dnaRt)
name='jacques'
dob="20/06/1992"

Then I create a “dnart” project as follows:

## Loading dnaRt
##   ✔  [01:16]: Project initiated
##   ◉  [01:16]: Folder: data
##   ◉  [01:16]: D.O.B.: 1992-06-20
##   ◉  [01:16]: Given name: jacques
dnart_project <- dnart(
    folder = 'data',
    given = name, 
    dob = dob
)

I can then plot an artistic plot of the sequences randomly picked by my package and displayed as a network:

dnart_project <- dnart_project %>% 
    plotArt(
        ratio = 1.66, 
        zoom = 3, 
        orientation = 'landscape', 
        file = 'graph.pdf'
    )
##   ✔  [01:16]: Plot saved in graph.pdf
dnart_project$plot


Session info

devtools::session_info()
## ─ Session info ───────────────────────────────────────────────────────────────
##  setting  value                       
##  version  R version 4.0.3 (2020-10-10)
##  os       macOS High Sierra 10.13.6   
##  system   x86_64, darwin17.0          
##  ui       X11                         
##  language (EN)                        
##  collate  en_GB.UTF-8                 
##  ctype    en_GB.UTF-8                 
##  tz       Europe/Paris                
##  date     2021-02-23                  
## 
## ─ Packages ───────────────────────────────────────────────────────────────────
##  ! package     * version    date       lib source                             
##    ambient       1.0.0.9000 2021-02-08 [1] Github (thomasp85/ambient@cfc9c1d) 
##    assertthat    0.2.1      2019-03-21 [1] CRAN (R 4.0.2)                     
##    backports     1.2.1      2020-12-09 [1] CRAN (R 4.0.2)                     
##    blogdown      1.0        2021-01-09 [1] CRAN (R 4.0.2)                     
##    bookdown      0.21       2020-10-13 [1] CRAN (R 4.0.2)                     
##    broom         0.7.3      2020-12-16 [1] CRAN (R 4.0.2)                     
##    callr         3.5.1      2020-10-13 [1] CRAN (R 4.0.2)                     
##    cellranger    1.1.0      2016-07-27 [1] CRAN (R 4.0.2)                     
##    cli           2.2.0      2020-11-20 [1] CRAN (R 4.0.2)                     
##    clisymbols    1.2.0      2017-05-21 [1] CRAN (R 4.0.2)                     
##    colorspace    2.0-0      2020-11-11 [1] CRAN (R 4.0.2)                     
##    crayon        1.3.4      2017-09-16 [1] CRAN (R 4.0.2)                     
##    DBI           1.1.1      2021-01-15 [1] CRAN (R 4.0.2)                     
##    dbplyr        2.0.0      2020-11-03 [1] CRAN (R 4.0.2)                     
##    deldir        0.2-9      2021-01-16 [1] CRAN (R 4.0.2)                     
##    desc          1.2.0      2018-05-01 [1] CRAN (R 4.0.2)                     
##    devtools      2.3.2      2020-09-18 [1] CRAN (R 4.0.2)                     
##    digest        0.6.27     2020-10-24 [1] CRAN (R 4.0.2)                     
##  R dnaRt       * 0.0.0.9000 <NA>       [?] <NA>                               
##    dplyr       * 1.0.3      2021-01-15 [1] CRAN (R 4.0.2)                     
##    ellipsis      0.3.1      2020-05-15 [1] CRAN (R 4.0.2)                     
##    evaluate      0.14       2019-05-28 [1] CRAN (R 4.0.1)                     
##    fansi         0.4.2      2021-01-15 [1] CRAN (R 4.0.2)                     
##    farver        2.0.3      2020-01-16 [1] CRAN (R 4.0.2)                     
##    forcats     * 0.5.0      2020-03-01 [1] CRAN (R 4.0.2)                     
##    fs            1.5.0      2020-07-31 [1] CRAN (R 4.0.2)                     
##    generics      0.1.0      2020-10-31 [1] CRAN (R 4.0.2)                     
##    ggforce       0.3.2      2020-06-23 [1] CRAN (R 4.0.2)                     
##    ggnewscale    0.4.5      2021-01-11 [1] CRAN (R 4.0.2)                     
##    ggplot2     * 3.3.3      2020-12-30 [1] CRAN (R 4.0.2)                     
##    glue          1.4.2      2020-08-27 [1] CRAN (R 4.0.2)                     
##    gridExtra     2.3        2017-09-09 [1] CRAN (R 4.0.2)                     
##    gtable        0.3.0      2019-03-25 [1] CRAN (R 4.0.2)                     
##    haven         2.3.1      2020-06-01 [1] CRAN (R 4.0.2)                     
##    hms           1.0.0      2021-01-13 [1] CRAN (R 4.0.2)                     
##    htmltools     0.5.1      2021-01-12 [1] CRAN (R 4.0.2)                     
##    httr          1.4.2      2020-07-20 [1] CRAN (R 4.0.2)                     
##    jasmines    * 0.0.0.9001 2021-02-08 [1] Github (djnavarro/jasmines@7196ac0)
##    jsonlite      1.7.2      2020-12-09 [1] CRAN (R 4.0.2)                     
##    knitr         1.30       2020-09-22 [1] CRAN (R 4.0.2)                     
##    labeling      0.4.2      2020-10-20 [1] CRAN (R 4.0.2)                     
##    lifecycle     0.2.0      2020-03-06 [1] CRAN (R 4.0.2)                     
##    lubridate     1.7.9.2    2020-11-13 [1] CRAN (R 4.0.2)                     
##    magrittr      2.0.1      2020-11-17 [1] CRAN (R 4.0.2)                     
##    MASS          7.3-53     2020-09-09 [1] CRAN (R 4.0.3)                     
##    memoise       1.1.0      2017-04-21 [1] CRAN (R 4.0.2)                     
##    modelr        0.1.8      2020-05-19 [1] CRAN (R 4.0.2)                     
##    munsell       0.5.0      2018-06-12 [1] CRAN (R 4.0.2)                     
##    pillar        1.4.7      2020-11-20 [1] CRAN (R 4.0.2)                     
##    pkgbuild      1.2.0      2020-12-15 [1] CRAN (R 4.0.2)                     
##    pkgconfig     2.0.3      2019-09-22 [1] CRAN (R 4.0.2)                     
##    pkgload       1.1.0      2020-05-29 [1] CRAN (R 4.0.2)                     
##    polyclip      1.10-0     2019-03-14 [1] CRAN (R 4.0.2)                     
##    prettyunits   1.1.1      2020-01-24 [1] CRAN (R 4.0.2)                     
##    processx      3.4.5      2020-11-30 [1] CRAN (R 4.0.2)                     
##    ps            1.5.0      2020-12-05 [1] CRAN (R 4.0.2)                     
##    purrr       * 0.3.4      2020-04-17 [1] CRAN (R 4.0.2)                     
##    R6            2.5.0      2020-10-28 [1] CRAN (R 4.0.2)                     
##    Rcpp          1.0.6      2021-01-15 [1] CRAN (R 4.0.2)                     
##    readr       * 1.4.0      2020-10-05 [1] CRAN (R 4.0.2)                     
##    readxl        1.3.1      2019-03-13 [1] CRAN (R 4.0.2)                     
##    remotes       2.2.0      2020-07-21 [1] CRAN (R 4.0.2)                     
##    reprex        0.3.0      2019-05-16 [1] CRAN (R 4.0.2)                     
##    rlang         0.4.10     2020-12-30 [1] CRAN (R 4.0.2)                     
##    rmarkdown     2.6        2020-12-14 [1] CRAN (R 4.0.2)                     
##    rprojroot     2.0.2      2020-11-15 [1] CRAN (R 4.0.2)                     
##    rstudioapi    0.13       2020-11-12 [1] CRAN (R 4.0.2)                     
##    rvest         0.3.6      2020-07-25 [1] CRAN (R 4.0.2)                     
##    scales        1.1.1      2020-05-11 [1] CRAN (R 4.0.2)                     
##    sessioninfo   1.1.1      2018-11-05 [1] CRAN (R 4.0.2)                     
##    stringi       1.5.3      2020-09-09 [1] CRAN (R 4.0.2)                     
##    stringr     * 1.4.0      2019-02-10 [1] CRAN (R 4.0.2)                     
##    testthat      3.0.1      2020-12-17 [1] CRAN (R 4.0.2)                     
##    tibble      * 3.0.5      2021-01-15 [1] CRAN (R 4.0.2)                     
##    tidyr       * 1.1.2      2020-08-27 [1] CRAN (R 4.0.2)                     
##    tidyselect    1.1.0      2020-05-11 [1] CRAN (R 4.0.2)                     
##    tidyverse   * 1.3.0      2019-11-21 [1] CRAN (R 4.0.2)                     
##    tweenr        1.0.1      2018-12-14 [1] CRAN (R 4.0.2)                     
##    usethis       2.0.0      2020-12-10 [1] CRAN (R 4.0.2)                     
##    vctrs         0.3.6      2020-12-17 [1] CRAN (R 4.0.2)                     
##    viridis       0.5.1      2018-03-29 [1] CRAN (R 4.0.2)                     
##    viridisLite   0.3.0      2018-02-01 [1] CRAN (R 4.0.1)                     
##    withr         2.4.0      2021-01-16 [1] CRAN (R 4.0.2)                     
##    xfun          0.20       2021-01-06 [1] CRAN (R 4.0.2)                     
##    xml2          1.3.2      2020-04-23 [1] CRAN (R 4.0.2)                     
##    yaml          2.2.1      2020-02-01 [1] CRAN (R 4.0.2)                     
## 
## [1] /Library/Frameworks/R.framework/Versions/4.0/Resources/library
## 
##  R ── Package was removed from disk.