diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/.nojekyll @@ -0,0 +1 @@ + diff --git a/404.html b/404.html index 6b5cdb4..d950afe 100644 --- a/404.html +++ b/404.html @@ -1,241 +1,106 @@ - + + + + + +Page not found (404) • ggsc + + + + + + + + + + + +
+
+ - - - - - + - - - - - +
+
+ +Content not found. Please use links in the navbar. +
- + - - - - - +
- - - - - - - - - - - - - - - - - - - - - - - - - - +
- - - - + - - - - - - - - - - - - - + + diff --git a/articles/ggsc.html b/articles/ggsc.html new file mode 100644 index 0000000..503034b --- /dev/null +++ b/articles/ggsc.html @@ -0,0 +1,120 @@ + + + + + + + +Visualizing single cell data • ggsc + + + + + + + + + + + + +
+
+ + + + +
+
+ + + + +

Please go to https://yulab-smu.top/ggsc/ for the full vignette.

+
+ + + +
+ + + + +
+ + + + + + + + diff --git a/articles/index.html b/articles/index.html new file mode 100644 index 0000000..74e6fd6 --- /dev/null +++ b/articles/index.html @@ -0,0 +1,79 @@ + +Articles • ggsc + + +
+
+ + + +
+
+ + +
+

All vignettes

+

+ +
Visualizing single cell data
+
+
+
+
+ + +
+ + + + + + + + diff --git a/authors.html b/authors.html new file mode 100644 index 0000000..9dda268 --- /dev/null +++ b/authors.html @@ -0,0 +1,105 @@ + +Authors and Citation • ggsc + + +
+
+ + + +
+
+
+ + + +
  • +

    Guangchuang Yu. Author, maintainer, copyright holder. +

    +
  • +
  • +

    Shuangbin Xu. Author. +

    +
  • +
+
+
+

Citation

+ Source: DESCRIPTION +
+
+ + +

Yu G, Xu S (2023). +ggsc: Visualizing Single Cell Data. +R package version 1.1.1.003, https://yulab-smu.top/ggsc/ (docs), https://github.com/YuLab-SMU/ggsc (devel). +

