
Rasterise a vector of sequences into a numerical dataframe for ggplotting (generic ggDNAvis
helper)
Source: R/dna_tools.R
create_image_data.Rd
Takes a character vector of sequences (which are allowed to be empty ""
to
act as a spacing line) and rasterises it into a dataframe that ggplot can read.
Value
dataframe
. Rasterised dataframe representation of the sequences, readable by ggplot2::ggplot()
.
Examples
create_image_data(c("ATCG", "", "GGCGGC", ""))
#> x y layer
#> 1 0.08333333 0.875 1
#> 2 0.25000000 0.875 4
#> 3 0.41666667 0.875 2
#> 4 0.58333333 0.875 3
#> 5 0.75000000 0.875 0
#> 6 0.91666667 0.875 0
#> 7 0.08333333 0.625 0
#> 8 0.25000000 0.625 0
#> 9 0.41666667 0.625 0
#> 10 0.58333333 0.625 0
#> 11 0.75000000 0.625 0
#> 12 0.91666667 0.625 0
#> 13 0.08333333 0.375 3
#> 14 0.25000000 0.375 3
#> 15 0.41666667 0.375 2
#> 16 0.58333333 0.375 3
#> 17 0.75000000 0.375 3
#> 18 0.91666667 0.375 2
#> 19 0.08333333 0.125 0
#> 20 0.25000000 0.125 0
#> 21 0.41666667 0.125 0
#> 22 0.58333333 0.125 0
#> 23 0.75000000 0.125 0
#> 24 0.91666667 0.125 0