diff --git a/DESCRIPTION b/DESCRIPTION index 06123ae..47ef33a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,8 +2,10 @@ Package: gglogo Title: Geom for Logo Sequence Plots Version: 0.1.5 Authors@R: c( - person("Heike", "Hofmann", email = "hofmann@iastate.edu", role = "aut"), - person("Eric", "Hare", email = "eric@oaiti.org", role = c("aut", "cre")), + person("Heike", "Hofmann", email = "hofmann@iastate.edu", role = "aut", + comment = c(ORCID = "0000-0001-6216-5183")), + person("Eric", "Hare", email = "eric@oaiti.org", role = c("aut", "cre"), + comment = c(ORCID = "0000-0002-4277-3146")), person("GGobi Foundation", role = "aut")) License: GPL-3 URL: https://github.com/heike/gglogo, http://heike.github.io/gglogo/ diff --git a/NEWS.md b/NEWS.md index 5e1dc09..a3753e2 100644 --- a/NEWS.md +++ b/NEWS.md @@ -5,7 +5,18 @@ ## Small Usage Changes -- add parameter `missing_encode` to convert corresponding symbols in sequences correctly to `NA` +- expanded documentation +- add parameter `missing_encode` in `ggfortify` to convert corresponding symbols in sequences correctly to `NA` + +## Bug fixes + + +# gglogo 0.1.4 + + +## Brand New Features + +## Small Usage Changes ## Bug fixes diff --git a/README.Rmd b/README.Rmd index baeca0a..366c8e7 100644 --- a/README.Rmd +++ b/README.Rmd @@ -8,7 +8,7 @@ output: --- ```{r setup, include=FALSE} -knitr::opts_chunk$set(echo = TRUE) +knitr::opts_chunk$set(echo = TRUE, fig.path = "man/figures/") ``` R package for creating sequence logo plots diff --git a/README.html b/README.html index 514b5d5..d841719 100644 --- a/README.html +++ b/README.html @@ -359,28 +359,7 @@

January 30, 2024

R package for creating sequence logo plots

-

CRAN Status CRAN RStudio mirror downloads Last-changedate - - - - - - - - - - - - - - codecov - codecov - unknown - unknown - - - - R-CMD-check +