+
@Manual{,
+  title = {ggsc: Visualizing Single Cell Data},
+  author = {Guangchuang Yu and Shuangbin Xu},
+  year = {2023},
+  note = {R package version 1.1.1.003, https://yulab-smu.top/ggsc/ (docs)},
+  url = {https://github.com/YuLab-SMU/ggsc (devel)},
+}
+ +
+ +
+ + + +
+ + + + + + + + diff --git a/bootstrap-toc.css b/bootstrap-toc.css new file mode 100644 index 0000000..5a85941 --- /dev/null +++ b/bootstrap-toc.css @@ -0,0 +1,60 @@ +/*! + * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) + * Copyright 2015 Aidan Feldman + * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ + +/* modified from https://github.com/twbs/bootstrap/blob/94b4076dd2efba9af71f0b18d4ee4b163aa9e0dd/docs/assets/css/src/docs.css#L548-L601 */ + +/* All levels of nav */ +nav[data-toggle='toc'] .nav > li > a { + display: block; + padding: 4px 20px; + font-size: 13px; + font-weight: 500; + color: #767676; +} +nav[data-toggle='toc'] .nav > li > a:hover, +nav[data-toggle='toc'] .nav > li > a:focus { + padding-left: 19px; + color: #563d7c; + text-decoration: none; + background-color: transparent; + border-left: 1px solid #563d7c; +} +nav[data-toggle='toc'] .nav > .active > a, +nav[data-toggle='toc'] .nav > .active:hover > a, +nav[data-toggle='toc'] .nav > .active:focus > a { + padding-left: 18px; + font-weight: bold; + color: #563d7c; + background-color: transparent; + border-left: 2px solid #563d7c; +} + +/* Nav: second level (shown on .active) */ +nav[data-toggle='toc'] .nav .nav { + display: none; /* Hide by default, but at >768px, show it */ + padding-bottom: 10px; +} +nav[data-toggle='toc'] .nav .nav > li > a { + padding-top: 1px; + padding-bottom: 1px; + padding-left: 30px; + font-size: 12px; + font-weight: normal; +} +nav[data-toggle='toc'] .nav .nav > li > a:hover, +nav[data-toggle='toc'] .nav .nav > li > a:focus { + padding-left: 29px; +} +nav[data-toggle='toc'] .nav .nav > .active > a, +nav[data-toggle='toc'] .nav .nav > .active:hover > a, +nav[data-toggle='toc'] .nav .nav > .active:focus > a { + padding-left: 28px; + font-weight: 500; +} + +/* from https://github.com/twbs/bootstrap/blob/e38f066d8c203c3e032da0ff23cd2d6098ee2dd6/docs/assets/css/src/docs.css#L631-L634 */ +nav[data-toggle='toc'] .nav > .active > ul { + display: block; +} diff --git a/bootstrap-toc.js b/bootstrap-toc.js new file mode 100644 index 0000000..1cdd573 --- /dev/null +++ b/bootstrap-toc.js @@ -0,0 +1,159 @@ +/*! + * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) + * Copyright 2015 Aidan Feldman + * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ +(function() { + 'use strict'; + + window.Toc = { + helpers: { + // return all matching elements in the set, or their descendants + findOrFilter: function($el, selector) { + // http://danielnouri.org/notes/2011/03/14/a-jquery-find-that-also-finds-the-root-element/ + // http://stackoverflow.com/a/12731439/358804 + var $descendants = $el.find(selector); + return $el.filter(selector).add($descendants).filter(':not([data-toc-skip])'); + }, + + generateUniqueIdBase: function(el) { + var text = $(el).text(); + var anchor = text.trim().toLowerCase().replace(/[^A-Za-z0-9]+/g, '-'); + return anchor || el.tagName.toLowerCase(); + }, + + generateUniqueId: function(el) { + var anchorBase = this.generateUniqueIdBase(el); + for (var i = 0; ; i++) { + var anchor = anchorBase; + if (i > 0) { + // add suffix + anchor += '-' + i; + } + // check if ID already exists + if (!document.getElementById(anchor)) { + return anchor; + } + } + }, + + generateAnchor: function(el) { + if (el.id) { + return el.id; + } else { + var anchor = this.generateUniqueId(el); + el.id = anchor; + return anchor; + } + }, + + createNavList: function() { + return $(''); + }, + + createChildNavList: function($parent) { + var $childList = this.createNavList(); + $parent.append($childList); + return $childList; + }, + + generateNavEl: function(anchor, text) { + var $a = $(''); + $a.attr('href', '#' + anchor); + $a.text(text); + var $li = $('
  • '); + $li.append($a); + return $li; + }, + + generateNavItem: function(headingEl) { + var anchor = this.generateAnchor(headingEl); + var $heading = $(headingEl); + var text = $heading.data('toc-text') || $heading.text(); + return this.generateNavEl(anchor, text); + }, + + // Find the first heading level (`

    `, then `

    `, etc.) that has more than one element. Defaults to 1 (for `

    `). + getTopLevel: function($scope) { + for (var i = 1; i <= 6; i++) { + var $headings = this.findOrFilter($scope, 'h' + i); + if ($headings.length > 1) { + return i; + } + } + + return 1; + }, + + // returns the elements for the top level, and the next below it + getHeadings: function($scope, topLevel) { + var topSelector = 'h' + topLevel; + + var secondaryLevel = topLevel + 1; + var secondarySelector = 'h' + secondaryLevel; + + return this.findOrFilter($scope, topSelector + ',' + secondarySelector); + }, + + getNavLevel: function(el) { + return parseInt(el.tagName.charAt(1), 10); + }, + + populateNav: function($topContext, topLevel, $headings) { + var $context = $topContext; + var $prevNav; + + var helpers = this; + $headings.each(function(i, el) { + var $newNav = helpers.generateNavItem(el); + var navLevel = helpers.getNavLevel(el); + + // determine the proper $context + if (navLevel === topLevel) { + // use top level + $context = $topContext; + } else if ($prevNav && $context === $topContext) { + // create a new level of the tree and switch to it + $context = helpers.createChildNavList($prevNav); + } // else use the current $context + + $context.append($newNav); + + $prevNav = $newNav; + }); + }, + + parseOps: function(arg) { + var opts; + if (arg.jquery) { + opts = { + $nav: arg + }; + } else { + opts = arg; + } + opts.$scope = opts.$scope || $(document.body); + return opts; + } + }, + + // accepts a jQuery object, or an options object + init: function(opts) { + opts = this.helpers.parseOps(opts); + + // ensure that the data attribute is in place for styling + opts.$nav.attr('data-toggle', 'toc'); + + var $topContext = this.helpers.createChildNavList(opts.$nav); + var topLevel = this.helpers.getTopLevel(opts.$scope); + var $headings = this.helpers.getHeadings(opts.$scope, topLevel); + this.helpers.populateNav($topContext, topLevel, $headings); + } + }; + + $(function() { + $('nav[data-toggle="toc"]').each(function(i, el) { + var $nav = $(el); + Toc.init($nav); + }); + }); +})(); diff --git a/docsearch.css b/docsearch.css new file mode 100644 index 0000000..e5f1fe1 --- /dev/null +++ b/docsearch.css @@ -0,0 +1,148 @@ +/* Docsearch -------------------------------------------------------------- */ +/* + Source: https://github.com/algolia/docsearch/ + License: MIT +*/ + +.algolia-autocomplete { + display: block; + -webkit-box-flex: 1; + -ms-flex: 1; + flex: 1 +} + +.algolia-autocomplete .ds-dropdown-menu { + width: 100%; + min-width: none; + max-width: none; + padding: .75rem 0; + background-color: #fff; + background-clip: padding-box; + border: 1px solid rgba(0, 0, 0, .1); + box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .175); +} + +@media (min-width:768px) { + .algolia-autocomplete .ds-dropdown-menu { + width: 175% + } +} + +.algolia-autocomplete .ds-dropdown-menu::before { + display: none +} + +.algolia-autocomplete .ds-dropdown-menu [class^=ds-dataset-] { + padding: 0; + background-color: rgb(255,255,255); + border: 0; + max-height: 80vh; +} + +.algolia-autocomplete .ds-dropdown-menu .ds-suggestions { + margin-top: 0 +} + +.algolia-autocomplete .algolia-docsearch-suggestion { + padding: 0; + overflow: visible +} + +.algolia-autocomplete .algolia-docsearch-suggestion--category-header { + padding: .125rem 1rem; + margin-top: 0; + font-size: 1.3em; + font-weight: 500; + color: #00008B; + border-bottom: 0 +} + +.algolia-autocomplete .algolia-docsearch-suggestion--wrapper { + float: none; + padding-top: 0 +} + +.algolia-autocomplete .algolia-docsearch-suggestion--subcategory-column { + float: none; + width: auto; + padding: 0; + text-align: left +} + +.algolia-autocomplete .algolia-docsearch-suggestion--content { + float: none; + width: auto; + padding: 0 +} + +.algolia-autocomplete .algolia-docsearch-suggestion--content::before { + display: none +} + +.algolia-autocomplete .ds-suggestion:not(:first-child) .algolia-docsearch-suggestion--category-header { + padding-top: .75rem; + margin-top: .75rem; + border-top: 1px solid rgba(0, 0, 0, .1) +} + +.algolia-autocomplete .ds-suggestion .algolia-docsearch-suggestion--subcategory-column { + display: block; + padding: .1rem 1rem; + margin-bottom: 0.1; + font-size: 1.0em; + font-weight: 400 + /* display: none */ +} + +.algolia-autocomplete .algolia-docsearch-suggestion--title { + display: block; + padding: .25rem 1rem; + margin-bottom: 0; + font-size: 0.9em; + font-weight: 400 +} + +.algolia-autocomplete .algolia-docsearch-suggestion--text { + padding: 0 1rem .5rem; + margin-top: -.25rem; + font-size: 0.8em; + font-weight: 400; + line-height: 1.25 +} + +.algolia-autocomplete .algolia-docsearch-footer { + width: 110px; + height: 20px; + z-index: 3; + margin-top: 10.66667px; + float: right; + font-size: 0; + line-height: 0; +} + +.algolia-autocomplete .algolia-docsearch-footer--logo { + background-image: url("data:image/svg+xml;utf8,"); + background-repeat: no-repeat; + background-position: 50%; + background-size: 100%; + overflow: hidden; + text-indent: -9000px; + width: 100%; + height: 100%; + display: block; + transform: translate(-8px); +} + +.algolia-autocomplete .algolia-docsearch-suggestion--highlight { + color: #FF8C00; + background: rgba(232, 189, 54, 0.1) +} + + +.algolia-autocomplete .algolia-docsearch-suggestion--text .algolia-docsearch-suggestion--highlight { + box-shadow: inset 0 -2px 0 0 rgba(105, 105, 105, .5) +} + +.algolia-autocomplete .ds-suggestion.ds-cursor .algolia-docsearch-suggestion--content { + background-color: rgba(192, 192, 192, .15) +} diff --git a/docsearch.js b/docsearch.js new file mode 100644 index 0000000..b35504c --- /dev/null +++ b/docsearch.js @@ -0,0 +1,85 @@ +$(function() { + + // register a handler to move the focus to the search bar + // upon pressing shift + "/" (i.e. "?") + $(document).on('keydown', function(e) { + if (e.shiftKey && e.keyCode == 191) { + e.preventDefault(); + $("#search-input").focus(); + } + }); + + $(document).ready(function() { + // do keyword highlighting + /* modified from https://jsfiddle.net/julmot/bL6bb5oo/ */ + var mark = function() { + + var referrer = document.URL ; + var paramKey = "q" ; + + if (referrer.indexOf("?") !== -1) { + var qs = referrer.substr(referrer.indexOf('?') + 1); + var qs_noanchor = qs.split('#')[0]; + var qsa = qs_noanchor.split('&'); + var keyword = ""; + + for (var i = 0; i < qsa.length; i++) { + var currentParam = qsa[i].split('='); + + if (currentParam.length !== 2) { + continue; + } + + if (currentParam[0] == paramKey) { + keyword = decodeURIComponent(currentParam[1].replace(/\+/g, "%20")); + } + } + + if (keyword !== "") { + $(".contents").unmark({ + done: function() { + $(".contents").mark(keyword); + } + }); + } + } + }; + + mark(); + }); +}); + +/* Search term highlighting ------------------------------*/ + +function matchedWords(hit) { + var words = []; + + var hierarchy = hit._highlightResult.hierarchy; + // loop to fetch from lvl0, lvl1, etc. + for (var idx in hierarchy) { + words = words.concat(hierarchy[idx].matchedWords); + } + + var content = hit._highlightResult.content; + if (content) { + words = words.concat(content.matchedWords); + } + + // return unique words + var words_uniq = [...new Set(words)]; + return words_uniq; +} + +function updateHitURL(hit) { + + var words = matchedWords(hit); + var url = ""; + + if (hit.anchor) { + url = hit.url_without_anchor + '?q=' + escape(words.join(" ")) + '#' + hit.anchor; + } else { + url = hit.url + '?q=' + escape(words.join(" ")); + } + + return url; +} diff --git a/index.html b/index.html index f8aa95c..7f11fcc 100644 --- a/index.html +++ b/index.html @@ -1,249 +1,188 @@ - + + + + + +Visualizing Single Cell Data • ggsc + + + + + + + + + + + + +
    +
    + + + + +
    +
    +
    + +

    +README updated: 2023-11-29 + +

    + +

    License: Artistic-2.0
    R build status

    + +
    +

    +ggsc: Visualizing Single Cell Data +

    +
    +

    Useful functions to visualize single cell and spatial data. It supports both ‘SingleCellExperiment’ and ‘Seurat’ objects. It also supports visualizing the data using grammar of graphics implemented in ‘ggplot2’. +

    +
    +
    +
    +

    +✍️ Authors +

    +

    Guangchuang YU

    +

    School of Basic Medical Sciences, Southern Medical University

    +

    https://yulab-smu.top

    + + + +
    +
    +

    + Installation +

    +
    +if(!require("remotes")) install.packages("remotes")
    +
    +remotes::install_github("https://github.com/YuLab-SMU/ggsc (devel), https://yulab-smu.top/ggsc/ (docs)")
    +library(ggsc)
    +
    +
    +

    Documentation +

    +
    +

    +Website +

    +


    +
    +
    +
    +
    + -
    -
    - -
    -
    +
    -
    -
    - -
    -
    -
    + - -
    -
    - - - - - - - - - - - + + + diff --git a/link.svg b/link.svg new file mode 100644 index 0000000..88ad827 --- /dev/null +++ b/link.svg @@ -0,0 +1,12 @@ + + + + + + diff --git a/news/index.html b/news/index.html new file mode 100644 index 0000000..2e6f057 --- /dev/null +++ b/news/index.html @@ -0,0 +1,116 @@ + +Changelog • ggsc + + +
    +
    + + + +
    +
    + + +
    + +
    • add sc_dot() method for ‘Seurat’ object (2023-11-29, Wed, #15)
    • +
    • update vignette to link to the online docs (https://yulab-smu.top/ggsc)
    • +
    • add README.Rmd and README.md in github repo
    • +
    • optimization: retrieve embedding without FetchData (2023-11-27, Mon, #14)
    • +
    • bug fixed for Seurat object (2023-10-31, Tue, #12, #13)
    • +
    +
    + +
    • ignore the tissue section when image is not exist (2023-10-31, Tue, #12)
    • +
    • introduce joint to combine all features with joint.fun and speed up calculation of kde using RcppParallel (2023-10-25, Wed, #11)
    • +
    +
    + +
    • Bioconductor RELEASE_3_18 (2023-10-25, Wed)
    • +
    +
    + +
    • support density visualization for single and spatial transcriptomic data (2023-10-18, Wed)
    • +
    +
    + +
    • on Bioconductor (2023-10-16, Mon)
    • +
    • add \value session in the reexports.Rd (2023-10-15, Sun)
    • +
    • add package level man page and update vignette (2023-10-14, Sat)
    • +
    • add examples in Rd to satisfy BiocCheck (2023-09-18, Mon, #7)
    • +
    • +sc_dim_count() function to generate a barplot from a dimension reduction plot (sc_dim() plot) to visualize the number of cells for each clusters (2023-09-13, Wed)
    • +
    • add ‘biocViews’ in DESCRIPTION required by Bioconductor
    • +
    +
    + +
    • compatible with ‘SingleCellExperiment’ (2023-09-05, Tue, #5)
    • +
    • using S4 OOP to reorganize the functions (2023-09-05, Tue, #4)
    • +
    • rename the package to ‘ggsc’ as there is a package called ‘scplot’ in CRAN
    • +
    • add H&E image to sc_spatial() (#3)
    • +
    +
    + + + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.7.

    +
    + +
    + + + + + + + + diff --git a/pkgdown.css b/pkgdown.css new file mode 100644 index 0000000..80ea5b8 --- /dev/null +++ b/pkgdown.css @@ -0,0 +1,384 @@ +/* Sticky footer */ + +/** + * Basic idea: https://philipwalton.github.io/solved-by-flexbox/demos/sticky-footer/ + * Details: https://github.com/philipwalton/solved-by-flexbox/blob/master/assets/css/components/site.css + * + * .Site -> body > .container + * .Site-content -> body > .container .row + * .footer -> footer + * + * Key idea seems to be to ensure that .container and __all its parents__ + * have height set to 100% + * + */ + +html, body { + height: 100%; +} + +body { + position: relative; +} + +body > .container { + display: flex; + height: 100%; + flex-direction: column; +} + +body > .container .row { + flex: 1 0 auto; +} + +footer { + margin-top: 45px; + padding: 35px 0 36px; + border-top: 1px solid #e5e5e5; + color: #666; + display: flex; + flex-shrink: 0; +} +footer p { + margin-bottom: 0; +} +footer div { + flex: 1; +} +footer .pkgdown { + text-align: right; +} +footer p { + margin-bottom: 0; +} + +img.icon { + float: right; +} + +/* Ensure in-page images don't run outside their container */ +.contents img { + max-width: 100%; + height: auto; +} + +/* Fix bug in bootstrap (only seen in firefox) */ +summary { + display: list-item; +} + +/* Typographic tweaking ---------------------------------*/ + +.contents .page-header { + margin-top: calc(-60px + 1em); +} + +dd { + margin-left: 3em; +} + +/* Section anchors ---------------------------------*/ + +a.anchor { + display: none; + margin-left: 5px; + width: 20px; + height: 20px; + + background-image: url(./link.svg); + background-repeat: no-repeat; + background-size: 20px 20px; + background-position: center center; +} + +h1:hover .anchor, +h2:hover .anchor, +h3:hover .anchor, +h4:hover .anchor, +h5:hover .anchor, +h6:hover .anchor { + display: inline-block; +} + +/* Fixes for fixed navbar --------------------------*/ + +.contents h1, .contents h2, .contents h3, .contents h4 { + padding-top: 60px; + margin-top: -40px; +} + +/* Navbar submenu --------------------------*/ + +.dropdown-submenu { + position: relative; +} + +.dropdown-submenu>.dropdown-menu { + top: 0; + left: 100%; + margin-top: -6px; + margin-left: -1px; + border-radius: 0 6px 6px 6px; +} + +.dropdown-submenu:hover>.dropdown-menu { + display: block; +} + +.dropdown-submenu>a:after { + display: block; + content: " "; + float: right; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; + border-width: 5px 0 5px 5px; + border-left-color: #cccccc; + margin-top: 5px; + margin-right: -10px; +} + +.dropdown-submenu:hover>a:after { + border-left-color: #ffffff; +} + +.dropdown-submenu.pull-left { + float: none; +} + +.dropdown-submenu.pull-left>.dropdown-menu { + left: -100%; + margin-left: 10px; + border-radius: 6px 0 6px 6px; +} + +/* Sidebar --------------------------*/ + +#pkgdown-sidebar { + margin-top: 30px; + position: -webkit-sticky; + position: sticky; + top: 70px; +} + +#pkgdown-sidebar h2 { + font-size: 1.5em; + margin-top: 1em; +} + +#pkgdown-sidebar h2:first-child { + margin-top: 0; +} + +#pkgdown-sidebar .list-unstyled li { + margin-bottom: 0.5em; +} + +/* bootstrap-toc tweaks ------------------------------------------------------*/ + +/* All levels of nav */ + +nav[data-toggle='toc'] .nav > li > a { + padding: 4px 20px 4px 6px; + font-size: 1.5rem; + font-weight: 400; + color: inherit; +} + +nav[data-toggle='toc'] .nav > li > a:hover, +nav[data-toggle='toc'] .nav > li > a:focus { + padding-left: 5px; + color: inherit; + border-left: 1px solid #878787; +} + +nav[data-toggle='toc'] .nav > .active > a, +nav[data-toggle='toc'] .nav > .active:hover > a, +nav[data-toggle='toc'] .nav > .active:focus > a { + padding-left: 5px; + font-size: 1.5rem; + font-weight: 400; + color: inherit; + border-left: 2px solid #878787; +} + +/* Nav: second level (shown on .active) */ + +nav[data-toggle='toc'] .nav .nav { + display: none; /* Hide by default, but at >768px, show it */ + padding-bottom: 10px; +} + +nav[data-toggle='toc'] .nav .nav > li > a { + padding-left: 16px; + font-size: 1.35rem; +} + +nav[data-toggle='toc'] .nav .nav > li > a:hover, +nav[data-toggle='toc'] .nav .nav > li > a:focus { + padding-left: 15px; +} + +nav[data-toggle='toc'] .nav .nav > .active > a, +nav[data-toggle='toc'] .nav .nav > .active:hover > a, +nav[data-toggle='toc'] .nav .nav > .active:focus > a { + padding-left: 15px; + font-weight: 500; + font-size: 1.35rem; +} + +/* orcid ------------------------------------------------------------------- */ + +.orcid { + font-size: 16px; + color: #A6CE39; + /* margins are required by official ORCID trademark and display guidelines */ + margin-left:4px; + margin-right:4px; + vertical-align: middle; +} + +/* Reference index & topics ----------------------------------------------- */ + +.ref-index th {font-weight: normal;} + +.ref-index td {vertical-align: top; min-width: 100px} +.ref-index .icon {width: 40px;} +.ref-index .alias {width: 40%;} +.ref-index-icons .alias {width: calc(40% - 40px);} +.ref-index .title {width: 60%;} + +.ref-arguments th {text-align: right; padding-right: 10px;} +.ref-arguments th, .ref-arguments td {vertical-align: top; min-width: 100px} +.ref-arguments .name {width: 20%;} +.ref-arguments .desc {width: 80%;} + +/* Nice scrolling for wide elements --------------------------------------- */ + +table { + display: block; + overflow: auto; +} + +/* Syntax highlighting ---------------------------------------------------- */ + +pre, code, pre code { + background-color: #f8f8f8; + color: #333; +} +pre, pre code { + white-space: pre-wrap; + word-break: break-all; + overflow-wrap: break-word; +} + +pre { + border: 1px solid #eee; +} + +pre .img, pre .r-plt { + margin: 5px 0; +} + +pre .img img, pre .r-plt img { + background-color: #fff; +} + +code a, pre a { + color: #375f84; +} + +a.sourceLine:hover { + text-decoration: none; +} + +.fl {color: #1514b5;} +.fu {color: #000000;} /* function */ +.ch,.st {color: #036a07;} /* string */ +.kw {color: #264D66;} /* keyword */ +.co {color: #888888;} /* comment */ + +.error {font-weight: bolder;} +.warning {font-weight: bolder;} + +/* Clipboard --------------------------*/ + +.hasCopyButton { + position: relative; +} + +.btn-copy-ex { + position: absolute; + right: 0; + top: 0; + visibility: hidden; +} + +.hasCopyButton:hover button.btn-copy-ex { + visibility: visible; +} + +/* headroom.js ------------------------ */ + +.headroom { + will-change: transform; + transition: transform 200ms linear; +} +.headroom--pinned { + transform: translateY(0%); +} +.headroom--unpinned { + transform: translateY(-100%); +} + +/* mark.js ----------------------------*/ + +mark { + background-color: rgba(255, 255, 51, 0.5); + border-bottom: 2px solid rgba(255, 153, 51, 0.3); + padding: 1px; +} + +/* vertical spacing after htmlwidgets */ +.html-widget { + margin-bottom: 10px; +} + +/* fontawesome ------------------------ */ + +.fab { + font-family: "Font Awesome 5 Brands" !important; +} + +/* don't display links in code chunks when printing */ +/* source: https://stackoverflow.com/a/10781533 */ +@media print { + code a:link:after, code a:visited:after { + content: ""; + } +} + +/* Section anchors --------------------------------- + Added in pandoc 2.11: https://github.com/jgm/pandoc-templates/commit/9904bf71 +*/ + +div.csl-bib-body { } +div.csl-entry { + clear: both; +} +.hanging-indent div.csl-entry { + margin-left:2em; + text-indent:-2em; +} +div.csl-left-margin { + min-width:2em; + float:left; +} +div.csl-right-inline { + margin-left:2em; + padding-left:1em; +} +div.csl-indent { + margin-left: 2em; +} diff --git a/pkgdown.js b/pkgdown.js new file mode 100644 index 0000000..6f0eee4 --- /dev/null +++ b/pkgdown.js @@ -0,0 +1,108 @@ +/* http://gregfranko.com/blog/jquery-best-practices/ */ +(function($) { + $(function() { + + $('.navbar-fixed-top').headroom(); + + $('body').css('padding-top', $('.navbar').height() + 10); + $(window).resize(function(){ + $('body').css('padding-top', $('.navbar').height() + 10); + }); + + $('[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); + } + + for (var i = 0; i < haystack.length; i++) { + if (needle[i] != haystack[i]) + return(i); + } + + return(haystack.length); + } + + /* Clipboard --------------------------*/ + + function changeTooltipMessage(element, msg) { + var tooltipOriginalTitle=element.getAttribute('data-original-title'); + element.setAttribute('data-original-title', msg); + $(element).tooltip('show'); + element.setAttribute('data-original-title', tooltipOriginalTitle); + } + + if(ClipboardJS.isSupported()) { + $(document).ready(function() { + var copyButton = ""; + + $("div.sourceCode").addClass("hasCopyButton"); + + // Insert copy buttons: + $(copyButton).prependTo(".hasCopyButton"); + + // Initialize tooltips: + $('.btn-copy-ex').tooltip({container: 'body'}); + + // Initialize clipboard: + var clipboardBtnCopies = new ClipboardJS('[data-clipboard-copy]', { + text: function(trigger) { + return trigger.parentNode.textContent.replace(/\n#>[^\n]*/g, ""); + } + }); + + clipboardBtnCopies.on('success', function(e) { + changeTooltipMessage(e.trigger, 'Copied!'); + e.clearSelection(); + }); + + clipboardBtnCopies.on('error', function() { + changeTooltipMessage(e.trigger,'Press Ctrl+C or Command+C to copy'); + }); + }); + } +})(window.jQuery || window.$) diff --git a/pkgdown.yml b/pkgdown.yml new file mode 100644 index 0000000..8f6e0f7 --- /dev/null +++ b/pkgdown.yml @@ -0,0 +1,7 @@ +pandoc: 3.1.1 +pkgdown: 2.0.7 +pkgdown_sha: ~ +articles: + ggsc: ggsc.html +last_built: 2023-11-29T08:38Z + diff --git a/reference/CalWkdeCpp.html b/reference/CalWkdeCpp.html new file mode 100644 index 0000000..6e8d45d --- /dev/null +++ b/reference/CalWkdeCpp.html @@ -0,0 +1,113 @@ + +Two-Dimensional Weighted Kernel Density Estimation And Mapping the Result To Original Dimension — CalWkdeCpp • ggsc + + +
    +
    + + + +
    +
    + + +
    +

    Two-Dimensional Weighted Kernel Density Estimation And Mapping the Result To Original Dimension

    +
    + +
    +
    CalWkdeCpp(x, w, l, h, adjust = 1, n = 400L)
    +
    + +
    +

    Arguments

    +
    x
    +

    The 2-D coordinate matrix

    + + +
    w
    +

    The weighted sparse matrix, the number columns the same than the number rows than x.

    + + +
    l
    +

    The limits of the rectangle covered by the grid as c(xl, xu, yl, yu)

    + + +
    h
    +

    The vector of bandwidths for x and y directions, defaults to normal reference bandwidth +(see bandwidth.nrd), A scalar value will be taken to apply to both directions (see ks::hpi).

    + + +
    adjust
    +

    numeric value to adjust to bandwidth, default is 1.

    + + +
    n
    +

    number of grid points in the two directions, default is 400.

    + +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.7.

    +
    + +
    + + + + + + + + diff --git a/reference/Rplot001.png b/reference/Rplot001.png new file mode 100644 index 0000000..6f96d6e Binary files /dev/null and b/reference/Rplot001.png differ diff --git a/reference/Rplot002.png b/reference/Rplot002.png new file mode 100644 index 0000000..3cfe016 Binary files /dev/null and b/reference/Rplot002.png differ diff --git a/reference/Rplot003.png b/reference/Rplot003.png new file mode 100644 index 0000000..dbfe2e6 Binary files /dev/null and b/reference/Rplot003.png differ diff --git a/reference/ggsc-package.html b/reference/ggsc-package.html new file mode 100644 index 0000000..a252ca1 --- /dev/null +++ b/reference/ggsc-package.html @@ -0,0 +1,94 @@ + +ggsc: Visualizing Single Cell Data — ggsc-package • ggsc + + +
    +
    + + + +
    +
    + + +
    +

    Useful functions to visualize single cell and spatial data. It supports both 'SingleCellExperiment' and 'Seurat' objects. It also supports visualizing the data using grammar of graphics implemented in 'ggplot2'.

    +
    + + +
    +

    See also

    + +
    +
    +

    Author

    +

    Maintainer: Guangchuang Yu guangchuangyu@gmail.com (ORCID) [copyright holder]

    +

    Authors:

    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.7.

    +
    + +
    + + + + + + + + diff --git a/reference/index.html b/reference/index.html new file mode 100644 index 0000000..436c41d --- /dev/null +++ b/reference/index.html @@ -0,0 +1,132 @@ + +Function reference • ggsc + + +
    +
    + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +

    All functions

    +

    +
    +

    CalWkdeCpp()

    +

    Two-Dimensional Weighted Kernel Density Estimation And Mapping the Result To Original Dimension

    +

    sc_dim_count()

    +

    sc_dim_count

    +

    sc_dim_geom_ellipse()

    +

    sc_dim_geom_ellipse

    +

    sc_dim_geom_feature()

    +

    sc_dim_geom_feature

    +

    sc_dim_geom_label()

    +

    sc_dim_geom_label

    +

    sc_dim_geom_sub()

    +

    sc_dim_geom_subset

    +

    sc_dim()

    +

    sc_dim

    +

    sc_dim_sub()

    +

    sc_dim_sub

    +

    sc_dot()

    +

    sc_dot

    +

    sc_feature()

    +

    sc_feature

    +

    sc_geom_point()

    +

    sc_geom_point

    +

    sc_spatial()

    +

    sc_spatial

    +

    sc_violin()

    +

    sc_violin

    + + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.7.

    +
    + +
    + + + + + + + + diff --git a/reference/reexports.html b/reference/reexports.html new file mode 100644 index 0000000..cfdd63a --- /dev/null +++ b/reference/reexports.html @@ -0,0 +1,101 @@ + +Objects exported from other packages — reexports • ggsc + + +
    +
    + + + +
    +
    + + +
    +

    These objects are imported from other packages. Follow the links +below to see their documentation.

    +
    ggplot2
    +

    aes, theme

    + + +
    + + +
    +

    Value

    + + +

    Depending on the re-exported function

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.7.

    +
    + +
    + + + + + + + + diff --git a/reference/sc-dim-count.html b/reference/sc-dim-count.html new file mode 100644 index 0000000..d9b47a9 --- /dev/null +++ b/reference/sc-dim-count.html @@ -0,0 +1,188 @@ + +sc_dim_count — sc_dim_count • ggsc + + +
    +
    + + + +
    +
    + + +
    +

    sc_dim_count

    +
    + +
    +
    sc_dim_count(sc_dim_plot)
    +
    + +
    +

    Arguments

    +
    sc_dim_plot
    +

    dimension reduction plot of single cell data

    + +
    +
    +

    Value

    + + +

    a bar plot to present the cell numbers of different clusters

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
    library(scuttle)
    +#> Loading required package: SingleCellExperiment
    +#> Loading required package: SummarizedExperiment
    +#> Loading required package: MatrixGenerics
    +#> Loading required package: matrixStats
    +#> 
    +#> Attaching package: ‘MatrixGenerics’
    +#> The following objects are masked from ‘package:matrixStats’:
    +#> 
    +#>     colAlls, colAnyNAs, colAnys, colAvgsPerRowSet, colCollapse,
    +#>     colCounts, colCummaxs, colCummins, colCumprods, colCumsums,
    +#>     colDiffs, colIQRDiffs, colIQRs, colLogSumExps, colMadDiffs,
    +#>     colMads, colMaxs, colMeans2, colMedians, colMins, colOrderStats,
    +#>     colProds, colQuantiles, colRanges, colRanks, colSdDiffs, colSds,
    +#>     colSums2, colTabulates, colVarDiffs, colVars, colWeightedMads,
    +#>     colWeightedMeans, colWeightedMedians, colWeightedSds,
    +#>     colWeightedVars, rowAlls, rowAnyNAs, rowAnys, rowAvgsPerColSet,
    +#>     rowCollapse, rowCounts, rowCummaxs, rowCummins, rowCumprods,
    +#>     rowCumsums, rowDiffs, rowIQRDiffs, rowIQRs, rowLogSumExps,
    +#>     rowMadDiffs, rowMads, rowMaxs, rowMeans2, rowMedians, rowMins,
    +#>     rowOrderStats, rowProds, rowQuantiles, rowRanges, rowRanks,
    +#>     rowSdDiffs, rowSds, rowSums2, rowTabulates, rowVarDiffs, rowVars,
    +#>     rowWeightedMads, rowWeightedMeans, rowWeightedMedians,
    +#>     rowWeightedSds, rowWeightedVars
    +#> Loading required package: GenomicRanges
    +#> Loading required package: stats4
    +#> Loading required package: BiocGenerics
    +#> 
    +#> Attaching package: ‘BiocGenerics’
    +#> The following objects are masked from ‘package:stats’:
    +#> 
    +#>     IQR, mad, sd, var, xtabs
    +#> The following objects are masked from ‘package:base’:
    +#> 
    +#>     Filter, Find, Map, Position, Reduce, anyDuplicated, aperm, append,
    +#>     as.data.frame, basename, cbind, colnames, dirname, do.call,
    +#>     duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted,
    +#>     lapply, mapply, match, mget, order, paste, pmax, pmax.int, pmin,
    +#>     pmin.int, rank, rbind, rownames, sapply, setdiff, table, tapply,
    +#>     union, unique, unsplit, which.max, which.min
    +#> Loading required package: S4Vectors
    +#> 
    +#> Attaching package: ‘S4Vectors’
    +#> The following object is masked from ‘package:utils’:
    +#> 
    +#>     findMatches
    +#> The following objects are masked from ‘package:base’:
    +#> 
    +#>     I, expand.grid, unname
    +#> Loading required package: IRanges
    +#> Loading required package: GenomeInfoDb
    +#> Loading required package: Biobase
    +#> Welcome to Bioconductor
    +#> 
    +#>     Vignettes contain introductory material; view with
    +#>     'browseVignettes()'. To cite Bioconductor, see
    +#>     'citation("Biobase")', and for packages 'citation("pkgname")'.
    +#> 
    +#> Attaching package: ‘Biobase’
    +#> The following object is masked from ‘package:MatrixGenerics’:
    +#> 
    +#>     rowMedians
    +#> The following objects are masked from ‘package:matrixStats’:
    +#> 
    +#>     anyMissing, rowMedians
    +library(scater)
    +#> Loading required package: ggplot2
    +library(scran)
    +library(ggplot2)
    +sce <- mockSCE()
    +sce <- logNormCounts(sce)
    +clusters <- clusterCells(sce, assay.type = 'logcounts')
    +colLabels(sce) <- clusters
    +sce <- runUMAP(sce, assay.type = 'logcounts')
    +#> Found more than one class "dist" in cache; using the first, from namespace 'spam'
    +#> Also defined by ‘BiocGenerics’
    +#> Found more than one class "dist" in cache; using the first, from namespace 'spam'
    +#> Also defined by ‘BiocGenerics’
    +#> Found more than one class "dist" in cache; using the first, from namespace 'spam'
    +#> Also defined by ‘BiocGenerics’
    +p <- sc_dim(sce, reduction = 'UMAP')
    +p1 <- sc_dim_count(p)
    +
    +
    +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.7.

    +
    + +
    + + + + + + + + diff --git a/reference/sc-dim-geom-ellipse.html b/reference/sc-dim-geom-ellipse.html new file mode 100644 index 0000000..206dd15 --- /dev/null +++ b/reference/sc-dim-geom-ellipse.html @@ -0,0 +1,132 @@ + +sc_dim_geom_ellipse — sc_dim_geom_ellipse • ggsc + + +
    +
    + + + +
    +
    + + +
    +

    sc_dim_geom_ellipse

    +
    + +
    +
    sc_dim_geom_ellipse(mapping = NULL, level = 0.95, ...)
    +
    + +
    +

    Arguments

    +
    mapping
    +

    aesthetic mapping

    + + +
    level
    +

    the level at which to draw an ellipse

    + + +
    ...
    +

    additional parameters pass to the stat_ellipse

    + +
    +
    +

    Value

    + + +

    layer of ellipse

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
    library(scuttle)
    +library(scater)
    +library(scran)
    +library(ggplot2)
    +sce <- mockSCE()
    +sce <- logNormCounts(sce)
    +clusters <- clusterCells(sce, assay.type = 'logcounts')
    +colLabels(sce) <- clusters
    +sce <- runUMAP(sce, assay.type = 'logcounts')
    +#> Found more than one class "dist" in cache; using the first, from namespace 'spam'
    +#> Also defined by ‘BiocGenerics’
    +#> Found more than one class "dist" in cache; using the first, from namespace 'spam'
    +#> Also defined by ‘BiocGenerics’
    +#> Found more than one class "dist" in cache; using the first, from namespace 'spam'
    +#> Also defined by ‘BiocGenerics’
    +p1 <- sc_dim(sce, reduction = 'UMAP', mapping = aes(colour = Cell_Cycle))
    +p2 <- sc_dim(sce, reduction = 'UMAP')
    +f1 <- p1 + sc_dim_geom_ellipse()
    +
    +
    +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.7.

    +
    + +
    + + + + + + + + diff --git a/reference/sc-dim-geom-feature.html b/reference/sc-dim-geom-feature.html new file mode 100644 index 0000000..7a81322 --- /dev/null +++ b/reference/sc-dim-geom-feature.html @@ -0,0 +1,158 @@ + +sc_dim_geom_feature — sc_dim_geom_feature • ggsc + + +
    +
    + + + +
    +
    + + +
    +

    sc_dim_geom_feature

    +
    + +
    +
    sc_dim_geom_feature(
    +  object,
    +  features,
    +  dims = c(1, 2),
    +  ncol = 3,
    +  ...,
    +  .fun = function(.data) dplyr::filter(.data, .data$value > 0)
    +)
    +
    + +
    +

    Arguments

    +
    object
    +

    Seurat or SingleCellExperiment object

    + + +
    features
    +

    selected features (i.e., genes)

    + + +
    dims
    +

    selected dimensions (must be a two-length vector) that are used +in visualization

    + + +
    ncol
    +

    number of facet columns if 'length(features) > 1'

    + + +
    ...
    +

    additional parameters pass to 'scattermore::geom_scattermore()'

    + + +
    .fun
    +

    user defined function that will be applied to selected features +(default is to filter out genes with no expression values)

    + +
    +
    +

    Value

    + + +

    layer of points for selected features

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
    library(scuttle)
    +library(scater)
    +library(scran)
    +library(ggplot2)
    +sce <- mockSCE()
    +sce <- logNormCounts(sce)
    +clusters <- clusterCells(sce, assay.type = 'logcounts')
    +colLabels(sce) <- clusters
    +sce <- runUMAP(sce, assay.type = 'logcounts')
    +#> Found more than one class "dist" in cache; using the first, from namespace 'spam'
    +#> Also defined by ‘BiocGenerics’
    +#> Found more than one class "dist" in cache; using the first, from namespace 'spam'
    +#> Also defined by ‘BiocGenerics’
    +#> Found more than one class "dist" in cache; using the first, from namespace 'spam'
    +#> Also defined by ‘BiocGenerics’
    +p1 <- sc_dim(sce, reduction = 'UMAP')
    +set.seed(123)
    +genes <- rownames(sce) |> sample(6)
    +f1 <- p1 + 
    +      sc_dim_geom_feature(
    +        object = sce, 
    +        features = genes
    +      )
    +
    +
    +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.7.

    +
    + +
    + + + + + + + + diff --git a/reference/sc-dim-geom-label.html b/reference/sc-dim-geom-label.html new file mode 100644 index 0000000..19e9bfa --- /dev/null +++ b/reference/sc-dim-geom-label.html @@ -0,0 +1,128 @@ + +sc_dim_geom_label — sc_dim_geom_label • ggsc + + +
    +
    + + + +
    +
    + + +
    +

    sc_dim_geom_label

    +
    + +
    +
    sc_dim_geom_label(geom = ggplot2::geom_text, ...)
    +
    + +
    +

    Arguments

    +
    geom
    +

    geometric layer (default: geom_text) to display the lables

    + + +
    ...
    +

    additional parameters pass to the geom

    + +
    +
    +

    Value

    + + +

    layer of labels

    +
    +
    +

    See also

    +

    sc_dim_geom_label()

    +
    + +
    +

    Examples

    +
    library(scuttle)
    +library(scater)
    +library(scran)
    +library(ggplot2)
    +sce <- mockSCE()
    +sce <- logNormCounts(sce)
    +clusters <- clusterCells(sce, assay.type = 'logcounts')
    +colLabels(sce) <- clusters
    +sce <- runUMAP(sce, assay.type = 'logcounts')
    +#> Found more than one class "dist" in cache; using the first, from namespace 'spam'
    +#> Also defined by ‘BiocGenerics’
    +#> Found more than one class "dist" in cache; using the first, from namespace 'spam'
    +#> Also defined by ‘BiocGenerics’
    +#> Found more than one class "dist" in cache; using the first, from namespace 'spam'
    +#> Also defined by ‘BiocGenerics’
    +p1 <- sc_dim(sce, reduction = 'UMAP', mapping = aes(colour = Cell_Cycle))
    +p2 <- sc_dim(sce, reduction = 'UMAP')
    +f1 <- p1 + sc_dim_geom_label()
    +
    +
    +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.7.

    +
    + +
    + + + + + + + + diff --git a/reference/sc-dim-geom-subset.html b/reference/sc-dim-geom-subset.html new file mode 100644 index 0000000..a26a4e3 --- /dev/null +++ b/reference/sc-dim-geom-subset.html @@ -0,0 +1,135 @@ + +sc_dim_geom_subset — sc_dim_geom_sub • ggsc + + +
    +
    + + + +
    +
    + + +
    +

    sc_dim_geom_subset

    +
    + +
    +
    sc_dim_geom_sub(mapping = NULL, subset, .column = "ident", ...)
    +
    + +
    +

    Arguments

    +
    mapping
    +

    aesthetic mapping

    + + +
    subset
    +

    subset of clusters to be displayed

    + + +
    .column
    +

    which column represents cluster (e.g., 'ident')

    + + +
    ...
    +

    additional parameters pass to sc_geom_point

    + +
    +
    +

    Value

    + + +

    plot with a layer of specified clusters

    +
    +
    +

    See also

    +

    sc_dim_geom_sub

    +
    + +
    +

    Examples

    +
    library(scuttle)
    +library(scater)
    +library(scran)
    +library(ggplot2)
    +sce <- mockSCE()
    +sce <- logNormCounts(sce)
    +clusters <- clusterCells(sce, assay.type = 'logcounts')
    +colLabels(sce) <- clusters
    +sce <- runUMAP(sce, assay.type = 'logcounts')
    +#> Found more than one class "dist" in cache; using the first, from namespace 'spam'
    +#> Also defined by ‘BiocGenerics’
    +#> Found more than one class "dist" in cache; using the first, from namespace 'spam'
    +#> Also defined by ‘BiocGenerics’
    +#> Found more than one class "dist" in cache; using the first, from namespace 'spam'
    +#> Also defined by ‘BiocGenerics’
    +p1 <- sc_dim(sce, reduction = 'UMAP')
    +f1 <- p1 + sc_dim_geom_sub(subset = c(1, 2), .column = 'label')
    +
    +
    +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.7.

    +
    + +
    + + + + + + + + diff --git a/reference/sc-dim-methods.html b/reference/sc-dim-methods.html new file mode 100644 index 0000000..c7a20a7 --- /dev/null +++ b/reference/sc-dim-methods.html @@ -0,0 +1,186 @@ + +sc_dim — sc_dim • ggsc + + +
    +
    + + + +
    +
    + + +
    +

    sc_dim

    +
    + +
    +
    sc_dim(
    +  object,
    +  dims = c(1, 2),
    +  reduction = NULL,
    +  cells = NULL,
    +  slot = "data",
    +  mapping = NULL,
    +  ...
    +)
    +
    +# S4 method for Seurat
    +sc_dim(
    +  object,
    +  dims = c(1, 2),
    +  reduction = NULL,
    +  cells = NULL,
    +  slot = "data",
    +  mapping = NULL,
    +  ...
    +)
    +
    +# S4 method for SingleCellExperiment
    +sc_dim(
    +  object,
    +  dims = c(1, 2),
    +  reduction = NULL,
    +  cells = NULL,
    +  slot = "data",
    +  mapping = NULL,
    +  ...
    +)
    +
    + +
    +

    Arguments

    +
    object
    +

    Seurat object

    + + +
    dims
    +

    selected dimensions (must be a two-length vector) that +are used in visualization

    + + +
    reduction
    +

    reduction method, default is NULL and will use the +default setting store in the object

    + + +
    cells
    +

    selected cells to plot (default is all cells)

    + + +
    slot
    +

    slot to pull expression data from (e.g., 'count' or 'data')

    + + +
    mapping
    +

    aesthetic mapping

    + + +
    ...
    +

    additional parameters pass to 'scattermore::geom_scattermore()'

    + +
    +
    +

    Value

    + + +

    dimension reduction plot

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
    library(scuttle)
    +library(scater)
    +library(scran)
    +library(ggplot2)
    +sce <- mockSCE()
    +sce <- logNormCounts(sce)
    +clusters <- clusterCells(sce, assay.type = 'logcounts')
    +colLabels(sce) <- clusters
    +sce <- runUMAP(sce, assay.type = 'logcounts')
    +#> Found more than one class "dist" in cache; using the first, from namespace 'spam'
    +#> Also defined by ‘BiocGenerics’
    +#> Found more than one class "dist" in cache; using the first, from namespace 'spam'
    +#> Also defined by ‘BiocGenerics’
    +#> Found more than one class "dist" in cache; using the first, from namespace 'spam'
    +#> Also defined by ‘BiocGenerics’
    +p1 <- sc_dim(sce, reduction = 'UMAP', mapping = aes(colour = Cell_Cycle))
    +p2 <- sc_dim(sce, reduction = 'UMAP')
    +f1 <- p1 + sc_dim_geom_label()
    +f2 <- p2 + 
    +      sc_dim_geom_label(
    +        geom = shadowtext::geom_shadowtext,
    +        color='black',
    +        bg.color='white'
    +      )
    +
    +
    +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.7.

    +
    + +
    + + + + + + + + diff --git a/reference/sc-dim-sub.html b/reference/sc-dim-sub.html new file mode 100644 index 0000000..aceacd1 --- /dev/null +++ b/reference/sc-dim-sub.html @@ -0,0 +1,127 @@ + +sc_dim_sub — sc_dim_sub • ggsc + + +
    +
    + + + +
    +
    + + +
    +

    sc_dim_sub

    +
    + +
    +
    sc_dim_sub(subset, .column = "ident")
    +
    + +
    +

    Arguments

    +
    subset
    +

    subset of clusters to be displayed

    + + +
    .column
    +

    which column represents cluster (e.g., 'ident')

    + +
    +
    +

    Value

    + + +

    update plot with only subset displayed

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
    library(scuttle)
    +library(scater)
    +library(scran)
    +library(ggplot2)
    +sce <- mockSCE()
    +sce <- logNormCounts(sce)
    +clusters <- clusterCells(sce, assay.type = 'logcounts')
    +colLabels(sce) <- clusters
    +sce <- runUMAP(sce, assay.type = 'logcounts')
    +#> Found more than one class "dist" in cache; using the first, from namespace 'spam'
    +#> Also defined by ‘BiocGenerics’
    +#> Found more than one class "dist" in cache; using the first, from namespace 'spam'
    +#> Also defined by ‘BiocGenerics’
    +#> Found more than one class "dist" in cache; using the first, from namespace 'spam'
    +#> Also defined by ‘BiocGenerics’
    +p1 <- sc_dim(sce, reduction = 'UMAP')
    +f1 <- p1 + sc_dim_sub(subset = c(1, 2), .column = 'label')
    +
    +
    +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.7.

    +
    + +
    + + + + + + + + diff --git a/reference/sc-dot-methods-1.png b/reference/sc-dot-methods-1.png new file mode 100644 index 0000000..dad323f Binary files /dev/null and b/reference/sc-dot-methods-1.png differ diff --git a/reference/sc-dot-methods.html b/reference/sc-dot-methods.html new file mode 100644 index 0000000..3aa8ebb --- /dev/null +++ b/reference/sc-dot-methods.html @@ -0,0 +1,249 @@ + +sc_dot — sc_dot • ggsc + + +
    +
    + + + +
    +
    + + +
    +

    sc_dot

    +
    + +
    +
    sc_dot(
    +  object,
    +  features,
    +  group.by = NULL,
    +  split.by = NULL,
    +  cols = c("lightgrey", "blue"),
    +  col.min = -2.5,
    +  col.max = 2.5,
    +  dot.min = 0,
    +  dot.scale = 6,
    +  slot = "data",
    +  .fun = NULL,
    +  mapping = NULL,
    +  scale = TRUE,
    +  scale.by = "radius",
    +  scale.min = NA,
    +  scale.max = NA,
    +  cluster.idents = FALSE,
    +  ...
    +)
    +
    +# S4 method for Seurat
    +sc_dot(
    +  object,
    +  features,
    +  group.by = NULL,
    +  split.by = NULL,
    +  cols = c("lightgrey", "blue"),
    +  col.min = -2.5,
    +  col.max = 2.5,
    +  dot.min = 0,
    +  dot.scale = 6,
    +  slot = "data",
    +  .fun = NULL,
    +  mapping = NULL,
    +  scale = TRUE,
    +  scale.by = "radius",
    +  scale.min = NA,
    +  scale.max = NA,
    +  cluster.idents = FALSE,
    +  ...
    +)
    +
    +# S4 method for SingleCellExperiment
    +sc_dot(
    +  object,
    +  features,
    +  group.by = NULL,
    +  split.by = NULL,
    +  cols = c("lightgrey", "blue"),
    +  col.min = -2.5,
    +  col.max = 2.5,
    +  dot.min = 0,
    +  dot.scale = 6,
    +  slot = "data",
    +  .fun = NULL,
    +  mapping = NULL,
    +  scale = TRUE,
    +  scale.by = "radius",
    +  scale.min = NA,
    +  scale.max = NA,
    +  cluster.idents = FALSE,
    +  ...
    +)
    +
    + +
    +

    Arguments

    +
    object
    +

    Seurat or SingleCellExperiment object

    + + +
    features
    +

    selected features

    + + +
    group.by
    +

    grouping factor

    + + +
    split.by
    +

    additional split factor

    + + +
    cols
    +

    colors of the points

    + + +
    col.min
    +

    minimum scaled averaged expression threshold

    + + +
    col.max
    +

    maximum scaled averaged expression threshold

    + + +
    dot.min
    +

    the threshold of percentage of cells for the the smallest dot

    + + +
    dot.scale
    +

    Scaling factor for size of points

    + + +
    slot
    +

    slot to pull expression data from (e.g., 'count' or 'data')

    + + +
    .fun
    +

    user defined function that will be applied to selected features (default is NULL and there is no data operation)

    + + +
    mapping
    +

    aesthetic mapping

    + + +
    scale
    +

    whether to scale the expression value (default to TRUE)

    + + +
    scale.by
    +

    scale the size of the points by size or radius

    + + +
    scale.min
    +

    lower limit of scaling

    + + +
    scale.max
    +

    upper limit of scaling

    + + +
    cluster.idents
    +

    Order identities by hierarchical clusters based on average expression and perventage of expression (default is FALSE)

    + + +
    ...
    +

    additional parameters pass to 'ggplot2::geom_point()'

    + +
    +
    +

    Value

    + + +

    dot plot to visualize feature expression distribution

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
    library(scuttle)
    +library(scater)
    +library(scran)
    +library(ggplot2)
    +sce <- mockSCE()
    +sce <- logNormCounts(sce)
    +set.seed(123)
    +genes <- rownames(sce) |> sample(6) 
    +sc_dot(sce, genes[1:5], 'Treatment', slot = 'logcounts')
    +#> Warning: Scaling data with a low number of groups may produce misleading results
    +
    +
    +
    +
    +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.7.

    +
    + +
    + + + + + + + + diff --git a/reference/sc-feature-methods-1.png b/reference/sc-feature-methods-1.png new file mode 100644 index 0000000..5488510 Binary files /dev/null and b/reference/sc-feature-methods-1.png differ diff --git a/reference/sc-feature-methods.html b/reference/sc-feature-methods.html new file mode 100644 index 0000000..39c884b --- /dev/null +++ b/reference/sc-feature-methods.html @@ -0,0 +1,232 @@ + +sc_feature — sc_feature • ggsc + + +
    +
    + + + +
    +
    + + +
    +

    sc_feature

    +
    + +
    +
    sc_feature(
    +  object,
    +  features,
    +  dims = c(1, 2),
    +  reduction = NULL,
    +  cells = NULL,
    +  slot = "data",
    +  mapping = NULL,
    +  ncol = 3,
    +  density = FALSE,
    +  grid.n = 100,
    +  joint = FALSE,
    +  joint.fun = prod,
    +  common.legend = TRUE,
    +  ...
    +)
    +
    +# S4 method for Seurat
    +sc_feature(
    +  object,
    +  features,
    +  dims = c(1, 2),
    +  reduction = NULL,
    +  cells = NULL,
    +  slot = "data",
    +  mapping = NULL,
    +  ncol = 3,
    +  density = FALSE,
    +  grid.n = 100,
    +  joint = FALSE,
    +  joint.fun = prod,
    +  common.legend = TRUE,
    +  ...
    +)
    +
    +# S4 method for SingleCellExperiment
    +sc_feature(
    +  object,
    +  features,
    +  dims = c(1, 2),
    +  reduction = NULL,
    +  cells = NULL,
    +  slot = "data",
    +  mapping = NULL,
    +  ncol = 3,
    +  density = FALSE,
    +  grid.n = 100,
    +  joint = FALSE,
    +  joint.fun = prod,
    +  common.legend = TRUE,
    +  ...
    +)
    +
    + +
    +

    Arguments

    +
    object
    +

    Seurat object

    + + +
    features
    +

    selected features (i.e., genes)

    + + +
    dims
    +

    selected dimensions (must be a two-length vector) +that are used in visualization

    + + +
    reduction
    +

    reduction method, default is NULL and will +use the default setting store in the object

    + + +
    cells
    +

    selected cells to plot (default is all cells)

    + + +
    slot
    +

    slot to pull expression data from (e.g., 'count' or 'data')

    + + +
    mapping
    +

    aesthetic mapping

    + + +
    ncol
    +

    number of facet columns if 'length(features) > 1'

    + + +
    density
    +

    whether plot the 2D weighted kernel density, default is FALSE.

    + + +
    grid.n
    +

    number of grid points in the two directions to estimate 2D +weighted kernel density, default is 100.

    + + +
    joint
    +

    whether joint the multiple features with joint.fun, +default is FALSE.

    + + +
    joint.fun
    +

    how to joint the multiple features if joint=TRUE, +default is prod.

    + + +
    common.legend
    +

    whether to use facet_wrap to display the multiple +features, default is TRUE.

    + + +
    ...
    +

    additional parameters pass to 'scattermore::geom_scattermore()'

    + +
    +
    +

    Value

    + + +

    dimension reduction plot colored by selected features

    +
    + +
    +

    Examples

    +
    library(scuttle)
    +library(scater)
    +library(scran)
    +library(ggplot2)
    +sce <- mockSCE()
    +sce <- logNormCounts(sce)
    +clusters <- clusterCells(sce, assay.type = 'logcounts')
    +colLabels(sce) <- clusters
    +sce <- runTSNE(sce, assay.type = 'logcounts')
    +set.seed(123)
    +genes <- rownames(sce) |> sample(6)
    +p1 <- sc_feature(sce, genes[1], slot='logcounts', reduction = 'TSNE')
    +p2 <- sc_feature(sce, genes, slot='logcounts', reduction = 'TSNE')
    +f1 <- sc_dim(sce, slot='logcounts', reduction = 'TSNE') +
    +      sc_dim_geom_feature(sce, genes[1], color='black')
    +f2 <- sc_dim(sce, alpha=.3, slot='logcounts', reduction = 'TSNE') +
    +    ggnewscale::new_scale_color() +
    +    sc_dim_geom_feature(sce, genes, mapping=aes(color=features)) +
    +    scale_color_viridis_d()
    +p1 + p2 + f1 + f2
    +
    +
    +
    +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.7.

    +
    + +
    + + + + + + + + diff --git a/reference/sc-geom-point-1.png b/reference/sc-geom-point-1.png new file mode 100644 index 0000000..07e45a0 Binary files /dev/null and b/reference/sc-geom-point-1.png differ diff --git a/reference/sc-geom-point.html b/reference/sc-geom-point.html new file mode 100644 index 0000000..9ed170c --- /dev/null +++ b/reference/sc-geom-point.html @@ -0,0 +1,116 @@ + +sc_geom_point — sc_geom_point • ggsc + + +
    +
    + + + +
    +
    + + +
    +

    sc_geom_point

    +
    + +
    +
    sc_geom_point(mapping = NULL, ...)
    +
    + +
    +

    Arguments

    +
    mapping
    +

    aesthetic mapping

    + + +
    ...
    +

    additional parameters pass to 'scattermore::geom_scattermore()'

    + +
    +
    +

    Value

    + + +

    layer of points

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
    library(ggplot2)
    +ggplot(iris,
    + aes(x= Sepal.Length, y = Petal.Width, color=Species)
    +) + 
    +sc_geom_point()
    +
    +
    +
    +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.7.

    +
    + +
    + + + + + + + + diff --git a/reference/sc-spatial-methods.html b/reference/sc-spatial-methods.html new file mode 100644 index 0000000..bdedbe3 --- /dev/null +++ b/reference/sc-spatial-methods.html @@ -0,0 +1,265 @@ + +sc_spatial — sc_spatial • ggsc + + +
    +
    + + + +
    +
    + + +
    +

    sc_spatial

    +
    + +
    +
    sc_spatial(
    +  object,
    +  features = NULL,
    +  sample.id = NULL,
    +  image.id = NULL,
    +  slot = "data",
    +  image.plot = TRUE,
    +  image.first.operation = "rotate",
    +  image.rotate.degree = NULL,
    +  image.mirror.axis = NULL,
    +  remove.point = FALSE,
    +  mapping = NULL,
    +  ncol = 6,
    +  density = FALSE,
    +  grid.n = 100,
    +  joint = FALSE,
    +  joint.fun = prod,
    +  common.legend = TRUE,
    +  point.size = 5,
    +  ...
    +)
    +
    +# S4 method for Seurat
    +sc_spatial(
    +  object,
    +  features = NULL,
    +  sample.id = NULL,
    +  image.id = NULL,
    +  slot = "data",
    +  image.plot = TRUE,
    +  image.first.operation = "rotate",
    +  image.rotate.degree = NULL,
    +  image.mirror.axis = NULL,
    +  remove.point = FALSE,
    +  mapping = NULL,
    +  ncol = 6,
    +  density = FALSE,
    +  grid.n = 100,
    +  joint = FALSE,
    +  joint.fun = prod,
    +  common.legend = TRUE,
    +  point.size = 5,
    +  ...
    +)
    +
    +# S4 method for SingleCellExperiment
    +sc_spatial(
    +  object,
    +  features = NULL,
    +  sample.id = NULL,
    +  image.id = NULL,
    +  slot = "data",
    +  image.plot = TRUE,
    +  image.first.operation = "rotate",
    +  image.rotate.degree = NULL,
    +  image.mirror.axis = NULL,
    +  remove.point = FALSE,
    +  mapping = NULL,
    +  ncol = 6,
    +  density = FALSE,
    +  grid.n = 100,
    +  joint = FALSE,
    +  joint.fun = prod,
    +  common.legend = TRUE,
    +  point.size = 5,
    +  ...
    +)
    +
    + +
    +

    Arguments

    +
    object
    +

    Seurat object

    + + +
    features
    +

    selected features to be visualized

    + + +
    sample.id
    +

    the index name of sample id, which only +work with SingleCellExperiment or SpatialExperiment.

    + + +
    image.id
    +

    the index name of image id, which only work +with SingleCellExperiment or SpatialExperiment.

    + + +
    slot
    +

    if plotting a feature, which data will be used +(e.g., 'data', 'counts'), the assay name if object +is SingleCellExperiment or SpatialExperiment.

    + + +
    image.plot
    +

    whether to display the issue image as background.

    + + +
    image.first.operation
    +

    character which the first operation to +image, 'rotate' or 'mirror', default is 'rotate'.

    + + +
    image.rotate.degree
    +

    integer the degree to ratate image, default is NULL.

    + + +
    image.mirror.axis
    +

    character the direction to mirror the image, default is 'h'.

    + + +
    remove.point
    +

    whether to remove the spot points, it is nice +if your just view the issue image, default is FALSE.

    + + +
    mapping
    +

    aesthetic mapping, default is NULL.

    + + +
    ncol
    +

    integer number of facet columns if 'length(features) > 1', default is 6.

    + + +
    density
    +

    whether plot the 2D weighted kernel density, default is FALSE.

    + + +
    grid.n
    +

    number of grid points in the two directions to estimate 2D +weighted kernel density, default is 100.

    + + +
    joint
    +

    whether joint the multiple features with joint.fun, +default is FALSE.

    + + +
    joint.fun
    +

    how to joint the multiple features if joint = TRUE, +default is prod.

    + + +
    common.legend
    +

    whether to use facet_wrap to display the multiple +features, default is TRUE.

    + + +
    point.size
    +

    the size of point, default is 5.

    + + +
    ...
    +

    additional parameters.

    + +
    +
    +

    Value

    + + +

    ggplot object

    +
    + +
    +

    Examples

    +
    if (FALSE) {
    +library(STexampleData)
    +# create ExperimentHub instance
    +eh <- ExperimentHub()
    +# query STexampleData datasets
    +myfiles <- query(eh, "STexampleData")
    +spe <- myfiles[["EH7538"]]
    +spe <- spe[, colData(spe)$in_tissue == 1]
    +set.seed(123)
    +genes <- rownames(spe) |> sample(6) 
    +p <- sc_spatial(spe, features = genes, 
    +                image.rotate.degree = -90, 
    +                image.mirror.axis = NULL, 
    +                ncol = 3)
    +}
    +
    +
    +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.7.

    +
    + +
    + + + + + + + + diff --git a/reference/sc-violin-methods-1.png b/reference/sc-violin-methods-1.png new file mode 100644 index 0000000..242d57d Binary files /dev/null and b/reference/sc-violin-methods-1.png differ diff --git a/reference/sc-violin-methods-2.png b/reference/sc-violin-methods-2.png new file mode 100644 index 0000000..deb7420 Binary files /dev/null and b/reference/sc-violin-methods-2.png differ diff --git a/reference/sc-violin-methods-3.png b/reference/sc-violin-methods-3.png new file mode 100644 index 0000000..7116965 Binary files /dev/null and b/reference/sc-violin-methods-3.png differ diff --git a/reference/sc-violin-methods.html b/reference/sc-violin-methods.html new file mode 100644 index 0000000..991bbf9 --- /dev/null +++ b/reference/sc-violin-methods.html @@ -0,0 +1,194 @@ + +sc_violin — sc_violin • ggsc + + +
    +
    + + + +
    +
    + + +
    +

    sc_violin

    +
    + +
    +
    sc_violin(
    +  object,
    +  features,
    +  cells = NULL,
    +  slot = "data",
    +  .fun = NULL,
    +  mapping = NULL,
    +  ncol = 3,
    +  ...
    +)
    +
    +# S4 method for Seurat
    +sc_violin(
    +  object,
    +  features,
    +  cells = NULL,
    +  slot = "data",
    +  .fun = NULL,
    +  mapping = NULL,
    +  ncol = 3,
    +  ...
    +)
    +
    +# S4 method for SingleCellExperiment
    +sc_violin(
    +  object,
    +  features,
    +  cells = NULL,
    +  slot = "data",
    +  .fun = NULL,
    +  mapping = NULL,
    +  ncol = 3,
    +  ...
    +)
    +
    + +
    +

    Arguments

    +
    object
    +

    Seurat object

    + + +
    features
    +

    selected features

    + + +
    cells
    +

    selected cells to plot (default is all cells)

    + + +
    slot
    +

    slot to pull expression data from (e.g., 'count' or 'data')

    + + +
    .fun
    +

    user defined function that will be applied to selected features (default is NULL and there is no data operation)

    + + +
    mapping
    +

    aesthetic mapping

    + + +
    ncol
    +

    number of facet columns if 'length(features) > 1'

    + + +
    ...
    +

    additional parameters pass to 'ggplot2::geom_geom_violin()'

    + +
    +
    +

    Value

    + + +

    violin plot to visualize feature expression distribution

    +
    +
    +

    See also

    + +
    + +
    +

    Examples

    +
    library(scuttle)
    +library(scater)
    +library(scran)
    +library(ggplot2)
    +sce <- mockSCE()
    +sce <- logNormCounts(sce)
    +clusters <- clusterCells(sce, assay.type = 'logcounts')
    +colLabels(sce) <- clusters
    +sce <- runUMAP(sce, assay.type = 'logcounts')
    +#> Found more than one class "dist" in cache; using the first, from namespace 'spam'
    +#> Also defined by ‘BiocGenerics’
    +#> Found more than one class "dist" in cache; using the first, from namespace 'spam'
    +#> Also defined by ‘BiocGenerics’
    +#> Found more than one class "dist" in cache; using the first, from namespace 'spam'
    +#> Also defined by ‘BiocGenerics’
    +set.seed(123)
    +genes <- rownames(sce) |> sample(6) 
    +sc_violin(sce, genes[1], slot = 'logcounts')
    +
    +sc_violin(sce, genes[1], slot = 'logcounts',
    +     .fun=function(d) dplyr::filter(d, value > 0)
    +     ) +
    +     ggforce::geom_sina(size=.1)
    +
    +sc_violin(sce, genes, slot = 'logcounts') +
    +  theme(axis.text.x = element_text(angle=45, hjust=1))
    +
    +
    +
    +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.7.

    +
    + +
    + + + + + + + + diff --git a/sitemap.xml b/sitemap.xml new file mode 100644 index 0000000..d0f2e93 --- /dev/null +++ b/sitemap.xml @@ -0,0 +1,69 @@ + + + + /404.html + + + /articles/ggsc.html + + + /articles/index.html + + + /authors.html + + + /index.html + + + /news/index.html + + + /reference/CalWkdeCpp.html + + + /reference/ggsc-package.html + + + /reference/index.html + + + /reference/reexports.html + + + /reference/sc-dim-count.html + + + /reference/sc-dim-geom-ellipse.html + + + /reference/sc-dim-geom-feature.html + + + /reference/sc-dim-geom-label.html + + + /reference/sc-dim-geom-subset.html + + + /reference/sc-dim-methods.html + + + /reference/sc-dim-sub.html + + + /reference/sc-dot-methods.html + + + /reference/sc-feature-methods.html + + + /reference/sc-geom-point.html + + + /reference/sc-spatial-methods.html + + + /reference/sc-violin-methods.html + +