{"action":"created","comment":{"url":"https://api.github.com/repos/czbiohub/blog/pulls/comments/211340565","pull_request_review_id":147740082,"id":211340565,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMTM0MDU2NQ==","diff_hunk":"@@ -0,0 +1,510 @@\n+---\n+layout: post\n+mathjax: true\n+codehide: true\n+title: The Effect of PCR on scRNAseq\n+date: 2018-08-23\n+---\n+\n+One interesting facet of the Tabula Muris data is the fact that we have data from the same samples using two different technologies: microfluidic droplet-based 3’-end counting using the 10x genomics platform, and FACS-based full-length transcript analysis with Smart-Seq2. Both platforms have advantages: droplets let us rapidly profile thousands of cells, but Smart-Seq2 tends to recover more genes per cell and can be sequenced to higher depth.\n+\n+Our dataset provides us with the opportunity to compare the advantages of these technologies on a relatively level playing field. For a detailed discussion of this topic, you can check out the [preprint on bioR$\\chi$iv](https://www.biorxiv.org/content/early/2018/03/29/237446).\n+\n+\n+```python\n+import numpy as np\n+import pandas as pd\n+\n+import scipy.stats as st\n+\n+import scanpy\n+\n+import altair as alt\n+from altair import pipe, limit_rows, to_values\n+\n+# increase row limit for altair\n+t = lambda data: pipe(data, limit_rows(max_rows=1000000), to_values)\n+alt.data_transformers.register('custom', t)\n+alt.data_transformers.enable('custom')\n+\n+# render to png directly to save memory\n+alt.renderers.register('png', alt.vegalite.v2.display.png_renderer)\n+alt.renderers.enable('png')\n+```\n+\n+\n+```python\n+# read in FACS data\n+facs_metadata = pd.read_csv('../../data/TM_facs_metadata.csv', index_col=0, dtype=str)\n+facs_data = scanpy.anndata.read_h5ad('../../data/TM_facs_mat.h5ad')\n+\n+# read in droplet data\n+droplet_metadata = pd.read_csv('../../data/TM_droplet_metadata.csv', index_col=0, dtype=str)\n+droplet_data = scanpy.anndata.read_h5ad('../../data/TM_droplet_mat.h5ad')\n+\n+# subset to thymus\n+facs_thymus = facs_data[facs_metadata['tissue'] == 'Thymus', :]\n+droplet_thymus = droplet_data[droplet_metadata['tissue'] == 'Thymus', :]\n+\n+# convert to dense arrays to reduce boilerplate later\n+facs_thymus.X = np.asarray(facs_thymus.X.todense())\n+droplet_thymus.X = np.asarray(droplet_thymus.X.todense())\n+```\n+\n+We start with a simple question: when looking at cells of the same type using both technologies, how often do we see evidence of any particular gene?\n+\n+\n+```python\n+alt.hconcat(\n+    alt.Chart(\n+        pd.DataFrame({'FACS': (facs_thymus.X.sum(0) + 1) / facs_thymus.X.sum(),\n+                      'Droplet': (droplet_thymus.X.sum(0) + 1) / droplet_thymus.X.sum()}),\n+        title='Fraction of total reads'\n+    ).mark_point(opacity=0.3).encode(\n+        x=alt.X('FACS', type='quantitative', scale=alt.Scale(type='log')),\n+        y=alt.Y('Droplet', type='quantitative', scale=alt.Scale(type='log'))\n+    ),\n+    alt.Chart(\n+        pd.DataFrame({'FACS': (1 + (facs_thymus.X > 0).sum(0)).T / facs_thymus.X.shape[0],\n+                      'Droplet': (1 + (droplet_thymus.X > 0).sum(0)).T / droplet_thymus.X.shape[0]}),\n+        title='Percent of cells with ≥ 1 read'\n+    ).mark_point(opacity=0.3).encode(\n+        x=alt.X('FACS', type='quantitative', axis=alt.Axis(format='%')),\n+        y=alt.Y('Droplet', type='quantitative', axis=alt.Axis(format='%'))\n+    )\n+)\n+```\n+\n+\n+\n+![png](/images/The-Effect-of-PCR-on-scRNAseq_files/The-Effect-of-PCR-on-scRNAseq_4_0.png)\n+\n+\n+It's tempting to stare at these plots and start to draw conclusions about the relative merits of droplet- and FACS-based methods. Indeed, in the [initial draft](https://www.biorxiv.org/content/early/2017/12/20/237446) we devoted some time to these types of plots. But differences in methodology mean that the data are not exactly comparable. To illustrate that point, we'll change the axes for these plots, and for each method we'll plot the per-gene fraction of total reads versus the percent of cells with ≥1 read.","path":"_blog/The-Effect-of-PCR-on-scRNAseq.md","position":83,"original_position":83,"commit_id":"fa07dc05685547e0663cc705f92c0e49bcc2e66a","original_commit_id":"fa07dc05685547e0663cc705f92c0e49bcc2e66a","user":{"login":"aopisco","id":25906087,"node_id":"MDQ6VXNlcjI1OTA2MDg3","avatar_url":"https://avatars1.githubusercontent.com/u/25906087?v=4","gravatar_id":"","url":"https://api.github.com/users/aopisco","html_url":"https://github.com/aopisco","followers_url":"https://api.github.com/users/aopisco/followers","following_url":"https://api.github.com/users/aopisco/following{/other_user}","gists_url":"https://api.github.com/users/aopisco/gists{/gist_id}","starred_url":"https://api.github.com/users/aopisco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aopisco/subscriptions","organizations_url":"https://api.github.com/users/aopisco/orgs","repos_url":"https://api.github.com/users/aopisco/repos","events_url":"https://api.github.com/users/aopisco/events{/privacy}","received_events_url":"https://api.github.com/users/aopisco/received_events","type":"User","site_admin":false},"body":"typess of plots, but","created_at":"2018-08-20T17:17:17Z","updated_at":"2018-08-20T17:17:17Z","html_url":"https://github.com/czbiohub/blog/pull/6#discussion_r211340565","pull_request_url":"https://api.github.com/repos/czbiohub/blog/pulls/6","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/czbiohub/blog/pulls/comments/211340565"},"html":{"href":"https://github.com/czbiohub/blog/pull/6#discussion_r211340565"},"pull_request":{"href":"https://api.github.com/repos/czbiohub/blog/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/czbiohub/blog/pulls/6","id":209277360,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA5Mjc3MzYw","html_url":"https://github.com/czbiohub/blog/pull/6","diff_url":"https://github.com/czbiohub/blog/pull/6.diff","patch_url":"https://github.com/czbiohub/blog/pull/6.patch","issue_url":"https://api.github.com/repos/czbiohub/blog/issues/6","number":6,"state":"open","locked":false,"title":"[WIP] PCR post","user":{"login":"jamestwebber","id":963647,"node_id":"MDQ6VXNlcjk2MzY0Nw==","avatar_url":"https://avatars0.githubusercontent.com/u/963647?v=4","gravatar_id":"","url":"https://api.github.com/users/jamestwebber","html_url":"https://github.com/jamestwebber","followers_url":"https://api.github.com/users/jamestwebber/followers","following_url":"https://api.github.com/users/jamestwebber/following{/other_user}","gists_url":"https://api.github.com/users/jamestwebber/gists{/gist_id}","starred_url":"https://api.github.com/users/jamestwebber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamestwebber/subscriptions","organizations_url":"https://api.github.com/users/jamestwebber/orgs","repos_url":"https://api.github.com/users/jamestwebber/repos","events_url":"https://api.github.com/users/jamestwebber/events{/privacy}","received_events_url":"https://api.github.com/users/jamestwebber/received_events","type":"User","site_admin":false},"body":"Not quite ready for posting but thought I'd start the PR now. Still need\r\n\r\n- [ ] Add an introductory figure (perhaps a gif from how-many-molecules via @batson )\r\n- [ ] Figure out what links I should add to the bottom (potentially remove the little footer blurb)\r\n- [ ] Either clean up or remove the hypergeometric stuff at the end","created_at":"2018-08-17T23:13:42Z","updated_at":"2018-08-20T17:17:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a695ed9f65ca57eb5fbc062643d2f654d75f3f6a","assignee":null,"assignees":[],"requested_reviewers":[{"login":"olgabot","id":806256,"node_id":"MDQ6VXNlcjgwNjI1Ng==","avatar_url":"https://avatars2.githubusercontent.com/u/806256?v=4","gravatar_id":"","url":"https://api.github.com/users/olgabot","html_url":"https://github.com/olgabot","followers_url":"https://api.github.com/users/olgabot/followers","following_url":"https://api.github.com/users/olgabot/following{/other_user}","gists_url":"https://api.github.com/users/olgabot/gists{/gist_id}","starred_url":"https://api.github.com/users/olgabot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olgabot/subscriptions","organizations_url":"https://api.github.com/users/olgabot/orgs","repos_url":"https://api.github.com/users/olgabot/repos","events_url":"https://api.github.com/users/olgabot/events{/privacy}","received_events_url":"https://api.github.com/users/olgabot/received_events","type":"User","site_admin":false},{"login":"batson","id":1261162,"node_id":"MDQ6VXNlcjEyNjExNjI=","avatar_url":"https://avatars3.githubusercontent.com/u/1261162?v=4","gravatar_id":"","url":"https://api.github.com/users/batson","html_url":"https://github.com/batson","followers_url":"https://api.github.com/users/batson/followers","following_url":"https://api.github.com/users/batson/following{/other_user}","gists_url":"https://api.github.com/users/batson/gists{/gist_id}","starred_url":"https://api.github.com/users/batson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/batson/subscriptions","organizations_url":"https://api.github.com/users/batson/orgs","repos_url":"https://api.github.com/users/batson/repos","events_url":"https://api.github.com/users/batson/events{/privacy}","received_events_url":"https://api.github.com/users/batson/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/czbiohub/blog/pulls/6/commits","review_comments_url":"https://api.github.com/repos/czbiohub/blog/pulls/6/comments","review_comment_url":"https://api.github.com/repos/czbiohub/blog/pulls/comments{/number}","comments_url":"https://api.github.com/repos/czbiohub/blog/issues/6/comments","statuses_url":"https://api.github.com/repos/czbiohub/blog/statuses/fa07dc05685547e0663cc705f92c0e49bcc2e66a","head":{"label":"czbiohub:pcr_model","ref":"pcr_model","sha":"fa07dc05685547e0663cc705f92c0e49bcc2e66a","user":{"login":"czbiohub","id":28747162,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4NzQ3MTYy","avatar_url":"https://avatars3.githubusercontent.com/u/28747162?v=4","gravatar_id":"","url":"https://api.github.com/users/czbiohub","html_url":"https://github.com/czbiohub","followers_url":"https://api.github.com/users/czbiohub/followers","following_url":"https://api.github.com/users/czbiohub/following{/other_user}","gists_url":"https://api.github.com/users/czbiohub/gists{/gist_id}","starred_url":"https://api.github.com/users/czbiohub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/czbiohub/subscriptions","organizations_url":"https://api.github.com/users/czbiohub/orgs","repos_url":"https://api.github.com/users/czbiohub/repos","events_url":"https://api.github.com/users/czbiohub/events{/privacy}","received_events_url":"https://api.github.com/users/czbiohub/received_events","type":"Organization","site_admin":false},"repo":{"id":142620308,"node_id":"MDEwOlJlcG9zaXRvcnkxNDI2MjAzMDg=","name":"blog","full_name":"czbiohub/blog","owner":{"login":"czbiohub","id":28747162,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4NzQ3MTYy","avatar_url":"https://avatars3.githubusercontent.com/u/28747162?v=4","gravatar_id":"","url":"https://api.github.com/users/czbiohub","html_url":"https://github.com/czbiohub","followers_url":"https://api.github.com/users/czbiohub/followers","following_url":"https://api.github.com/users/czbiohub/following{/other_user}","gists_url":"https://api.github.com/users/czbiohub/gists{/gist_id}","starred_url":"https://api.github.com/users/czbiohub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/czbiohub/subscriptions","organizations_url":"https://api.github.com/users/czbiohub/orgs","repos_url":"https://api.github.com/users/czbiohub/repos","events_url":"https://api.github.com/users/czbiohub/events{/privacy}","received_events_url":"https://api.github.com/users/czbiohub/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/czbiohub/blog","description":"The CZ Biohub Data Sciences Blog","fork":false,"url":"https://api.github.com/repos/czbiohub/blog","forks_url":"https://api.github.com/repos/czbiohub/blog/forks","keys_url":"https://api.github.com/repos/czbiohub/blog/keys{/key_id}","collaborators_url":"https://api.github.com/repos/czbiohub/blog/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/czbiohub/blog/teams","hooks_url":"https://api.github.com/repos/czbiohub/blog/hooks","issue_events_url":"https://api.github.com/repos/czbiohub/blog/issues/events{/number}","events_url":"https://api.github.com/repos/czbiohub/blog/events","assignees_url":"https://api.github.com/repos/czbiohub/blog/assignees{/user}","branches_url":"https://api.github.com/repos/czbiohub/blog/branches{/branch}","tags_url":"https://api.github.com/repos/czbiohub/blog/tags","blobs_url":"https://api.github.com/repos/czbiohub/blog/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/czbiohub/blog/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/czbiohub/blog/git/refs{/sha}","trees_url":"https://api.github.com/repos/czbiohub/blog/git/trees{/sha}","statuses_url":"https://api.github.com/repos/czbiohub/blog/statuses/{sha}","languages_url":"https://api.github.com/repos/czbiohub/blog/languages","stargazers_url":"https://api.github.com/repos/czbiohub/blog/stargazers","contributors_url":"https://api.github.com/repos/czbiohub/blog/contributors","subscribers_url":"https://api.github.com/repos/czbiohub/blog/subscribers","subscription_url":"https://api.github.com/repos/czbiohub/blog/subscription","commits_url":"https://api.github.com/repos/czbiohub/blog/commits{/sha}","git_commits_url":"https://api.github.com/repos/czbiohub/blog/git/commits{/sha}","comments_url":"https://api.github.com/repos/czbiohub/blog/comments{/number}","issue_comment_url":"https://api.github.com/repos/czbiohub/blog/issues/comments{/number}","contents_url":"https://api.github.com/repos/czbiohub/blog/contents/{+path}","compare_url":"https://api.github.com/repos/czbiohub/blog/compare/{base}...{head}","merges_url":"https://api.github.com/repos/czbiohub/blog/merges","archive_url":"https://api.github.com/repos/czbiohub/blog/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/czbiohub/blog/downloads","issues_url":"https://api.github.com/repos/czbiohub/blog/issues{/number}","pulls_url":"https://api.github.com/repos/czbiohub/blog/pulls{/number}","milestones_url":"https://api.github.com/repos/czbiohub/blog/milestones{/number}","notifications_url":"https://api.github.com/repos/czbiohub/blog/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/czbiohub/blog/labels{/name}","releases_url":"https://api.github.com/repos/czbiohub/blog/releases{/id}","deployments_url":"https://api.github.com/repos/czbiohub/blog/deployments","created_at":"2018-07-27T20:21:27Z","updated_at":"2018-08-17T21:59:56Z","pushed_at":"2018-08-20T17:11:55Z","git_url":"git://github.com/czbiohub/blog.git","ssh_url":"git@github.com:czbiohub/blog.git","clone_url":"https://github.com/czbiohub/blog.git","svn_url":"https://github.com/czbiohub/blog","homepage":"","size":17982,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":3,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"czbiohub:master","ref":"master","sha":"4a6c12ff6f3c3d55d41d1ff3241827e10862a937","user":{"login":"czbiohub","id":28747162,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4NzQ3MTYy","avatar_url":"https://avatars3.githubusercontent.com/u/28747162?v=4","gravatar_id":"","url":"https://api.github.com/users/czbiohub","html_url":"https://github.com/czbiohub","followers_url":"https://api.github.com/users/czbiohub/followers","following_url":"https://api.github.com/users/czbiohub/following{/other_user}","gists_url":"https://api.github.com/users/czbiohub/gists{/gist_id}","starred_url":"https://api.github.com/users/czbiohub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/czbiohub/subscriptions","organizations_url":"https://api.github.com/users/czbiohub/orgs","repos_url":"https://api.github.com/users/czbiohub/repos","events_url":"https://api.github.com/users/czbiohub/events{/privacy}","received_events_url":"https://api.github.com/users/czbiohub/received_events","type":"Organization","site_admin":false},"repo":{"id":142620308,"node_id":"MDEwOlJlcG9zaXRvcnkxNDI2MjAzMDg=","name":"blog","full_name":"czbiohub/blog","owner":{"login":"czbiohub","id":28747162,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4NzQ3MTYy","avatar_url":"https://avatars3.githubusercontent.com/u/28747162?v=4","gravatar_id":"","url":"https://api.github.com/users/czbiohub","html_url":"https://github.com/czbiohub","followers_url":"https://api.github.com/users/czbiohub/followers","following_url":"https://api.github.com/users/czbiohub/following{/other_user}","gists_url":"https://api.github.com/users/czbiohub/gists{/gist_id}","starred_url":"https://api.github.com/users/czbiohub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/czbiohub/subscriptions","organizations_url":"https://api.github.com/users/czbiohub/orgs","repos_url":"https://api.github.com/users/czbiohub/repos","events_url":"https://api.github.com/users/czbiohub/events{/privacy}","received_events_url":"https://api.github.com/users/czbiohub/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/czbiohub/blog","description":"The CZ Biohub Data Sciences Blog","fork":false,"url":"https://api.github.com/repos/czbiohub/blog","forks_url":"https://api.github.com/repos/czbiohub/blog/forks","keys_url":"https://api.github.com/repos/czbiohub/blog/keys{/key_id}","collaborators_url":"https://api.github.com/repos/czbiohub/blog/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/czbiohub/blog/teams","hooks_url":"https://api.github.com/repos/czbiohub/blog/hooks","issue_events_url":"https://api.github.com/repos/czbiohub/blog/issues/events{/number}","events_url":"https://api.github.com/repos/czbiohub/blog/events","assignees_url":"https://api.github.com/repos/czbiohub/blog/assignees{/user}","branches_url":"https://api.github.com/repos/czbiohub/blog/branches{/branch}","tags_url":"https://api.github.com/repos/czbiohub/blog/tags","blobs_url":"https://api.github.com/repos/czbiohub/blog/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/czbiohub/blog/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/czbiohub/blog/git/refs{/sha}","trees_url":"https://api.github.com/repos/czbiohub/blog/git/trees{/sha}","statuses_url":"https://api.github.com/repos/czbiohub/blog/statuses/{sha}","languages_url":"https://api.github.com/repos/czbiohub/blog/languages","stargazers_url":"https://api.github.com/repos/czbiohub/blog/stargazers","contributors_url":"https://api.github.com/repos/czbiohub/blog/contributors","subscribers_url":"https://api.github.com/repos/czbiohub/blog/subscribers","subscription_url":"https://api.github.com/repos/czbiohub/blog/subscription","commits_url":"https://api.github.com/repos/czbiohub/blog/commits{/sha}","git_commits_url":"https://api.github.com/repos/czbiohub/blog/git/commits{/sha}","comments_url":"https://api.github.com/repos/czbiohub/blog/comments{/number}","issue_comment_url":"https://api.github.com/repos/czbiohub/blog/issues/comments{/number}","contents_url":"https://api.github.com/repos/czbiohub/blog/contents/{+path}","compare_url":"https://api.github.com/repos/czbiohub/blog/compare/{base}...{head}","merges_url":"https://api.github.com/repos/czbiohub/blog/merges","archive_url":"https://api.github.com/repos/czbiohub/blog/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/czbiohub/blog/downloads","issues_url":"https://api.github.com/repos/czbiohub/blog/issues{/number}","pulls_url":"https://api.github.com/repos/czbiohub/blog/pulls{/number}","milestones_url":"https://api.github.com/repos/czbiohub/blog/milestones{/number}","notifications_url":"https://api.github.com/repos/czbiohub/blog/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/czbiohub/blog/labels{/name}","releases_url":"https://api.github.com/repos/czbiohub/blog/releases{/id}","deployments_url":"https://api.github.com/repos/czbiohub/blog/deployments","created_at":"2018-07-27T20:21:27Z","updated_at":"2018-08-17T21:59:56Z","pushed_at":"2018-08-20T17:11:55Z","git_url":"git://github.com/czbiohub/blog.git","ssh_url":"git@github.com:czbiohub/blog.git","clone_url":"https://github.com/czbiohub/blog.git","svn_url":"https://github.com/czbiohub/blog","homepage":"","size":17982,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":3,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/czbiohub/blog/pulls/6"},"html":{"href":"https://github.com/czbiohub/blog/pull/6"},"issue":{"href":"https://api.github.com/repos/czbiohub/blog/issues/6"},"comments":{"href":"https://api.github.com/repos/czbiohub/blog/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/czbiohub/blog/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/czbiohub/blog/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/czbiohub/blog/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/czbiohub/blog/statuses/fa07dc05685547e0663cc705f92c0e49bcc2e66a"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"aopisco"}}