71 | //
72 | // Be aware that since the `@` symbol is a reserved symbol in CSS, it has to be
73 | // escaped with a `\`. In the markup though, you write your classes without the
74 | // backslash (e.g. `u-margin-bottom@mobile`).
75 | $inuit-widths-breakpoint-separator: \@ !default;
76 |
77 |
78 |
79 | $inuit-responsive-spacing-directions: null !default;
80 |
81 | $inuit-responsive-spacing-properties: null !default;
82 |
83 | $inuit-responsive-spacing-sizes: null !default;
84 |
85 |
86 |
87 | /* stylelint-disable max-nesting-depth */
88 |
89 | // Don't output anything if no responsive spacings are defined.
90 | @if ($inuit-responsive-spacing-properties != null) {
91 |
92 | @each $property-namespace, $property in $inuit-responsive-spacing-properties {
93 |
94 | @each $direction-namespace, $direction-rules in $inuit-responsive-spacing-directions {
95 |
96 | @each $size-namespace, $size in $inuit-responsive-spacing-sizes {
97 |
98 | @each $inuit-bp-name, $inuit-bp-value in $mq-breakpoints {
99 |
100 | @include mq($from: $inuit-bp-name) {
101 |
102 | .u-#{$property-namespace}#{$direction-namespace}#{$size-namespace}#{$inuit-widths-breakpoint-separator}#{$inuit-bp-name} {
103 |
104 | @each $direction in $direction-rules {
105 | #{$property}#{$direction}: $size !important;
106 | }
107 |
108 | }
109 |
110 | }
111 |
112 | }
113 |
114 | }
115 |
116 | }
117 |
118 | }
119 |
120 | }
121 |
122 | /* stylelint-enable max-nesting-depth */
123 |
124 | }
125 |
--------------------------------------------------------------------------------
/_sass/inuitcss/utilities/_utilities.spacings.scss:
--------------------------------------------------------------------------------
1 | /* ==========================================================================
2 | #SPACINGS
3 | ========================================================================== */
4 |
5 | /**
6 | * Utility classes to put specific spacing values onto elements. The below loop
7 | * will generate us a suite of classes like:
8 | *
9 | * .u-margin-top {}
10 | * .u-padding-left-large {}
11 | * .u-margin-right-small {}
12 | * .u-padding {}
13 | * .u-padding-right-none {}
14 | * .u-padding-horizontal {}
15 | * .u-padding-vertical-small {}
16 | */
17 |
18 | $inuit-spacing-directions: (
19 | null: null,
20 | "-top": "-top",
21 | "-right": "-right",
22 | "-bottom": "-bottom",
23 | "-left": "-left",
24 | "-horizontal": "-left" "-right",
25 | "-vertical": "-top" "-bottom",
26 | ) !default;
27 |
28 | $inuit-spacing-properties: (
29 | "padding": "padding",
30 | "margin": "margin",
31 | ) !default;
32 |
33 | $inuit-spacing-sizes: (
34 | null: $inuit-global-spacing-unit,
35 | "-tiny": $inuit-global-spacing-unit-tiny,
36 | "-small": $inuit-global-spacing-unit-small,
37 | "-large": $inuit-global-spacing-unit-large,
38 | "-huge": $inuit-global-spacing-unit-huge,
39 | "-none": 0
40 | ) !default;
41 |
42 | @each $property-namespace, $property in $inuit-spacing-properties {
43 |
44 | @each $direction-namespace, $direction-rules in $inuit-spacing-directions {
45 |
46 | @each $size-namespace, $size in $inuit-spacing-sizes {
47 |
48 | .u-#{$property-namespace}#{$direction-namespace}#{$size-namespace} {
49 |
50 | @each $direction in $direction-rules {
51 | #{$property}#{$direction}: $size !important;
52 | }
53 |
54 | }
55 |
56 | }
57 |
58 | }
59 |
60 | }
61 |
--------------------------------------------------------------------------------
/_sass/main.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * This file is the main entry point for the textbook's stylings. It uses the
3 | * Inuit CSS framework: https://github.com/inuitcss/inuitcss
4 | *
5 | * InuitCSS only provides basic typographic stylings and helper functions. All
6 | * framework files live in ./inuitcss/ . All of our custom CSS lives in one of
7 | * these 7 folders:
8 | *
9 | * `/settings`: Global variables, site-wide settings, config switches, etc.
10 | * `/tools`: Site-wide mixins and functions.
11 | * `/generic`: Low-specificity, far-reaching rulesets (e.g. resets).
12 | * `/elements`: Unclassed HTML elements (e.g. `a {}`, `blockquote {}`, `address {}`).
13 | * `/objects`: Objects, abstractions, and design patterns (e.g. `.o-layout {}`).
14 | * `/components`: Discrete, complete chunks of UI (e.g. `.c-carousel {}`).
15 | * `/utilities`: High-specificity, very explicit selectors. Overrides and
16 | helper classes (e.g. `.u-hidden {}`).
17 | *
18 | * CONTENTS
19 | *
20 | * SETTINGS
21 | * Core.................inuitcss’ core and setup settings.
22 | * Global...............Project-wide variables and settings.
23 | *
24 | * TOOLS
25 | * Font-size............A mixin which guarantees baseline-friendly line-heights.
26 | * Clearfix.............Micro clearfix mixin.
27 | * Hidden...............Mixin for hiding elements.
28 | * Sass MQ..............inuitcss’ default media query manager.
29 | *
30 | * GENERIC
31 | * Box-sizing...........Better default `box-sizing`.
32 | * Normalize.css........A level playing field using @necolas’ Normalize.css.
33 | * Reset................A tiny reset to complement Normalize.css.
34 | * Shared...............Sensibly and tersely share some global commonalities
35 | * (particularly useful when managing vertical rhythm).
36 | *
37 | * ELEMENTS
38 | * Page.................Set up our document’s default `font-size` and
39 | * `line-height`.
40 | * Headings.............Very minimal (i.e. only font-size information) for
41 | * headings 1 through 6.
42 | * Images...............Base image styles.
43 | * Tables...............Simple table styles.
44 | *
45 | * OBJECTS
46 | * Wrapper..............Page constraint object.
47 | *
48 | * COMPONENTS
49 | * Buttons..............An example button component, and how it fits into the
50 | * inuitcss framework.
51 | *
52 | * UTILITIES
53 | * Clearfix.............Bind our clearfix onto a utility class.
54 | */
55 |
56 | // SETTINGS
57 | @import 'inuitcss/settings/settings.core';
58 | @import 'settings/settings.global';
59 |
60 | // TOOLS
61 | @import 'inuitcss/tools/tools.font-size';
62 | @import 'inuitcss/tools/tools.clearfix';
63 | @import 'inuitcss/tools/tools.hidden';
64 | @import 'inuitcss/tools/tools.mq';
65 |
66 | // GENERIC
67 | @import 'inuitcss/generic/generic.box-sizing';
68 | @import 'inuitcss/generic/generic.normalize';
69 | @import 'inuitcss/generic/generic.reset';
70 | @import 'inuitcss/generic/generic.shared';
71 | @import 'generic/generic.phone-scrolling';
72 |
73 | // ELEMENTS
74 | @import 'inuitcss/elements/elements.page';
75 | @import 'inuitcss/elements/elements.headings';
76 | @import 'inuitcss/elements/elements.images';
77 | @import 'inuitcss/elements/elements.tables';
78 | @import 'elements/elements.variables';
79 | @import 'elements/elements.typography';
80 | @import 'elements/elements.syntax-highlighting';
81 | @import 'elements/elements.tables';
82 | @import 'elements/elements.links';
83 |
84 | // OBJECTS
85 | $inuit-wrapper-width: 800px;
86 | @import 'inuitcss/objects/objects.wrapper';
87 | @import 'inuitcss/objects/objects.layout';
88 |
89 | $hamburger-padding-x: 0;
90 | $hamburger-padding-y: 8px;
91 | $hamburger-layer-width: 20px;
92 | $hamburger-layer-height: 3px;
93 | $hamburger-layer-spacing: 3px;
94 | $hamburger-layer-color: $color-text;
95 | $hamburger-types: (arrowalt);
96 | @import 'hamburgers/hamburgers';
97 |
98 | @import 'objects/objects.tooltip';
99 | @import 'objects/objects.copy-button';
100 | @import 'objects/objects.thebelab-in-cell-button';
101 |
102 | // COMPONENTS
103 | @import 'components/components.textbook';
104 | @import 'components/components.textbook__sidebar';
105 | @import 'components/components.textbook__page';
106 | @import 'components/components.textbook__sidebar-right';
107 | @import 'components/components.page__nav';
108 | @import 'components/components.topbar';
109 | @import 'components/components.interact-button';
110 | @import 'components/components.thebelab';
111 | @import 'components/components.hidecells';
112 | @import 'components/components.search';
113 | @import 'components/components.footer';
114 |
115 | // UTILITIES
116 | @import 'inuitcss/utilities/utilities.clearfix';
117 | @import 'inuitcss/utilities/utilities.hide';
118 | @import 'inuitcss/utilities/utilities.spacings';
119 |
--------------------------------------------------------------------------------
/_sass/objects/_objects.copy-button.scss:
--------------------------------------------------------------------------------
1 | /* Copy buttons */
2 | .copybtn {
3 | position: absolute;
4 | top: 0;
5 | right: 0;
6 |
7 | margin: $spacing-unit-tiny;
8 | width: $spacing-unit;
9 | height: $spacing-unit;
10 | padding: 0 4px 2px;
11 |
12 | i {
13 | font-style: normal;
14 | color: #777777
15 | }
16 | }
17 |
18 | .input_area .highlight, .text_cell_render .highlight {
19 | position: relative;
20 | }
21 |
--------------------------------------------------------------------------------
/_sass/objects/_objects.thebelab-in-cell-button.scss:
--------------------------------------------------------------------------------
1 | /* in-cell thebelab buttons */
2 | .thebebtn {
3 | position: absolute;
4 | top: 0;
5 | right: $spacing-unit;
6 |
7 | margin: $spacing-unit-tiny;
8 | width: $spacing-unit;
9 | height: $spacing-unit;
10 | padding: 0 4px 2px;
11 |
12 | i {
13 | font-style: normal;
14 | color: #777777
15 | }
16 | }
17 |
18 | .input_area .highlight {
19 | position: relative;
20 | }
21 |
22 | // Hide code buttons
23 | div.jb_input div.input {
24 | position: relative;
25 | }
26 |
--------------------------------------------------------------------------------
/_sass/objects/_objects.tooltip.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * A minimal CSS-only tooltip copied from:
3 | * https://codepen.io/mildrenben/pen/rVBrpK
4 | *
5 | * To use, write HTML like the following:
6 | *
7 | *
Short
8 | */
9 |
10 | $cubic: cubic-bezier(0.64, 0.09, 0.08, 1);
11 |
12 | .o-tooltip {
13 | position: relative;
14 | &:after {
15 | opacity: 0;
16 | visibility: hidden;
17 | position: absolute;
18 | content: attr(data-tooltip);
19 | padding: 6px;
20 | top: 1.4em;
21 | left: 50%;
22 | transform: translateX(-50%) translateY(-2px);
23 | background: grey;
24 | font-size: 0.7rem;
25 | color: white;
26 | white-space: nowrap;
27 | z-index: 2;
28 | border-radius: 2px;
29 | transition: opacity 0.2s $cubic, transform 0.2s $cubic;
30 | }
31 | &:hover {
32 | &:after {
33 | display: block;
34 | opacity: 1;
35 | visibility: visible;
36 | transform: translateX(-50%) translateY(0);
37 | }
38 | }
39 | }
40 |
41 | .o-tooltip--left {
42 | @extend .o-tooltip;
43 |
44 | &:after {
45 | top: 0;
46 | left: 0;
47 | transform: translateX(-102%) translateY(0);
48 | }
49 | &:hover {
50 | &:after {
51 | transform: translateX(-100%) translateY(0);
52 | }
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/_sass/settings/settings.global.scss:
--------------------------------------------------------------------------------
1 | ///* ========================================================================
2 | // #GLOBAL
3 | // ======================================================================== */
4 |
5 | // The global settings file contains any project-wide variables; things that
6 | // need to be made available to the entire codebase.
7 |
8 | $spacing-unit-tiny: $inuit-global-spacing-unit-tiny;
9 | $spacing-unit-small: $inuit-global-spacing-unit-small;
10 | $spacing-unit-med: 0.75 * $inuit-global-spacing-unit;
11 | $spacing-unit: $inuit-global-spacing-unit;
12 | $spacing-unit-large: $inuit-global-spacing-unit-large;
13 | $spacing-unit-huge: $inuit-global-spacing-unit-huge;
14 |
15 | $color-light-gray: #f7f7f7;
16 | $color-dark-gray: #ccc;
17 |
18 | $color-text: #222;
19 | $color-links: #0077d8;
20 |
--------------------------------------------------------------------------------
/_site/Guardfile:
--------------------------------------------------------------------------------
1 | guard 'jekyll-plus', serve: true do
2 | watch /.*/
3 | ignore /^_site/
4 | end
5 |
6 | guard 'livereload' do
7 | watch /.*/
8 | end
9 |
--------------------------------------------------------------------------------
/_site/Makefile:
--------------------------------------------------------------------------------
1 | .PHONY: help book clean serve
2 |
3 | help:
4 | @echo "Please use 'make
' where is one of:"
5 | @echo " install to install the necessary dependencies for jupyter-book to build"
6 | @echo " book to convert the content/ folder into Jekyll markdown in _build/"
7 | @echo " clean to clean out site build files"
8 | @echo " runall to run all notebooks in-place, capturing outputs with the notebook"
9 | @echo " serve to serve the repository locally with Jekyll"
10 | @echo " build to build the site HTML locally with Jekyll and store in _site/"
11 |
12 |
13 | install:
14 | # Check to see whether bundler is already installed. If not, install it.
15 | if [ hash bundler 2>/dev/null ]; then \
16 | gem install bundler;\
17 | fi
18 | bundle install
19 |
20 | book:
21 | jupyter-book build ./
22 |
23 | runall:
24 | jupyter-book run ./content
25 |
26 | clean:
27 | python scripts/clean.py
28 |
29 | serve:
30 | bundle exec guard
31 |
32 | build:
33 | bundle exec jekyll build
34 | touch _site/.nojekyll
35 |
--------------------------------------------------------------------------------
/_site/assets/custom/custom.css:
--------------------------------------------------------------------------------
1 | /* Put your custom CSS here */
2 | .left {
3 | margin-left: 0px;
4 | margin-right: 5px;
5 | float: left;
6 | }
7 |
--------------------------------------------------------------------------------
/_site/assets/custom/custom.js:
--------------------------------------------------------------------------------
1 | // Put your custom javascript here
--------------------------------------------------------------------------------
/_site/assets/images/copy-button.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/_site/assets/images/edit-button.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
82 |
--------------------------------------------------------------------------------
/_site/assets/images/logo_binder.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
20 |
--------------------------------------------------------------------------------
/_site/assets/images/logo_jupyterhub.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/_site/assets/js/anchors.js:
--------------------------------------------------------------------------------
1 | const initAnchors = () => {
2 | if (window.anchors === undefined) {
3 | setTimeout(initAnchors, 250)
4 | return
5 | }
6 | anchors.add("main h1, main h2, main h3, main h4")
7 | }
8 | initFunction(initAnchors);
--------------------------------------------------------------------------------
/_site/assets/js/copy-button.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Set up copy/paste for code blocks
3 | */
4 | const clipboardButton = id =>
5 | `
6 |
7 | `
8 |
9 | // Clears selected text since ClipboardJS will select the text when copying
10 | const clearSelection = () => {
11 | if (window.getSelection) {
12 | window.getSelection().removeAllRanges()
13 | } else if (document.selection) {
14 | document.selection.empty()
15 | }
16 | }
17 |
18 | // Changes tooltip text for two seconds, then changes it back
19 | const temporarilyChangeTooltip = (el, newText) => {
20 | const oldText = el.getAttribute('data-tooltip')
21 | el.setAttribute('data-tooltip', newText)
22 | setTimeout(() => el.setAttribute('data-tooltip', oldText), 2000)
23 | }
24 |
25 | const addCopyButtonToCodeCells = () => {
26 | // If ClipboardJS hasn't loaded, wait a bit and try again. This
27 | // happens because we load ClipboardJS asynchronously.
28 | if (window.ClipboardJS === undefined) {
29 | setTimeout(addCopyButtonToCodeCells, 250)
30 | return
31 | }
32 |
33 | pageElements['codeCells'].forEach((codeCell) => {
34 | const id = codeCell.getAttribute('id')
35 | if (document.getElementById("copy-button" + id) == null) {
36 | codeCell.insertAdjacentHTML('afterend', clipboardButton(id));
37 | }
38 | })
39 |
40 | const clipboard = new ClipboardJS('.copybtn')
41 | clipboard.on('success', event => {
42 | clearSelection()
43 | temporarilyChangeTooltip(event.trigger, 'Copied!')
44 | })
45 |
46 | clipboard.on('error', event => {
47 | temporarilyChangeTooltip(event.trigger, 'Failed to copy')
48 | })
49 |
50 | // Get rid of clipboard before the next page visit to avoid memory leak
51 | document.addEventListener('turbolinks:before-visit', () =>
52 | clipboard.destroy()
53 | )
54 | }
55 |
56 | initFunction(addCopyButtonToCodeCells);
--------------------------------------------------------------------------------
/_site/assets/js/documentSelectors.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Select various elements on the page for later use
3 | */
4 |
5 | // IDs we'll attach to cells
6 | const codeCellId = index => `codecell${index}`
7 | const inputCellId = index => `inputcell${index}`
8 |
9 | pageElements = {}
10 |
11 | // All code cells
12 | findCodeCells = function() {
13 | var codeCells = document.querySelectorAll('div.c-textbook__content > div.highlighter-rouge > div.highlight > pre, div.input_area pre, div.text_cell_render div.highlight pre')
14 | pageElements['codeCells'] = codeCells;
15 |
16 | codeCells.forEach((codeCell, index) => {
17 | const id = codeCellId(index)
18 | codeCell.setAttribute('id', id)
19 | })
20 | };
21 |
22 | initFunction(findCodeCells);
23 |
24 | // All cells in general
25 | findInputCells = function() {
26 | var inputCells = document.querySelectorAll('div.jb_cell')
27 | pageElements['inputCells'] = inputCells;
28 |
29 | inputCells.forEach((inputCell, index) => {
30 | const id = inputCellId(index)
31 | inputCell.setAttribute('id', id)
32 | })
33 | };
34 |
35 | initFunction(findInputCells);
--------------------------------------------------------------------------------
/_site/assets/js/dom-update.js:
--------------------------------------------------------------------------------
1 | const runWhenDOMLoaded = cb => {
2 | if (document.readyState != 'loading') {
3 | cb()
4 | } else if (document.addEventListener) {
5 | document.addEventListener('DOMContentLoaded', cb)
6 | } else {
7 | document.attachEvent('onreadystatechange', function() {
8 | if (document.readyState == 'complete') cb()
9 | })
10 | }
11 | }
12 |
13 | // Helper function to init things quickly
14 | initFunction = function(myfunc) {
15 | runWhenDOMLoaded(myfunc);
16 | document.addEventListener('turbolinks:load', myfunc);
17 | };
--------------------------------------------------------------------------------
/_site/assets/js/hide-cell.js:
--------------------------------------------------------------------------------
1 | /**
2 | Add buttons to hide code cells
3 | */
4 | var setCodeCellVisibility = function (inputField, kind) {
5 | // Update the image and class for hidden
6 | var id = inputField.getAttribute('data-id');
7 | var codeCell = document.querySelector(`#${id} div.highlight`);
8 |
9 | if (kind === "visible") {
10 | codeCell.classList.remove('hidden');
11 | inputField.checked = true;
12 | } else {
13 | codeCell.classList.add('hidden');
14 | inputField.checked = false;
15 | }
16 | }
17 |
18 | var toggleCodeCellVisibility = function (event) {
19 | // The label is clicked, and now we decide what to do based on the input field's clicked status
20 | if (event.target.tagName === "LABEL") {
21 | var inputField = event.target.previousElementSibling;
22 | } else {
23 | // It is the span inside the target
24 | var inputField = event.target.parentElement.previousElementSibling;
25 | }
26 |
27 | if (inputField.checked === true) {
28 | setCodeCellVisibility(inputField, "visible");
29 | } else {
30 | setCodeCellVisibility(inputField, "hidden");
31 | }
32 | }
33 |
34 |
35 | // Button constructor
36 | const hideCodeButton = id => ``
37 |
38 | var addHideButton = function () {
39 | // If a hide button is already added, don't add another
40 | if (document.querySelector('div.tag_hide_input input') !== null) {
41 | return;
42 | }
43 |
44 | // Find the input cells and add a hide button
45 | pageElements['inputCells'].forEach(function (inputCell) {
46 | if (!inputCell.classList.contains("tag_hide_input")) {
47 | // Skip the cell if it doesn't have a hidecode class
48 | return;
49 | }
50 |
51 | const id = inputCell.getAttribute('id')
52 |
53 | // Insert the button just inside the end of the next div
54 | inputCell.querySelector('div.input').insertAdjacentHTML('beforeend', hideCodeButton(id))
55 |
56 | // Set up the visibility toggle
57 | hideLink = document.querySelector(`#${id} div.inner_cell + input + label`);
58 | hideLink.addEventListener('click', toggleCodeCellVisibility)
59 | });
60 | }
61 |
62 |
63 | // Initialize the hide buttos
64 | var initHiddenCells = function () {
65 | // Add hide buttons to the cells
66 | addHideButton();
67 |
68 | // Toggle the code cells that should be hidden
69 | document.querySelectorAll('div.tag_hide_input input').forEach(function (item) {
70 | setCodeCellVisibility(item, 'hidden');
71 | item.checked = true;
72 | })
73 | }
74 |
75 | initFunction(initHiddenCells);
--------------------------------------------------------------------------------
/_site/assets/js/tocbot.js:
--------------------------------------------------------------------------------
1 | const initToc = () => {
2 | if (window.tocbot === undefined) {
3 | setTimeout(initToc, 250)
4 | return
5 | }
6 |
7 | // Check whether we have any sidebar content. If not, then show the sidebar earlier.
8 | var SIDEBAR_CONTENT_TAGS = ['.tag_full_width', '.tag_popout'];
9 | var sidebar_content_query = SIDEBAR_CONTENT_TAGS.join(', ')
10 | if (document.querySelectorAll(sidebar_content_query).length === 0) {
11 | document.querySelector('nav.onthispage').classList.add('no_sidebar_content')
12 | }
13 |
14 | // Initialize the TOC bot
15 | tocbot.init({
16 | tocSelector: 'nav.onthispage',
17 | contentSelector: '.c-textbook__content',
18 | headingSelector: 'h2, h3',
19 | orderedList: false,
20 | collapseDepth: 6,
21 | listClass: 'toc__menu',
22 | activeListItemClass: "", // Not using
23 | activeLinkClass: "", // Not using
24 | });
25 | }
26 | initFunction(initToc);
--------------------------------------------------------------------------------
/_site/images/logo/edit-button.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
82 |
--------------------------------------------------------------------------------
/_site/images/logo/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chanzuckerberg/scRNA-python-workshop/c7816741ba8f63e1dca08dad8999e64328186404/_site/images/logo/favicon.ico
--------------------------------------------------------------------------------
/_site/images/logo/jupyter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chanzuckerberg/scRNA-python-workshop/c7816741ba8f63e1dca08dad8999e64328186404/_site/images/logo/jupyter.png
--------------------------------------------------------------------------------
/_site/images/logo/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chanzuckerberg/scRNA-python-workshop/c7816741ba8f63e1dca08dad8999e64328186404/_site/images/logo/logo.png
--------------------------------------------------------------------------------
/_site/images/logo/logo.psd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chanzuckerberg/scRNA-python-workshop/c7816741ba8f63e1dca08dad8999e64328186404/_site/images/logo/logo.psd
--------------------------------------------------------------------------------
/_site/requirements.txt:
--------------------------------------------------------------------------------
1 | # Requirements for the demo notebooks
2 | # Useful for MyBinder configuration
3 | pandas
4 | numpy
5 | datascience
6 | folium
7 | matplotlib
8 | nbinteract
9 | scipy
10 | jupyter-book
11 |
--------------------------------------------------------------------------------
/assets/css/styles.scss:
--------------------------------------------------------------------------------
1 | ---
2 | ---
3 |
4 | @import 'main';
5 |
--------------------------------------------------------------------------------
/assets/custom/custom.css:
--------------------------------------------------------------------------------
1 | /* Put your custom CSS here */
2 | .left {
3 | margin-left: 0px;
4 | margin-right: 5px;
5 | float: left;
6 | }
7 |
--------------------------------------------------------------------------------
/assets/custom/custom.js:
--------------------------------------------------------------------------------
1 | // Put your custom javascript here
--------------------------------------------------------------------------------
/assets/html/index.html:
--------------------------------------------------------------------------------
1 | ---
2 | permalink: /index.html
3 | title: "Index"
4 | layout: none
5 | ---
6 |
7 |
8 | {% for chapter in site.data.toc %}
9 | {% unless chapter.external %}
10 | {% if chapter.url %}
11 | {% comment %}This ensures that the first link we re-direct to isn't an external site {% endcomment %}
12 | {% assign redirectURL = chapter.url | relative_url %}
13 | {% break %}
14 | {% endif %}
15 | {% endunless %}
16 | {% endfor %}
17 |
18 |
19 |
20 | Redirecting…
21 |
22 |
23 |
24 |
25 | Redirecting…
26 | Click here if you are not redirected.
27 |
28 |
--------------------------------------------------------------------------------
/assets/html/search_form.html:
--------------------------------------------------------------------------------
1 | ---
2 | permalink: /search
3 | title: "Search the site"
4 | search_page: true
5 | ---
6 |
7 |
11 |
12 |
--------------------------------------------------------------------------------
/assets/images/copy-button.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/assets/images/czi-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chanzuckerberg/scRNA-python-workshop/c7816741ba8f63e1dca08dad8999e64328186404/assets/images/czi-logo.png
--------------------------------------------------------------------------------
/assets/images/edit-button.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
82 |
--------------------------------------------------------------------------------
/assets/images/logo_binder.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
20 |
--------------------------------------------------------------------------------
/assets/images/logo_jupyterhub.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/assets/js/anchors.js:
--------------------------------------------------------------------------------
1 | const initAnchors = () => {
2 | if (window.anchors === undefined) {
3 | setTimeout(initAnchors, 250)
4 | return
5 | }
6 | anchors.add("main h1, main h2, main h3, main h4")
7 | }
8 | initFunction(initAnchors);
--------------------------------------------------------------------------------
/assets/js/copy-button.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Set up copy/paste for code blocks
3 | */
4 | const clipboardButton = id =>
5 | `
6 |
7 | `
8 |
9 | // Clears selected text since ClipboardJS will select the text when copying
10 | const clearSelection = () => {
11 | if (window.getSelection) {
12 | window.getSelection().removeAllRanges()
13 | } else if (document.selection) {
14 | document.selection.empty()
15 | }
16 | }
17 |
18 | // Changes tooltip text for two seconds, then changes it back
19 | const temporarilyChangeTooltip = (el, newText) => {
20 | const oldText = el.getAttribute('data-tooltip')
21 | el.setAttribute('data-tooltip', newText)
22 | setTimeout(() => el.setAttribute('data-tooltip', oldText), 2000)
23 | }
24 |
25 | const addCopyButtonToCodeCells = () => {
26 | // If ClipboardJS hasn't loaded, wait a bit and try again. This
27 | // happens because we load ClipboardJS asynchronously.
28 | if (window.ClipboardJS === undefined) {
29 | setTimeout(addCopyButtonToCodeCells, 250)
30 | return
31 | }
32 |
33 | pageElements['codeCells'].forEach((codeCell) => {
34 | const id = codeCell.getAttribute('id')
35 | if (document.getElementById("copy-button" + id) == null) {
36 | codeCell.insertAdjacentHTML('afterend', clipboardButton(id));
37 | }
38 | })
39 |
40 | const clipboard = new ClipboardJS('.copybtn')
41 | clipboard.on('success', event => {
42 | clearSelection()
43 | temporarilyChangeTooltip(event.trigger, 'Copied!')
44 | })
45 |
46 | clipboard.on('error', event => {
47 | temporarilyChangeTooltip(event.trigger, 'Failed to copy')
48 | })
49 |
50 | // Get rid of clipboard before the next page visit to avoid memory leak
51 | document.addEventListener('turbolinks:before-visit', () =>
52 | clipboard.destroy()
53 | )
54 | }
55 |
56 | initFunction(addCopyButtonToCodeCells);
--------------------------------------------------------------------------------
/assets/js/documentSelectors.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Select various elements on the page for later use
3 | */
4 |
5 | // IDs we'll attach to cells
6 | const codeCellId = index => `codecell${index}`
7 | const inputCellId = index => `inputcell${index}`
8 |
9 | pageElements = {}
10 |
11 | // All code cells
12 | findCodeCells = function() {
13 | var codeCells = document.querySelectorAll('div.c-textbook__content > div.highlighter-rouge > div.highlight > pre, div.input_area pre, div.text_cell_render div.highlight pre')
14 | pageElements['codeCells'] = codeCells;
15 |
16 | codeCells.forEach((codeCell, index) => {
17 | const id = codeCellId(index)
18 | codeCell.setAttribute('id', id)
19 | })
20 | };
21 |
22 | initFunction(findCodeCells);
23 |
24 | // All cells in general
25 | findInputCells = function() {
26 | var inputCells = document.querySelectorAll('div.jb_cell')
27 | pageElements['inputCells'] = inputCells;
28 |
29 | inputCells.forEach((inputCell, index) => {
30 | const id = inputCellId(index)
31 | inputCell.setAttribute('id', id)
32 | })
33 | };
34 |
35 | initFunction(findInputCells);
--------------------------------------------------------------------------------
/assets/js/dom-update.js:
--------------------------------------------------------------------------------
1 | const runWhenDOMLoaded = cb => {
2 | if (document.readyState != 'loading') {
3 | cb()
4 | } else if (document.addEventListener) {
5 | document.addEventListener('DOMContentLoaded', cb)
6 | } else {
7 | document.attachEvent('onreadystatechange', function() {
8 | if (document.readyState == 'complete') cb()
9 | })
10 | }
11 | }
12 |
13 | // Helper function to init things quickly
14 | initFunction = function(myfunc) {
15 | runWhenDOMLoaded(myfunc);
16 | document.addEventListener('turbolinks:load', myfunc);
17 | };
--------------------------------------------------------------------------------
/assets/js/hide-cell.js:
--------------------------------------------------------------------------------
1 | /**
2 | Add buttons to hide code cells
3 | */
4 | var setCodeCellVisibility = function (inputField, kind) {
5 | // Update the image and class for hidden
6 | var id = inputField.getAttribute('data-id');
7 | var codeCell = document.querySelector(`#${id} div.highlight`);
8 |
9 | if (kind === "visible") {
10 | codeCell.classList.remove('hidden');
11 | inputField.checked = true;
12 | } else {
13 | codeCell.classList.add('hidden');
14 | inputField.checked = false;
15 | }
16 | }
17 |
18 | var toggleCodeCellVisibility = function (event) {
19 | // The label is clicked, and now we decide what to do based on the input field's clicked status
20 | if (event.target.tagName === "LABEL") {
21 | var inputField = event.target.previousElementSibling;
22 | } else {
23 | // It is the span inside the target
24 | var inputField = event.target.parentElement.previousElementSibling;
25 | }
26 |
27 | if (inputField.checked === true) {
28 | setCodeCellVisibility(inputField, "visible");
29 | } else {
30 | setCodeCellVisibility(inputField, "hidden");
31 | }
32 | }
33 |
34 |
35 | // Button constructor
36 | const hideCodeButton = id => ``
37 |
38 | var addHideButton = function () {
39 | // If a hide button is already added, don't add another
40 | if (document.querySelector('div.tag_hide_input input') !== null) {
41 | return;
42 | }
43 |
44 | // Find the input cells and add a hide button
45 | pageElements['inputCells'].forEach(function (inputCell) {
46 | if (!inputCell.classList.contains("tag_hide_input")) {
47 | // Skip the cell if it doesn't have a hidecode class
48 | return;
49 | }
50 |
51 | const id = inputCell.getAttribute('id')
52 |
53 | // Insert the button just inside the end of the next div
54 | inputCell.querySelector('div.input').insertAdjacentHTML('beforeend', hideCodeButton(id))
55 |
56 | // Set up the visibility toggle
57 | hideLink = document.querySelector(`#${id} div.inner_cell + input + label`);
58 | hideLink.addEventListener('click', toggleCodeCellVisibility)
59 | });
60 | }
61 |
62 |
63 | // Initialize the hide buttos
64 | var initHiddenCells = function () {
65 | // Add hide buttons to the cells
66 | addHideButton();
67 |
68 | // Toggle the code cells that should be hidden
69 | document.querySelectorAll('div.tag_hide_input input').forEach(function (item) {
70 | setCodeCellVisibility(item, 'hidden');
71 | item.checked = true;
72 | })
73 | }
74 |
75 | initFunction(initHiddenCells);
--------------------------------------------------------------------------------
/assets/js/tocbot.js:
--------------------------------------------------------------------------------
1 | const initToc = () => {
2 | if (window.tocbot === undefined) {
3 | setTimeout(initToc, 250)
4 | return
5 | }
6 |
7 | // Check whether we have any sidebar content. If not, then show the sidebar earlier.
8 | var SIDEBAR_CONTENT_TAGS = ['.tag_full_width', '.tag_popout'];
9 | var sidebar_content_query = SIDEBAR_CONTENT_TAGS.join(', ')
10 | if (document.querySelectorAll(sidebar_content_query).length === 0) {
11 | document.querySelector('nav.onthispage').classList.add('no_sidebar_content')
12 | }
13 |
14 | // Initialize the TOC bot
15 | tocbot.init({
16 | tocSelector: 'nav.onthispage',
17 | contentSelector: '.c-textbook__content',
18 | headingSelector: 'h2, h3',
19 | orderedList: false,
20 | collapseDepth: 6,
21 | listClass: 'toc__menu',
22 | activeListItemClass: "", // Not using
23 | activeLinkClass: "", // Not using
24 | });
25 | }
26 | initFunction(initToc);
--------------------------------------------------------------------------------
/content/LICENSE.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chanzuckerberg/scRNA-python-workshop/c7816741ba8f63e1dca08dad8999e64328186404/content/LICENSE.md
--------------------------------------------------------------------------------
/content/data.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chanzuckerberg/scRNA-python-workshop/c7816741ba8f63e1dca08dad8999e64328186404/content/data.zip
--------------------------------------------------------------------------------
/content/exploration/06-exploratory.md:
--------------------------------------------------------------------------------
1 | # Exploratory analysis with cellxgene
2 |
3 | ## Introduction to cellxgene
4 |
5 | Cellxgene (pronounced "cell-by-gene") is an interactive data explorer for single-cell transcriptomics datasets. You can see a working example [here](https://www.kidneycellatlas.org/fetal-kidney-immune.)
6 |
7 | As input, it takes an `h5ad` file (AnnData) that contains a pre-computed low-dimensional embedding (e.g., tSNE or UMAP) and, optionally, additional metadata (e.g., annotated tissue types or precomputed cluster labels).
8 |
9 | Let's load the brain data we've been working with into cellxgene, and then spend some time exploring the dataset in a bit more detail.
10 |
11 | ## Launching cellxgene
12 |
13 | 0. If you haven't done so already, follow the instructions at the bottom of [this page](https://chanzuckerberg.github.io/scRNA-python-workshop/intro/setup.html) to install cellxgene and verify your installation
14 | 1. Open a terminal window (Mac: `Applications > Utilities > Console`; Windows: `Start > All Programs > Accessories > Command Prompt`
15 | 1. In the terminal, type `cellxgene launch path/to/course/folder/content/data/brain_clusters.h5ad --open`
16 | You need to replace `path/to/course/folder` with the correct file path to where your course folder lives on your computer.
17 | For example, for a mac user with the course folder on the desktop, I would enter `Desktop/scRNA-python-workshop/content/data/brain_clusters.h5ad`
18 |
19 | ## Exercises: exploring your data
20 |
21 | Cellxgene can be used for many different exploratory tasks; here are a few examples to get you started.
22 |
23 | ### Looking for confounders
24 |
25 | Try coloring by the `mouse.id`; does it look like the structure in the embedded data is determined by which mouse a cell came from, or are they intermingled? What does that tell you?
26 | Try this for each other possible confounder in the metadata. What do you observe?
27 |
28 | ### QC cluster assignments
29 |
30 | Color by `mouse.sex` and expand `louvain` (cluster labels). Are the clusters we identified made up of all cells from one mouse, or are they intermingled? What does that tell you?
31 |
32 | ### Visualizing gene expression
33 |
34 | Add your favorite gene and color by its expression. Because most genes are not expressed in most cells, you may need to use the `clip` function (menu in the top right) to see the distribution.
35 | Now look at its distribution across cell types (expand the `cell_ontology_class` metadata). Are there any interesting differences?
36 |
37 | ### Compare groups of cells
38 |
39 | Select an interesting group of cells and assign it to `Set1`. Repeat for another group of cells and save them in `Set2`. Click `Compute differential expression`. What do you make of the returned differentially expressed genes? Are the p-values meaningful? What are some of the caveats for interpreting these p-values? How about the log-fold change?
40 |
41 | ### Assign cell types
42 |
43 | Practice identifying a population of cells based on their marker genes, and save your observations by creating a `New label`.
44 |
45 | ## Resources
46 |
47 | For more information about cellxgene, [read the docs here](https://chanzuckerberg.github.io/cellxgene/).
48 |
49 | To request a feature or report a bug, [check out the github repo](https://github.com/chanzuckerberg/cellxgene/issues).
50 |
51 | To chat with other users or contact the developers with questions, comments, or suggestions, [join the `#cellxgene-users` slack channel](https://join-cellxgene-users.herokuapp.com/).
52 |
--------------------------------------------------------------------------------
/content/figures/CourseAtlasAssignment.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chanzuckerberg/scRNA-python-workshop/c7816741ba8f63e1dca08dad8999e64328186404/content/figures/CourseAtlasAssignment.png
--------------------------------------------------------------------------------
/content/figures/CourseCompareTypes.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chanzuckerberg/scRNA-python-workshop/c7816741ba8f63e1dca08dad8999e64328186404/content/figures/CourseCompareTypes.png
--------------------------------------------------------------------------------
/content/figures/RNA-Seq_workflow-5.pdf.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chanzuckerberg/scRNA-python-workshop/c7816741ba8f63e1dca08dad8999e64328186404/content/figures/RNA-Seq_workflow-5.pdf.jpg
--------------------------------------------------------------------------------
/content/figures/anaconda-channel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chanzuckerberg/scRNA-python-workshop/c7816741ba8f63e1dca08dad8999e64328186404/content/figures/anaconda-channel.png
--------------------------------------------------------------------------------
/content/figures/anaconda-env.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chanzuckerberg/scRNA-python-workshop/c7816741ba8f63e1dca08dad8999e64328186404/content/figures/anaconda-env.png
--------------------------------------------------------------------------------
/content/figures/anaconda-jupyter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chanzuckerberg/scRNA-python-workshop/c7816741ba8f63e1dca08dad8999e64328186404/content/figures/anaconda-jupyter.png
--------------------------------------------------------------------------------
/content/figures/cannoodt_pseudotime_methods.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chanzuckerberg/scRNA-python-workshop/c7816741ba8f63e1dca08dad8999e64328186404/content/figures/cannoodt_pseudotime_methods.png
--------------------------------------------------------------------------------
/content/figures/cannoodt_pseudotime_properties.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chanzuckerberg/scRNA-python-workshop/c7816741ba8f63e1dca08dad8999e64328186404/content/figures/cannoodt_pseudotime_properties.png
--------------------------------------------------------------------------------
/content/figures/distrib-giant-n.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chanzuckerberg/scRNA-python-workshop/c7816741ba8f63e1dca08dad8999e64328186404/content/figures/distrib-giant-n.png
--------------------------------------------------------------------------------
/content/figures/distrib-large-n.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chanzuckerberg/scRNA-python-workshop/c7816741ba8f63e1dca08dad8999e64328186404/content/figures/distrib-large-n.png
--------------------------------------------------------------------------------
/content/figures/distrib-small-n.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chanzuckerberg/scRNA-python-workshop/c7816741ba8f63e1dca08dad8999e64328186404/content/figures/distrib-small-n.png
--------------------------------------------------------------------------------
/content/figures/drop-seq.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chanzuckerberg/scRNA-python-workshop/c7816741ba8f63e1dca08dad8999e64328186404/content/figures/drop-seq.png
--------------------------------------------------------------------------------
/content/figures/flowchart.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chanzuckerberg/scRNA-python-workshop/c7816741ba8f63e1dca08dad8999e64328186404/content/figures/flowchart.png
--------------------------------------------------------------------------------
/content/figures/git-download.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chanzuckerberg/scRNA-python-workshop/c7816741ba8f63e1dca08dad8999e64328186404/content/figures/git-download.png
--------------------------------------------------------------------------------
/content/figures/glioblastoma_facs.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chanzuckerberg/scRNA-python-workshop/c7816741ba8f63e1dca08dad8999e64328186404/content/figures/glioblastoma_facs.jpg
--------------------------------------------------------------------------------
/content/figures/graph_network.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chanzuckerberg/scRNA-python-workshop/c7816741ba8f63e1dca08dad8999e64328186404/content/figures/graph_network.jpg
--------------------------------------------------------------------------------
/content/figures/k-means.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chanzuckerberg/scRNA-python-workshop/c7816741ba8f63e1dca08dad8999e64328186404/content/figures/k-means.png
--------------------------------------------------------------------------------
/content/figures/pca.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chanzuckerberg/scRNA-python-workshop/c7816741ba8f63e1dca08dad8999e64328186404/content/figures/pca.png
--------------------------------------------------------------------------------
/content/figures/qc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chanzuckerberg/scRNA-python-workshop/c7816741ba8f63e1dca08dad8999e64328186404/content/figures/qc.png
--------------------------------------------------------------------------------
/content/figures/sc3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chanzuckerberg/scRNA-python-workshop/c7816741ba8f63e1dca08dad8999e64328186404/content/figures/sc3.png
--------------------------------------------------------------------------------
/content/figures/scater_qc_workflow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chanzuckerberg/scRNA-python-workshop/c7816741ba8f63e1dca08dad8999e64328186404/content/figures/scater_qc_workflow.png
--------------------------------------------------------------------------------
/content/figures/scfind.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chanzuckerberg/scRNA-python-workshop/c7816741ba8f63e1dca08dad8999e64328186404/content/figures/scfind.png
--------------------------------------------------------------------------------
/content/images/logo/edit-button.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
82 |
--------------------------------------------------------------------------------
/content/images/logo/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chanzuckerberg/scRNA-python-workshop/c7816741ba8f63e1dca08dad8999e64328186404/content/images/logo/favicon.ico
--------------------------------------------------------------------------------
/content/images/logo/jupyter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chanzuckerberg/scRNA-python-workshop/c7816741ba8f63e1dca08dad8999e64328186404/content/images/logo/jupyter.png
--------------------------------------------------------------------------------
/content/images/logo/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chanzuckerberg/scRNA-python-workshop/c7816741ba8f63e1dca08dad8999e64328186404/content/images/logo/logo.png
--------------------------------------------------------------------------------
/content/images/logo/logo.psd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chanzuckerberg/scRNA-python-workshop/c7816741ba8f63e1dca08dad8999e64328186404/content/images/logo/logo.psd
--------------------------------------------------------------------------------
/content/intro/overview.md:
--------------------------------------------------------------------------------
1 | # Introduction to single-cell RNA-seq
2 |
3 | ## Bulk RNA-seq
4 |
5 | - A major breakthrough (replaced microarrays) in the late 00's and has been widely used since
6 | - Measures the **average expression level** for each gene across a large population of input cells
7 | - Useful for comparative transcriptomics, e.g. samples of the same tissue from different species
8 | - Useful for quantifying expression signatures from ensembles, e.g. in disease studies
9 | - **Insufficient** for studying heterogeneous systems, e.g. early development studies, complex tissues (brain)
10 | - Does **not** provide insights into the stochastic nature of gene expression
11 |
12 | ## scRNA-seq
13 |
14 | - A **new** technology, first publication by Tang et al. in 2009
15 | - Did not gain widespread popularity until [~2014](https://www.ohio.edu/bioinformatics/upload/Single-Cell-RNA-seq-Method-of-the-Year-2013.pdf) when new protocols and lower sequencing costs made it more accessible
16 | - Measures the **distribution of expression levels** for each gene across a population of cells
17 | - Allows us to study new biological questions in which **cell-specific changes in transcriptome are important**, e.g. cell type identification, heterogeneity of cell responses, stochasticity of gene expression, inference of gene regulatory networks across the cells
18 | - Datasets range **from $10^2$ to $10^6$ cells** and increase in size every year
19 | - Currently there are several different protocols in use, e.g. SMART-seq2 (Picelli, 2013), CELL-seq (Hashimshony, 2012) and Drop-seq (Macosko, 2015)
20 | - There are also commercial platforms available, including the [Fluidigm C1](https://www.fluidigm.com/products/c1-system), [Wafergen ICELL8](https://www.wafergen.com/products/icell8-single-cell-system) and the [10X Genomics Chromium](https://www.10xgenomics.com/single-cell/)
21 | - Several computational analysis methods from bulk RNA-seq **can** be used
22 | - **In most cases** computational analysis requires adaptation of the existing methods or development of new ones
23 |
24 | ## Workflow
25 |
26 | 
27 |
28 | Overall, experimental scRNA-seq protocols are similar to the methods used for bulk RNA-seq. We will be discussing some of the most common approaches in the next chapter.
29 |
30 | ## Computational Analysis
31 |
32 | This course is concerned with the computational analysis of the data
33 | obtained from scRNA-seq experiments. The first steps (yellow) are general for any highthroughput sequencing data. Later steps (orange) require a mix of existing RNASeq analysis methods and novel methods to address the technical difference of scRNASeq. Finally the biological interpretation (blue) **should** be analyzed with methods specifically developed for scRNASeq.
34 |
35 |
36 |
37 | We recommend the recent review of scRNA-seq analysis by [Luecken and Theis](https://www.embopress.org/doi/full/10.15252/msb.20188746).
38 |
39 | Today, there are also several different platforms available for carrying out one or more steps in the flowchart above. The most popular include:
40 |
41 | - [Seurat](http://satijalab.org/seurat/) is an R package designed for QC, analysis, and exploration of single cell RNA-seq data.
42 | - [Bioconductor](https://master.bioconductor.org/packages/release/workflows/html/simpleSingleCell.html) is a open-source, open-development R project for the analysis of high-throughput genomics data, including packages for the analysis of single-cell data.
43 | - [Scanpy](https://scanpy.readthedocs.io/en/stable/) is a Python package similar to Seurat
44 |
45 | ## Challenges
46 |
47 | The main difference between bulk and single cell RNA-seq is that each sequencing library represents a single cell, instead of a population of cells. Therefore, significant attention has to be paid to comparison of the results from different cells (sequencing libraries). The main sources of discrepancy between the libraries are:
48 |
49 | - **Amplification** (up to 1 million fold)
50 | - **Gene 'dropouts'** in which a gene is observed at a moderate expression level in one cell but is not detected in another cell (Kharchenko, 2014).
51 |
52 | In both cases the discrepancies are introduced due to low starting amounts of transcripts since the RNA comes from one cell only. Improving the transcript capture efficiency and reducing the amplification bias are currently active areas of research. However, as we shall see in this course, it is possible to alleviate some of these issues through proper normalization and corrections.
53 |
--------------------------------------------------------------------------------
/scripts/__pycache__/clean.cpython-37.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chanzuckerberg/scRNA-python-workshop/c7816741ba8f63e1dca08dad8999e64328186404/scripts/__pycache__/clean.cpython-37.pyc
--------------------------------------------------------------------------------
/scripts/clean.py:
--------------------------------------------------------------------------------
1 | """A helper script to "clean up" all of your generated markdown and HTML files."""
2 | import shutil as sh
3 | import os.path as op
4 |
5 | path_root = op.join(op.dirname(op.abspath(__file__)), '..')
6 |
7 | paths = [op.join(path_root, '_site'),
8 | op.join(path_root, '_build')]
9 | for path in paths:
10 | print('Removing {}...'.format(path))
11 | sh.rmtree(path, ignore_errors=True)
12 |
13 | print('Done!')
14 |
--------------------------------------------------------------------------------
/scripts/templates/celltags.tpl:
--------------------------------------------------------------------------------
1 | {%- macro celltags(cell) -%}
2 | {% if cell.metadata.tags | length > 0 -%}
3 | {% for tag in cell.metadata.tags -%}
4 | {{ ' tag_' ~ tag -}}
5 | {%- if tag == 'hidecode' %} tag_hide_input{% endif %}
6 | {%- endfor -%}
7 | {%- endif %}
8 | {%- endmacro %}
--------------------------------------------------------------------------------
/scripts/templates/html.tpl:
--------------------------------------------------------------------------------
1 | {% extends 'basic.tpl' %}
2 | {% from 'celltags.tpl' import celltags %}
3 |
4 | {% block any_cell %}
5 |
6 | {{ super() }}
7 |
8 | {% endblock any_cell %}
9 |
10 |
11 | {% block output %}
12 |
13 | {{- super() -}}
14 |
15 | {%- endblock output %}
16 |
--------------------------------------------------------------------------------
/scripts/templates/jekyllmd.tpl:
--------------------------------------------------------------------------------
1 | {%- extends 'markdown.tpl' -%}
2 |
3 |
4 | {%- block codecell %}
5 | {% if 'remove_cell' not in cell.metadata.tags and 'removecell' not in cell.metadata.tags %}
6 |
7 | {{- super() }}
8 |
9 | {% endif %}
10 | {% endblock codecell %}
11 |
12 |
13 | {% block input %}
14 | {%- if 'remove_input' not in cell.metadata.tags %}
15 | {%- if cell.source != '' -%}
16 |
17 | ```
18 | {%- if 'magics_language' in cell.metadata -%}
19 | {{ cell.metadata.magics_language}}
20 | {%- elif 'name' in nb.metadata.get('language_info', {}) -%}
21 | {{ nb.metadata.language_info.name }}
22 | {% endif %}
23 | {{- cell.source }}
24 | {% endif %}
25 | ```
26 |
27 | {%- endif %}
28 | {% endblock input %}
29 |
30 |
31 | {% block output %}
32 |
33 |
34 | {{- super() -}}
35 |
36 |
37 | {%- endblock output %}
38 |
39 |
40 | {%- block stream %}
41 | {:.output_stream}
42 | ```
43 | {{ output.text -}}
44 | ```
45 | {% endblock stream %}
46 |
47 |
48 | {% block data_text -%}
49 | {:.output_data_text}
50 | ```
51 | {{ output.data['text/plain'] }}
52 | ```
53 | {% endblock data_text %}
54 |
55 |
56 | {%- block error %}
57 | {:.output_traceback_line}
58 | ```
59 | {{- super() }}
60 | ```
61 | {% endblock error %}
62 |
63 | {%- block data_html %}
64 |
65 | {{ output.data['text/html'] }}
66 |
67 | {% endblock data_html %}
68 |
69 | {%- block data_png %}
70 | {:.output_png}
71 | {{- super() -}}
72 | {% endblock data_png %}
73 |
74 |
75 | {% block markdowncell %}
76 | {% if 'remove_cell' not in cell.metadata.tags and 'removecell' not in cell.metadata.tags %}
77 | {{- super() }}
78 | {% endif %}
79 | {%- endblock markdowncell %}
--------------------------------------------------------------------------------
/sfn-workshop.yml:
--------------------------------------------------------------------------------
1 | name: sfn-workshop
2 | channels:
3 | - conda-forge
4 | - defaults
5 | dependencies:
6 | - jupyter
7 | - matplotlib > 3.0
8 | - numpy > 1.17
9 | - pandas > 0.25
10 | - scikit-image > 0.16
11 | - scikit-learn > 0.21
12 | - scipy > 1.3
13 |
--------------------------------------------------------------------------------