CRAN Status CRAN RStudio mirror downloads Last-changedate R-CMD-check diff --git a/README.md b/README.md index 343cce8..ec5b87b 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,6 @@ R package for creating sequence logo plots [![CRAN Status](http://www.r-pkg.org/badges/version/gglogo)](https://cran.r-project.org/package=gglogo) [![CRAN RStudio mirror downloads](https://cranlogs.r-pkg.org/badges/last-month/gglogo?color=blue)](https://r-pkg.org/pkg/gglogo) [![Last-changedate](https://img.shields.io/badge/last%20change-2024--01--30-yellowgreen.svg)](https://github.com/heike/gglogo/commits/main) -[![codecov test coverage](https://codecov.io/gh/heike/gglogo/graph/badge.svg?token=zfeqffIjxY)](https://codecov.io/gh/heike/gglogo) [![R-CMD-check](https://github.com/heike/gglogo/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/heike/gglogo/actions/workflows/R-CMD-check.yaml) [![Codecov test coverage](https://codecov.io/gh/heike/gglogo/branch/main/graph/badge.svg)](https://app.codecov.io/gh/heike/gglogo?branch=main) @@ -77,7 +76,7 @@ ggplot(data = ggfortify(sequences, peptide, method="shannon")) + theme(legend.position = "bottom") ``` -![](README_files/figure-html/unnamed-chunk-5-1.png) +![](man/figures/unnamed-chunk-5-1.png) (Sequence) Logo plots ([Schneider & Stephens 1990](https://academic.oup.com/nar/article-abstract/18/20/6097/1141316)) are typically used in bioinformatics as a way to visually demonstrate how well a sequence of nucleotides or amino acids are preserved in a certain region. @@ -93,7 +92,7 @@ ggplot(data = ggfortify(sequences, peptide, method="shannon")) + theme(legend.position = "bottom") ``` -![](README_files/figure-html/unnamed-chunk-6-1.png) +![](man/figures/unnamed-chunk-6-1.png) ## Other variants @@ -109,7 +108,7 @@ ggplot(data = ggfortify(sequences, peptide, method="shannon")) + theme(legend.position = "bottom") ``` -![](README_files/figure-html/unnamed-chunk-7-1.png) +![](man/figures/unnamed-chunk-7-1.png) Using the classic variant of alignment results in a stacked barchart of amino acids by position: @@ -123,7 +122,7 @@ ggplot(data = ggfortify(sequences, peptide, method="shannon")) + theme(legend.position = "bottom") ``` -![](README_files/figure-html/unnamed-chunk-8-1.png) +![](man/figures/unnamed-chunk-8-1.png) ## Implementation details @@ -183,7 +182,7 @@ seq_info %>% facet_wrap(~position, ncol = 12) ``` -![](README_files/figure-html/unnamed-chunk-11-1.png) +![](man/figures/unnamed-chunk-11-1.png) ## Available alphabets @@ -199,7 +198,7 @@ alphabet %>% theme(aspect.ratio = 1) ``` -![](README_files/figure-html/unnamed-chunk-12-1.png) +![](man/figures/unnamed-chunk-12-1.png) Besides the default alphabet, the fonts Comic Sans, xkcd, and braille (for 3d printing) are implemented: @@ -212,7 +211,7 @@ alphabet_comic %>% ggtitle("Comic Sans") ``` -![](README_files/figure-html/unnamed-chunk-13-1.png) +![](man/figures/unnamed-chunk-13-1.png) ```r alphabet_xkcd %>% @@ -222,7 +221,7 @@ alphabet_xkcd %>% ggtitle("xkcd font") ``` -![](README_files/figure-html/unnamed-chunk-13-2.png) +![](man/figures/unnamed-chunk-13-2.png) ```r alphabet_braille %>% @@ -232,7 +231,7 @@ alphabet_braille %>% ggtitle("Braille (use in 3d prints)") ``` -![](README_files/figure-html/unnamed-chunk-13-3.png) +![](man/figures/unnamed-chunk-13-3.png) ## References diff --git a/docs/404.html b/docs/404.html index 1a154d4..a87f7a8 100644 --- a/docs/404.html +++ b/docs/404.html @@ -4,99 +4,86 @@ - + Page not found (404) • gglogo - - - + + + - - + - + + Skip to contents -

-
-
- Content not found. Please use links in the navbar. -
- - -
- - -
- diff --git a/docs/authors.html b/docs/authors.html index 0003ae4..b1dcdb0 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -1,59 +1,57 @@ -Authors and Citation • gglogoAuthors and Citation • gglogo + + Skip to contents -
-
-
-
- + +
+
+
+
+
+

Authors

  • -

    Heike Hofmann. Author. +

    Heike Hofmann. Author.

  • -

    Eric Hare. Author, maintainer. +

    Eric Hare. Author, maintainer.

  • @@ -61,45 +59,38 @@

    Authors

-
-
-

Citation

- Source: DESCRIPTION -
-
+
+

Citation

+

Source: DESCRIPTION

-

Hofmann H, Hare E, GGobi Foundation (2024). +

Hofmann H, Hare E, GGobi Foundation (2024). gglogo: Geom for Logo Sequence Plots. -R package version 0.1.5, https://github.com/heike/gglogo. +https://github.com/heike/gglogo, http://heike.github.io/gglogo/.

-
@Manual{,
+      
@Manual{,
   title = {gglogo: Geom for Logo Sequence Plots},
   author = {Heike Hofmann and Eric Hare and {GGobi Foundation}},
   year = {2024},
-  note = {R package version 0.1.5},
-  url = {https://github.com/heike/gglogo},
+  note = {https://github.com/heike/gglogo, http://heike.github.io/gglogo/},
 }
- -
- -
- +
+
-
+
- diff --git a/docs/index.html b/docs/index.html index 67e45b0..e589026 100644 --- a/docs/index.html +++ b/docs/index.html @@ -4,14 +4,17 @@ - + + Geom for Logo Sequence Plots • gglogo - - - + + + - - + - + + Skip to contents -
-
-
+ +
+
+
+

R package for creating sequence logo plots

+ -

R package for creating sequence logo plots

-

CRAN Status CRAN RStudio mirror downloads Travis-CI Build Status

@@ -108,7 +106,7 @@

Getting Started alpha = 0.6, position = "classic") + scale_fill_brewer("Amino Acid\nproperties", palette = "Paired") + theme(legend.position = "bottom")

-

+

(Sequence) Logo plots (Schneider & Stephens 1990) are typically used in bioinformatics as a way to visually demonstrate how well a sequence of nucleotides or amino acids are preserved in a certain region.

A cognitively better version of the plot is the default, i.e. without specifying the position parameter, the plot defaults to aligning the largest contributor in each position along the y axis and showing all other variants in each position by a tail hanging below the axis. Longer tails indicate more variability in a position.

@@ -118,7 +116,7 @@ 

Getting Started alpha = 0.6) + scale_fill_brewer("Amino Acid\nproperties", palette = "Paired") + theme(legend.position = "bottom")

-

+

Other variants

@@ -130,7 +128,7 @@

Other variants alpha = 0.6) + scale_fill_brewer("Amino Acid\nproperties", palette = "Paired") + theme(legend.position = "bottom")

-

+

Using the classic variant of alignment results in a stacked barchart of amino acids by position:

 ggplot(data = ggfortify(sequences, peptide, method="shannon")) +      
@@ -139,7 +137,7 @@ 

Other variants alpha = 0.6, position="classic") + scale_fill_brewer("Amino Acid\nproperties", palette = "Paired") + theme(legend.position = "bottom")

-

+

Implementation details @@ -182,7 +180,7 @@

Implementation details scale_fill_brewer("Amino Acid\nproperties", palette = "Paired") + theme(legend.position = "bottom") + facet_wrap(~position, ncol = 12)

-

+

Available alphabets @@ -193,7 +191,7 @@

Available alphabetsfilter(group == "B") %>% ggplot(aes(x = x, y = y)) + geom_polygon() + theme(aspect.ratio = 1)

-

+

Besides the default alphabet, the fonts Comic Sans, xkcd, and braille (for 3d printing) are implemented:

 alphabet_comic %>% 
@@ -201,21 +199,21 @@ 

Available alphabetsggplot(aes(x = x, y = y)) + geom_polygon() + theme(aspect.ratio = 1) + facet_wrap(~group, ncol = 11) + ggtitle("Comic Sans")

-

+

 alphabet_xkcd %>% 
   dplyr::filter(group %in% c(LETTERS, 0:9)) %>%
   ggplot(aes(x = x, y = y)) + geom_polygon() + 
   theme(aspect.ratio = 1) + facet_wrap(~group, ncol = 11) + 
   ggtitle("xkcd font")
-

+

 alphabet_braille %>% 
   dplyr::filter(group %in% c(LETTERS, 0:9)) %>%
   ggplot(aes(x = x, y = y)) + geom_polygon() + 
   theme(aspect.ratio = 1) + facet_wrap(~group, ncol = 11) + 
   ggtitle("Braille (use in 3d prints)")
-

+

References @@ -224,10 +222,7 @@

References - -

- diff --git a/docs/news/index.html b/docs/news/index.html index fd0f2ac..ec42eb3 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -1,69 +1,79 @@ -Changelog • gglogoChangelog • gglogo + + Skip to contents -
-
-
- +
+
+
- +

gglogo 0.1.4

CRAN release: 2019-06-28

Brand New Features

Small Usage Changes

-
  • add parameter missing_encode to convert corresponding symbols in sequences correctly to NA +
    • expanded documentation
    • +
    • add parameter missing_encode in ggfortify to convert corresponding symbols in sequences correctly to NA

Bug fixes

+
+
+
+

gglogo 0.1.4

CRAN release: 2019-06-28

+
+

Brand New Features

+
+
+

Small Usage Changes

+
+
+

Bug fixes

  • check if font exists to avoid ungraceful quit
- +

gglogo 0.1.3

CRAN release: 2017-02-17

Brand New Features

@@ -76,28 +86,22 @@

Other changes

-
- - +
-
- -
- diff --git a/docs/pkgdown.js b/docs/pkgdown.js index 6f0eee4..5fccd9c 100644 --- a/docs/pkgdown.js +++ b/docs/pkgdown.js @@ -2,70 +2,30 @@ (function($) { $(function() { - $('.navbar-fixed-top').headroom(); + $('nav.navbar').headroom(); - $('body').css('padding-top', $('.navbar').height() + 10); - $(window).resize(function(){ - $('body').css('padding-top', $('.navbar').height() + 10); + Toc.init({ + $nav: $("#toc"), + $scope: $("main h2, main h3, main h4, main h5, main h6") }); - $('[data-toggle="tooltip"]').tooltip(); - - var cur_path = paths(location.pathname); - var links = $("#navbar ul li a"); - var max_length = -1; - var pos = -1; - for (var i = 0; i < links.length; i++) { - if (links[i].getAttribute("href") === "#") - continue; - // Ignore external links - if (links[i].host !== location.host) - continue; - - var nav_path = paths(links[i].pathname); - - var length = prefix_length(nav_path, cur_path); - if (length > max_length) { - max_length = length; - pos = i; - } - } - - // Add class to parent
  • , and enclosing
  • if in dropdown - if (pos >= 0) { - var menu_anchor = $(links[pos]); - menu_anchor.parent().addClass("active"); - menu_anchor.closest("li.dropdown").addClass("active"); - } - }); - - function paths(pathname) { - var pieces = pathname.split("/"); - pieces.shift(); // always starts with / - - var end = pieces[pieces.length - 1]; - if (end === "index.html" || end === "") - pieces.pop(); - return(pieces); - } - - // Returns -1 if not found - function prefix_length(needle, haystack) { - if (needle.length > haystack.length) - return(-1); - - // Special case for length-0 haystack, since for loop won't run - if (haystack.length === 0) { - return(needle.length === 0 ? 0 : -1); + if ($('#toc').length) { + $('body').scrollspy({ + target: '#toc', + offset: $("nav.navbar").outerHeight() + 1 + }); } - for (var i = 0; i < haystack.length; i++) { - if (needle[i] != haystack[i]) - return(i); - } + // Activate popovers + $('[data-bs-toggle="popover"]').popover({ + container: 'body', + html: true, + trigger: 'focus', + placement: "top", + sanitize: false, + }); - return(haystack.length); - } + $('[data-bs-toggle="tooltip"]').tooltip(); /* Clipboard --------------------------*/ @@ -78,7 +38,7 @@ if(ClipboardJS.isSupported()) { $(document).ready(function() { - var copyButton = ""; + var copyButton = ""; $("div.sourceCode").addClass("hasCopyButton"); @@ -89,20 +49,108 @@ $('.btn-copy-ex').tooltip({container: 'body'}); // Initialize clipboard: - var clipboardBtnCopies = new ClipboardJS('[data-clipboard-copy]', { + var clipboard = new ClipboardJS('[data-clipboard-copy]', { text: function(trigger) { return trigger.parentNode.textContent.replace(/\n#>[^\n]*/g, ""); } }); - clipboardBtnCopies.on('success', function(e) { + clipboard.on('success', function(e) { changeTooltipMessage(e.trigger, 'Copied!'); e.clearSelection(); }); - clipboardBtnCopies.on('error', function() { + clipboard.on('error', function() { changeTooltipMessage(e.trigger,'Press Ctrl+C or Command+C to copy'); }); + }); } + + /* Search marking --------------------------*/ + var url = new URL(window.location.href); + var toMark = url.searchParams.get("q"); + var mark = new Mark("main#main"); + if (toMark) { + mark.mark(toMark, { + accuracy: { + value: "complementary", + limiters: [",", ".", ":", "/"], + } + }); + } + + /* Search --------------------------*/ + /* Adapted from https://github.com/rstudio/bookdown/blob/2d692ba4b61f1e466c92e78fd712b0ab08c11d31/inst/resources/bs4_book/bs4_book.js#L25 */ + // Initialise search index on focus + var fuse; + $("#search-input").focus(async function(e) { + if (fuse) { + return; + } + + $(e.target).addClass("loading"); + var response = await fetch($("#search-input").data("search-index")); + var data = await response.json(); + + var options = { + keys: ["what", "text", "code"], + ignoreLocation: true, + threshold: 0.1, + includeMatches: true, + includeScore: true, + }; + fuse = new Fuse(data, options); + + $(e.target).removeClass("loading"); + }); + + // Use algolia autocomplete + var options = { + autoselect: true, + debug: true, + hint: false, + minLength: 2, + }; + var q; +async function searchFuse(query, callback) { + await fuse; + + var items; + if (!fuse) { + items = []; + } else { + q = query; + var results = fuse.search(query, { limit: 20 }); + items = results + .filter((x) => x.score <= 0.75) + .map((x) => x.item); + if (items.length === 0) { + items = [{dir:"Sorry 😿",previous_headings:"",title:"No results found.",what:"No results found.",path:window.location.href}]; + } + } + callback(items); +} + $("#search-input").autocomplete(options, [ + { + name: "content", + source: searchFuse, + templates: { + suggestion: (s) => { + if (s.title == s.what) { + return `${s.dir} >
    ${s.title}
    `; + } else if (s.previous_headings == "") { + return `${s.dir} >
    ${s.title}
    > ${s.what}`; + } else { + return `${s.dir} >
    ${s.title}
    > ${s.previous_headings} > ${s.what}`; + } + }, + }, + }, + ]).on('autocomplete:selected', function(event, s) { + window.location.href = s.path + "?q=" + q + "#" + s.id; + }); + }); })(window.jQuery || window.$) + + diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 2c1cbb9..bcbdb84 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -2,5 +2,8 @@ pandoc: 3.1.6.1 pkgdown: 2.0.7 pkgdown_sha: ~ articles: {} -last_built: 2024-01-30T20:20Z +last_built: 2024-01-30T21:07Z +urls: + reference: http://heike.github.io/gglogo/reference + article: http://heike.github.io/gglogo/articles diff --git a/docs/reference/aacids.html b/docs/reference/aacids.html index 7e94245..cf64f76 100644 --- a/docs/reference/aacids.html +++ b/docs/reference/aacids.html @@ -1,86 +1,80 @@ -properties of amino acids — aacids • gglogoproperties of amino acids — aacids • gglogo + + Skip to contents -
    -
    -
    - + + +
    +
    +
    +
    -
    +

    properties of amino acids: polarity and water affiliation

    -
    +
    +

    Usage

    data(aacids)
    -
    -

    Details

    +
    +

    Details

    Amino acid properties

    -
    - -
    +
    -
    +
    - diff --git a/docs/reference/alphabet.html b/docs/reference/alphabet.html index e86f1ca..3cabaaa 100644 --- a/docs/reference/alphabet.html +++ b/docs/reference/alphabet.html @@ -1,58 +1,56 @@ -alphabet polygon data — alphabet • gglogoalphabet polygon data — alphabet • gglogo + + Skip to contents -
    -
    -
    - + + +
    +
    +
    +
    -
    +

    polygons of upper and lower case letters and digits 0-9

    -
    +
    +

    Usage

    data(alphabet)
     
     data(alphabet_comic)
    @@ -62,34 +60,30 @@ 

    alphabet polygon data

    data(alphabet_braille)
    -
    -

    Details

    +
    +

    Details

    alphabet polygon data

    The alphabet polygon data is based on the font Helvetica. Upper and lower case letters are included as well as digits. Other alphabet data are `alphabet_comic` (based on Comic Sans MS), `alphabet_xkcd` (based on the xkcd font), and `alphabet_braille` (based on Swell Braille)

    -
    - -
    +
    -
    +
    - diff --git a/docs/reference/calcInformation.html b/docs/reference/calcInformation.html index 4c87a96..9a2f48f 100644 --- a/docs/reference/calcInformation.html +++ b/docs/reference/calcInformation.html @@ -1,58 +1,56 @@ -Compute shannon information based on position and treatment — calcInformation • gglogoCompute shannon information based on position and treatment — calcInformation • gglogo + + Skip to contents -
    -
    -
    - + + +
    +
    +
    +
    -
    +

    Compute shannon information based on position and treatment

    -
    +
    +

    Usage

    calcInformation(
       dframe,
       pos,
    @@ -64,8 +62,8 @@ 

    Compute shannon information based on position and treatment

    )
    -
    -

    Arguments

    +
    +

    Arguments

    dframe

    data frame of peptide (or any other) sequences and some treatment factors

    @@ -94,15 +92,15 @@

    Arguments

    either "shannon" or "frequency" for Shannon information or relative frequency of element by position.

    -
    -

    Value

    +
    +

    Value

    extended data frame with frequency and (Shanon) bits. The results for the requested method are found in variable `info`.

    -
    -

    Examples

    +
    +

    Examples

    data(sequences)
     dm2 <- splitSequence(sequences, peptide)
     dm3 <- calcInformation(dm2, pos = position, elems = element, trt = class, k = 21)
    @@ -117,26 +115,22 @@ 

    Examples

    -
    - -
    +
    -
    +
    - diff --git a/docs/reference/createPolygons.html b/docs/reference/createPolygons.html index 7b52da0..3c8750e 100644 --- a/docs/reference/createPolygons.html +++ b/docs/reference/createPolygons.html @@ -1,63 +1,61 @@ -Create a data set of polygons for a set of letters from a specified fontfamily — createPolygons • gglogoCreate a data set of polygons for a set of letters from a specified fontfamily — createPolygons • gglogo + + Skip to contents -
    -
    -
    - + + +
    +
    +
    +
    -
    +

    Create a data set of polygons for a set of letters from a specified fontfamily

    -
    +
    +

    Usage

    createPolygons(letters, font, fontsize = 400, dim = c(720, 720), scale = FALSE)
    -
    -

    Arguments

    +
    +

    Arguments

    letters

    set of characters for which polygons are to be created

    @@ -79,15 +77,15 @@

    Arguments

    scale the values along the y axis to use result in geom_logo

    -
    -

    Value

    +
    +

    Value

    data set compatible to work with geom_logo

    -
    -

    Examples

    +
    +

    Examples

    # \donttest{
     # check that all letters and digits are nicely shaped:
     new_alphabet <- createPolygons(c("f", "g", "W", "*"), font="Garamond")
    @@ -103,26 +101,22 @@ 

    Examples

    # }
    -
    - -
    +
    -
    +
    - diff --git a/docs/reference/determineOrder.html b/docs/reference/determineOrder.html index c3ce10e..e16086d 100644 --- a/docs/reference/determineOrder.html +++ b/docs/reference/determineOrder.html @@ -1,65 +1,64 @@ -Determine order in which to pass through a set of points — determineOrder • gglogoDetermine order in which to pass through a set of points — determineOrder • gglogo + + Skip to contents -
    -
    -
    - + + +
    +
    +
    +
    -
    +

    Greedy algorithm to connect points, with the idea that a point is connected by a line with the two points closest to each, that haven't yet been connected into the shape. Results depend on the starting point.

    -
    +
    +

    Usage

    determineOrder(x, y)
    -
    -

    Arguments

    +
    +

    Arguments

    x

    x coordinates

    @@ -68,33 +67,29 @@

    Arguments

    y coordinates

    -
    -

    Value

    +
    +

    Value

    vector of indices for ordered traversion along border

    -
    - -
    +
    -
    +
    - diff --git a/docs/reference/fortify.html b/docs/reference/fortify.html index 82473bf..0bcfdc6 100644 --- a/docs/reference/fortify.html +++ b/docs/reference/fortify.html @@ -1,66 +1,64 @@ -Convert image matrix to a data frame — fortify • gglogoConvert image matrix to a data frame — fortify • gglogo + + Skip to contents -
    -
    -
    - + + +
    +
    +
    +
    -
    +

    S3 method to create a data frame from a 3d array.

    -
    +
    +

    Usage

    fortify(model, data, ...)
     
     # S3 method for default
     fortify(model, data, ...)
    -
    -

    Arguments

    +
    +

    Arguments

    model

    array as e.g. returned from readJPEG

    @@ -73,8 +71,8 @@

    Arguments

    not used by this method

    -
    -

    Value

    +
    +

    Value

    data frame

    • x x coordinate in pixels

    • @@ -84,26 +82,22 @@

      Value

    • blue number vector in (0,1) describing the amount of blue of the pixel in an RGB model

    -
    - -
    +
    -
    +
    - diff --git a/docs/reference/geom_logo.html b/docs/reference/geom_logo.html index 978b206..5910289 100644 --- a/docs/reference/geom_logo.html +++ b/docs/reference/geom_logo.html @@ -1,58 +1,56 @@ -Sequence logo plots. — GeomLogo • gglogoSequence logo plots. — GeomLogo • gglogo + + Skip to contents -
    -
    -
    - + + +
    +
    +
    +
    -
    +

    Sequence logo plots.

    -
    +
    +

    Usage

    GeomLogo
     
     geom_logo(
    @@ -70,12 +68,12 @@ 

    Sequence logo plots.

    )
    -
    -

    Format

    +
    +

    Format

    An object of class GeomLogo (inherits from Geom, ggproto, gg) of length 6.

    -
    -

    Arguments

    +
    +

    Arguments

    mapping

    The aesthetic mapping, usually constructed with aes or aes_string. Only needs to be set at the layer level if you are overriding the plot defaults.

    @@ -121,8 +119,8 @@

    Arguments

    -
    -

    Examples

    +
    +

    Examples

    # \donttest{
     library(ggplot2)
     data(sequences)
    @@ -162,26 +160,22 @@ 

    Examples

    # }
    -
    - -
    +
    -
    +
    - diff --git a/docs/reference/getOutline.html b/docs/reference/getOutline.html index 32f8bbe..7444b6a 100644 --- a/docs/reference/getOutline.html +++ b/docs/reference/getOutline.html @@ -1,63 +1,61 @@ -Determine boundary between foreground and background in an image — getOutline • gglogoDetermine boundary between foreground and background in an image — getOutline • gglogo + + Skip to contents -
    -
    -
    - + + +
    +
    +
    +
    -
    +

    Determine boundary between foreground and background in an image

    -
    +
    +

    Usage

    getOutline(imdf, var = "red", threshold = 0.5)
    -
    -

    Arguments

    +
    +

    Arguments

    imdf

    dataframe describing a pixellated image in x and y. Has to have columns x, y, and var

    @@ -70,8 +68,8 @@

    Arguments

    value specifying the cutoff along variable var. Values of var higher than the threshold are considered to belong to the foreground.

    -
    -

    Value

    +
    +

    Value

    subset of data frame imdf consisting of just boundary points:

    • x x coordinate in pixels

    • @@ -81,26 +79,22 @@

      Value

    • blue number vector in (0,1) describing the amount of blue of the pixel in an RGB model

    -
    - -
    +
    -
    +
    - diff --git a/docs/reference/ggfortify.html b/docs/reference/ggfortify.html index 6f18df6..b16d0cf 100644 --- a/docs/reference/ggfortify.html +++ b/docs/reference/ggfortify.html @@ -1,58 +1,56 @@ -Convert sequence data to a format suitable for logo plots — ggfortify • gglogoConvert sequence data to a format suitable for logo plots — ggfortify • gglogo + + Skip to contents -
    -
    -
    - + + +
    +
    +
    +
    -
    +

    Convert sequence data to a format suitable for logo plots

    -
    +
    +

    Usage

    ggfortify(
       data,
       sequences,
    @@ -63,8 +61,8 @@ 

    Convert sequence data to a format suitable for logo plots

    )
    -
    -

    Arguments

    +
    +

    Arguments

    data

    data frame with the sequences

    @@ -89,15 +87,15 @@

    Arguments

    which character value(s) signifies a missing element in a sequence? defaults to `.`.

    -
    -

    Value

    +
    +

    Value

    data frame with position, element and information value

    -
    -

    Examples

    +
    +

    Examples

    # \donttest{
     library(ggplot2)
     data(sequences)
    @@ -115,26 +113,22 @@ 

    Examples

    # }
    -
    - -
    +
    -
    +
    - diff --git a/docs/reference/identifyParts.html b/docs/reference/identifyParts.html index 1cc70ad..d3c844d 100644 --- a/docs/reference/identifyParts.html +++ b/docs/reference/identifyParts.html @@ -1,63 +1,61 @@ -Identify different parts of a polygon — identifyParts • gglogoIdentify different parts of a polygon — identifyParts • gglogo + + Skip to contents -
    -
    -
    - + + +
    +
    +
    +
    -
    +

    Identify different parts of a polygon

    -
    +
    +

    Usage

    identifyParts(data, tol = NULL)
    -
    -

    Arguments

    +
    +

    Arguments

    data

    is a data frame with coordinates x, y, and order.

    @@ -66,33 +64,29 @@

    Arguments

    numerical tolerance for minimal distance between groups. If this value is not specified, a tolerace is derived from the marginal frequencey break down of observed (squared) distances between consecutive points.

    -
    -

    Value

    +
    +

    Value

    data frame group variable is added to the input data

    -
    - -
    +
    -
    +
    - diff --git a/docs/reference/index.html b/docs/reference/index.html index 02932e6..6a28b90 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -1,160 +1,180 @@ -Function reference • gglogoFunction reference • gglogo + + Skip to contents -
    -
    +
    +
    +
    +
    +

    All functions

    + -
    -
    - + +
    + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -

    All functions

    -

    -
    -

    aacids

    -

    properties of amino acids

    -

    alphabet alphabet_comic alphabet_xkcd alphabet_braille

    -

    alphabet polygon data

    -

    calcInformation()

    -

    Compute shannon information based on position and treatment

    -

    createPolygons()

    -

    Create a data set of polygons for a set of letters from a specified fontfamily

    -

    determineOrder()

    -

    Determine order in which to pass through a set of points

    -

    fortify()

    -

    Convert image matrix to a data frame

    -

    GeomLogo geom_logo()

    -

    Sequence logo plots.

    -

    getOutline()

    -

    Determine boundary between foreground and background in an image

    -

    ggfortify()

    -

    Convert sequence data to a format suitable for logo plots

    -

    identifyParts()

    -

    Identify different parts of a polygon

    -

    letterObject()

    -

    Convert a text element into an R object

    -

    letterToPolygon()

    -

    Convert an image file to a polygon

    -

    logo()

    -

    Logo plot

    -

    mainPlusIslands()

    -

    Set the orientation of a polygon

    -

    point_line_dist()

    -

    Distance between point and line

    -

    position_logo() position_classic()

    -

    Logo positioning for overlapping objects on top of one another.

    -

    sequences

    -

    peptide sequence data

    -

    simplifyPolygon()

    -

    Douglas-Peucker algorithm adjusted fo polyons

    -

    simplify_rec()

    -

    Douglas Pecker algorithm for line thinning

    -

    splitSequence()

    -

    Reshape data set according to elements in sequences

    -

    StatLogo stat_logo()

    -

    Calculation of all pieces necessary to plot a logo sequence plot

    - - -
    +
    + + aacids +
    +
    properties of amino acids
    +
    + + alphabet alphabet_comic alphabet_xkcd alphabet_braille +
    +
    alphabet polygon data
    +
    + + calcInformation() +
    +
    Compute shannon information based on position and treatment
    +
    + + createPolygons() +
    +
    Create a data set of polygons for a set of letters from a specified fontfamily
    +
    + + determineOrder() +
    +
    Determine order in which to pass through a set of points
    +
    + + fortify() +
    +
    Convert image matrix to a data frame
    +
    + + GeomLogo geom_logo() +
    +
    Sequence logo plots.
    +
    + + getOutline() +
    +
    Determine boundary between foreground and background in an image
    +
    + + ggfortify() +
    +
    Convert sequence data to a format suitable for logo plots
    +
    + + identifyParts() +
    +
    Identify different parts of a polygon
    +
    + + letterObject() +
    +
    Convert a text element into an R object
    +
    + + letterToPolygon() +
    +
    Convert an image file to a polygon
    +
    + + logo() +
    +
    Logo plot
    +
    + + mainPlusIslands() +
    +
    Set the orientation of a polygon
    +
    + + point_line_dist() +
    +
    Distance between point and line
    +
    + + position_logo() position_classic() +
    +
    Logo positioning for overlapping objects on top of one another.
    +
    + + sequences +
    +
    peptide sequence data
    +
    + + simplifyPolygon() +
    +
    Douglas-Peucker algorithm adjusted fo polyons
    +
    + + simplify_rec() +
    +
    Douglas Pecker algorithm for line thinning
    +
    + + splitSequence() +
    +
    Reshape data set according to elements in sequences
    +
    + + StatLogo stat_logo() +
    +
    Calculation of all pieces necessary to plot a logo sequence plot
    +
    +
    -
    +
    - diff --git a/docs/reference/letterObject.html b/docs/reference/letterObject.html index 9dc8cc1..d2ba6a6 100644 --- a/docs/reference/letterObject.html +++ b/docs/reference/letterObject.html @@ -1,58 +1,56 @@ -Convert a text element into an R object — letterObject • gglogoConvert a text element into an R object — letterObject • gglogo + + Skip to contents -
    -
    -
    - + + +
    +
    +
    +
    -
    +

    Convert a text element into an R object

    -
    +
    +

    Usage

    letterObject(
       ch,
       fontfamily = "Helvetica",
    @@ -62,8 +60,8 @@ 

    Convert a text element into an R object

    )
    -
    -

    Arguments

    +
    +

    Arguments

    ch

    text to be converted, usually just a single letter

    @@ -84,15 +82,15 @@

    Arguments

    vector of length two specifying width and height (in pixels) of the temporary jpg file created for the letter. Defaults to 480 x 480 pixels.

    -
    -

    Value

    +
    +

    Value

    three dimensional matrix of dimension 480 x 480 x 3 of the pixel values, black background and white letter

    -
    -

    Examples

    +
    +

    Examples

    # \donttest{
     plot(letterObject("g", fontfamily="Times New Roman", fontsize=400))
     
    @@ -103,26 +101,22 @@ 

    Examples

    # }
    -
    - -
    +
    -
    +
    - diff --git a/docs/reference/letterToPolygon.html b/docs/reference/letterToPolygon.html index fdd7270..765c0ce 100644 --- a/docs/reference/letterToPolygon.html +++ b/docs/reference/letterToPolygon.html @@ -1,58 +1,56 @@ -Convert an image file to a polygon — letterToPolygon • gglogoConvert an image file to a polygon — letterToPolygon • gglogo + + Skip to contents -
    -
    -
    - + + +
    +
    +
    +
    -
    +

    Convert an image file to a polygon

    -
    +
    +

    Usage

    letterToPolygon(
       ch,
       fontfamily = "Helvetica",
    @@ -64,8 +62,8 @@ 

    Convert an image file to a polygon

    )
    -
    -

    Arguments

    +
    +

    Arguments

    ch

    letter

    @@ -95,8 +93,8 @@

    Arguments

    -
    -

    Examples

    +
    +

    Examples

    library(ggplot2)
     letter <- letterToPolygon("R", fontfamily="Helvetica")
     qplot(x, y, geom="polygon", data = letter, fill=I("black"), alpha=I(0.8))+
    @@ -104,26 +102,22 @@ 

    Examples

    -
    - -
    +
    -
    +
    - diff --git a/docs/reference/logo.html b/docs/reference/logo.html index f239cc8..f830ef2 100644 --- a/docs/reference/logo.html +++ b/docs/reference/logo.html @@ -1,76 +1,74 @@ -Logo plot — logo • gglogoLogo plot — logo • gglogo + + Skip to contents -
    -
    -
    - + + +
    +
    +
    +
    -
    +

    Simple logo plot of sequences. For more complicated sequence logos, such as with treatment comparisons or subsets see geom_logo.

    -
    +
    +

    Usage

    logo(sequences)
    -
    -

    Arguments

    +
    +

    Arguments

    sequences

    vector of text sequences, for which consensus logo is to be shown

    -
    -

    Value

    +
    +

    Value

    ggplot2 object for simple sequence

    -
    -

    Examples

    +
    +

    Examples

    data(sequences)
     library(ggplot2)
     library(RColorBrewer)
    @@ -79,26 +77,22 @@ 

    Examples

    -
    - -
    +
    -
    +
    - diff --git a/docs/reference/mainPlusIslands.html b/docs/reference/mainPlusIslands.html index 1125ece..6441e3d 100644 --- a/docs/reference/mainPlusIslands.html +++ b/docs/reference/mainPlusIslands.html @@ -1,94 +1,88 @@ -Set the orientation of a polygon — mainPlusIslands • gglogoSet the orientation of a polygon — mainPlusIslands • gglogo + + Skip to contents -
    -
    -
    - + + +
    +
    +
    +
    -
    +

    Set the orientation of a polygon

    -
    +
    +

    Usage

    mainPlusIslands(imdf)
    -
    -

    Arguments

    +
    +

    Arguments

    imdf

    dataframe describing a pixellated image in x and y. Has to have columns x, y, and group

    -
    -

    Value

    +
    +

    Value

    reordered version of data frame imdf consistent with an assumption of group 1 being the main outline and any other groups being cutouts

    -
    - -
    +
    -
    +
    - diff --git a/docs/reference/point_line_dist.html b/docs/reference/point_line_dist.html index aca515e..a0da4e6 100644 --- a/docs/reference/point_line_dist.html +++ b/docs/reference/point_line_dist.html @@ -1,65 +1,64 @@ -Distance between point and line — point_line_dist • gglogoDistance between point and line — point_line_dist • gglogo + + Skip to contents -
    -
    -
    - + + +
    +
    +
    +
    -
    +

    Compute distance between point given as (px, py) and line spanned by points (lx1, ly1) and (lx2, ly2). From http://mathworld.wolfram.com/Point-LineDistance2-Dimensional.html

    -
    +
    +

    Usage

    point_line_dist(px, py, lx_1, ly_1, lx_2, ly_2)
    -
    -

    Arguments

    +
    +

    Arguments

    px

    x coordinate of point outside the

    @@ -85,26 +84,22 @@

    Arguments

    -
    - -
    +
    -
    +
    - diff --git a/docs/reference/position_logo.html b/docs/reference/position_logo.html index b28b3f8..50d428b 100644 --- a/docs/reference/position_logo.html +++ b/docs/reference/position_logo.html @@ -1,77 +1,78 @@ -Logo positioning for overlapping objects on top of one another. — position_logo • gglogoLogo positioning for overlapping objects on top of one another. — position_logo • gglogo + + Skip to contents -
    -
    -
    - + + +
    +
    +
    +
    -
    +

    position_classic is stacking objects in an ordered fashion from largest to smallest element, position_logo reverses the classic order and additionally shifts stacks downward to align the largest objects along their vertical minimum, position_fill additionally standardises each stack to have unit height.

    -
    +
    +

    Usage

    position_logo()
     
     position_classic()
    -
    -

    See also

    +
    +

    See also

    See geom_logo for more examples.

    -
    -

    Examples

    +
    +

    Examples

    # \donttest{
     library(ggplot2)
     data(sequences)
    @@ -91,26 +92,22 @@ 

    Examples

    # }
    -
    - -
    +
    -
    +
    - diff --git a/docs/reference/sequences.html b/docs/reference/sequences.html index 36d516c..3135046 100644 --- a/docs/reference/sequences.html +++ b/docs/reference/sequences.html @@ -1,88 +1,83 @@ -peptide sequence data — sequences • gglogopeptide sequence data — sequences • gglogo + + Skip to contents -
    -
    -
    - + + +
    +
    +
    +
    -
    +

    sequences showing the amino acid usage in the adenylate kinase lid available through biovis redesign contest 2013, see http://biovis.net/year/2013/info/redesign-contest published in Wong, B. Nat Methods 7, 889 (2011)

    -
    +
    +

    Usage

    data(sequences)
    -
    -

    Details

    +
    +

    Details

    Sequence data

    -
    - -
    +
    -
    +
    - diff --git a/docs/reference/simplifyPolygon.html b/docs/reference/simplifyPolygon.html index f2174d4..103497d 100644 --- a/docs/reference/simplifyPolygon.html +++ b/docs/reference/simplifyPolygon.html @@ -1,65 +1,64 @@ -Douglas-Peucker algorithm adjusted fo polyons — simplifyPolygon • gglogoDouglas-Peucker algorithm adjusted fo polyons — simplifyPolygon • gglogo + + Skip to contents -
    -
    -
    - + + +
    +
    +
    +
    -
    +

    Implementation of the Douglas-Peucker algorithm for line thinning http://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm

    -
    +
    +

    Usage

    simplifyPolygon(points, tol = 1)
    -
    -

    Arguments

    +
    +

    Arguments

    points

    matrix of x and y points

    @@ -69,26 +68,22 @@

    Arguments

    -
    - -
    +
    -
    +
    - diff --git a/docs/reference/simplify_rec.html b/docs/reference/simplify_rec.html index 001be58..5c49518 100644 --- a/docs/reference/simplify_rec.html +++ b/docs/reference/simplify_rec.html @@ -1,65 +1,64 @@ -Douglas Pecker algorithm for line thinning — simplify_rec • gglogoDouglas Pecker algorithm for line thinning — simplify_rec • gglogo + + Skip to contents -
    -
    -
    - + + +
    +
    +
    +
    -
    +

    Implementation of the Douglas-Peucker algorithm for line thinning http://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm

    -
    +
    +

    Usage

    simplify_rec(points, tol = 0.01)
    -
    -

    Arguments

    +
    +

    Arguments

    points

    matrix of x and y points

    @@ -69,26 +68,22 @@

    Arguments

    -
    - -
    +
    -
    +
    - diff --git a/docs/reference/splitSequence.html b/docs/reference/splitSequence.html index 8fb400b..5e7caca 100644 --- a/docs/reference/splitSequence.html +++ b/docs/reference/splitSequence.html @@ -1,63 +1,61 @@ -Reshape data set according to elements in sequences — splitSequence • gglogoReshape data set according to elements in sequences — splitSequence • gglogo + + Skip to contents -
    -
    -
    - + + +
    +
    +
    +
    -
    +

    prepare data set for plotting in a logo

    -
    +
    +

    Usage

    splitSequence(dframe, sequences)
    -
    -

    Arguments

    +
    +

    Arguments

    dframe

    data frame of peptide (or any other) sequences and some treatment factors

    @@ -67,32 +65,28 @@

    Arguments

    -
    -

    Examples

    +
    +

    Examples

    data(sequences)
     dm2 <- splitSequence(sequences, peptide)
     
    -
    - -
    +
    -
    +
    - diff --git a/docs/reference/stat_logo.html b/docs/reference/stat_logo.html index f1ba1e9..31c4db2 100644 --- a/docs/reference/stat_logo.html +++ b/docs/reference/stat_logo.html @@ -1,58 +1,56 @@ -Calculation of all pieces necessary to plot a logo sequence plot — StatLogo • gglogoCalculation of all pieces necessary to plot a logo sequence plot — StatLogo • gglogo + + Skip to contents -
    -
    -
    - + + +
    +
    +
    +
    -
    +

    Calculation of all pieces necessary to plot a logo sequence plot

    -
    +
    +

    Usage

    StatLogo
     
     stat_logo(
    @@ -68,12 +66,12 @@ 

    Calculation of all pieces necessary to plot a logo sequence plot

    )
    -
    -

    Format

    +
    +

    Format

    An object of class StatLogo (inherits from Stat, ggproto, gg) of length 4.

    -
    -

    Arguments

    +
    +

    Arguments

    mapping

    The aesthetic mapping, usually constructed with aes or aes_string. Only needs to be set at the layer level if you are overriding the plot defaults.

    @@ -110,8 +108,8 @@

    Arguments

    other arguments passed on to layer. This can include aesthetics whose values you want to set, not map. See layer for more details.

    -
    -

    Value

    +
    +

    Value

    proto object

    @@ -120,8 +118,8 @@

    Value

    A proto object

    -
    -

    Examples

    +
    +

    Examples

    # See geom_logo for examples
     # Generate data
     data(sequences)
    @@ -134,26 +132,22 @@ 

    Examples

    -
    - -
    +
    -
    +
    - diff --git a/docs/sitemap.xml b/docs/sitemap.xml index a10a567..eb49a9a 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -1,81 +1,81 @@ - /404.html + http://heike.github.io/gglogo/404.html - /authors.html + http://heike.github.io/gglogo/authors.html - /index.html + http://heike.github.io/gglogo/index.html - /news/index.html + http://heike.github.io/gglogo/news/index.html - /reference/aacids.html + http://heike.github.io/gglogo/reference/aacids.html - /reference/alphabet.html + http://heike.github.io/gglogo/reference/alphabet.html - /reference/calcInformation.html + http://heike.github.io/gglogo/reference/calcInformation.html - /reference/createPolygons.html + http://heike.github.io/gglogo/reference/createPolygons.html - /reference/determineOrder.html + http://heike.github.io/gglogo/reference/determineOrder.html - /reference/fortify.html + http://heike.github.io/gglogo/reference/fortify.html - /reference/geom_logo.html + http://heike.github.io/gglogo/reference/geom_logo.html - /reference/getOutline.html + http://heike.github.io/gglogo/reference/getOutline.html - /reference/ggfortify.html + http://heike.github.io/gglogo/reference/ggfortify.html - /reference/identifyParts.html + http://heike.github.io/gglogo/reference/identifyParts.html - /reference/index.html + http://heike.github.io/gglogo/reference/index.html - /reference/letterObject.html + http://heike.github.io/gglogo/reference/letterObject.html - /reference/letterToPolygon.html + http://heike.github.io/gglogo/reference/letterToPolygon.html - /reference/logo.html + http://heike.github.io/gglogo/reference/logo.html - /reference/mainPlusIslands.html + http://heike.github.io/gglogo/reference/mainPlusIslands.html - /reference/point_line_dist.html + http://heike.github.io/gglogo/reference/point_line_dist.html - /reference/position_logo.html + http://heike.github.io/gglogo/reference/position_logo.html - /reference/sequences.html + http://heike.github.io/gglogo/reference/sequences.html - /reference/simplifyPolygon.html + http://heike.github.io/gglogo/reference/simplifyPolygon.html - /reference/simplify_rec.html + http://heike.github.io/gglogo/reference/simplify_rec.html - /reference/splitSequence.html + http://heike.github.io/gglogo/reference/splitSequence.html - /reference/stat_logo.html + http://heike.github.io/gglogo/reference/stat_logo.html diff --git a/man/figures/unnamed-chunk-11-1.png b/man/figures/unnamed-chunk-11-1.png new file mode 100644 index 0000000..8f39897 Binary files /dev/null and b/man/figures/unnamed-chunk-11-1.png differ diff --git a/man/figures/unnamed-chunk-12-1.png b/man/figures/unnamed-chunk-12-1.png new file mode 100644 index 0000000..53b021d Binary files /dev/null and b/man/figures/unnamed-chunk-12-1.png differ diff --git a/man/figures/unnamed-chunk-13-1.png b/man/figures/unnamed-chunk-13-1.png new file mode 100644 index 0000000..f3a3d5e Binary files /dev/null and b/man/figures/unnamed-chunk-13-1.png differ diff --git a/man/figures/unnamed-chunk-13-2.png b/man/figures/unnamed-chunk-13-2.png new file mode 100644 index 0000000..e41b0cf Binary files /dev/null and b/man/figures/unnamed-chunk-13-2.png differ diff --git a/man/figures/unnamed-chunk-13-3.png b/man/figures/unnamed-chunk-13-3.png new file mode 100644 index 0000000..674ca3d Binary files /dev/null and b/man/figures/unnamed-chunk-13-3.png differ diff --git a/man/figures/unnamed-chunk-5-1.png b/man/figures/unnamed-chunk-5-1.png new file mode 100644 index 0000000..74063ec Binary files /dev/null and b/man/figures/unnamed-chunk-5-1.png differ diff --git a/man/figures/unnamed-chunk-6-1.png b/man/figures/unnamed-chunk-6-1.png new file mode 100644 index 0000000..b0c111b Binary files /dev/null and b/man/figures/unnamed-chunk-6-1.png differ diff --git a/man/figures/unnamed-chunk-7-1.png b/man/figures/unnamed-chunk-7-1.png new file mode 100644 index 0000000..cdc291a Binary files /dev/null and b/man/figures/unnamed-chunk-7-1.png differ diff --git a/man/figures/unnamed-chunk-8-1.png b/man/figures/unnamed-chunk-8-1.png new file mode 100644 index 0000000..74063ec Binary files /dev/null and b/man/figures/unnamed-chunk-8-1.png differ