<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="generator" content="pandoc" /> <meta name="author" content="Joyce Hsiao" /> <title>Compares gene annotations between two different cell time types</title> <script src="site_libs/jquery-1.11.3/jquery.min.js"></script> <meta name="viewport" content="width=device-width, initial-scale=1" /> <link href="site_libs/bootstrap-3.3.5/css/cosmo.min.css" rel="stylesheet" /> <script src="site_libs/bootstrap-3.3.5/js/bootstrap.min.js"></script> <script src="site_libs/bootstrap-3.3.5/shim/html5shiv.min.js"></script> <script src="site_libs/bootstrap-3.3.5/shim/respond.min.js"></script> <script src="site_libs/navigation-1.1/tabsets.js"></script> <link href="site_libs/highlightjs-9.12.0/textmate.css" rel="stylesheet" /> <script src="site_libs/highlightjs-9.12.0/highlight.js"></script> <link href="site_libs/font-awesome-5.0.13/css/fa-svg-with-js.css" rel="stylesheet" /> <script src="site_libs/font-awesome-5.0.13/js/fontawesome-all.min.js"></script> <script src="site_libs/font-awesome-5.0.13/js/fa-v4-shims.min.js"></script> <style type="text/css">code{white-space: pre;}</style> <style type="text/css"> pre:not([class]) { background-color: white; } </style> <script type="text/javascript"> if (window.hljs) { hljs.configure({languages: []}); hljs.initHighlightingOnLoad(); if (document.readyState && document.readyState === "complete") { window.setTimeout(function() { hljs.initHighlighting(); }, 0); } } </script> <style type="text/css"> h1 { font-size: 34px; } h1.title { font-size: 38px; } h2 { font-size: 30px; } h3 { font-size: 24px; } h4 { font-size: 18px; } h5 { font-size: 16px; } h6 { font-size: 12px; } .table th:not([align]) { text-align: left; } </style> </head> <body> <style type = "text/css"> .main-container { max-width: 940px; margin-left: auto; margin-right: auto; } code { color: inherit; background-color: rgba(0, 0, 0, 0.04); } img { max-width:100%; height: auto; } .tabbed-pane { padding-top: 12px; } .html-widget { margin-bottom: 20px; } button.code-folding-btn:focus { outline: none; } </style> <style type="text/css"> /* padding for bootstrap navbar */ body { padding-top: 51px; padding-bottom: 40px; } /* offset scroll position for anchor links (for fixed navbar) */ .section h1 { padding-top: 56px; margin-top: -56px; } .section h2 { padding-top: 56px; margin-top: -56px; } .section h3 { padding-top: 56px; margin-top: -56px; } .section h4 { padding-top: 56px; margin-top: -56px; } .section h5 { padding-top: 56px; margin-top: -56px; } .section h6 { padding-top: 56px; margin-top: -56px; } </style> <script> // manage active state of menu based on current page $(document).ready(function () { // active menu anchor href = window.location.pathname href = href.substr(href.lastIndexOf('/') + 1) if (href === "") href = "index.html"; var menuAnchor = $('a[href="' + href + '"]'); // mark it active menuAnchor.parent().addClass('active'); // if it's got a parent navbar menu mark it active as well menuAnchor.closest('li.dropdown').addClass('active'); }); </script> <div class="container-fluid main-container"> <!-- tabsets --> <script> $(document).ready(function () { window.buildTabsets("TOC"); }); </script> <!-- code folding --> <div class="navbar navbar-default navbar-fixed-top" role="navigation"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="index.html">fucci-seq</a> </div> <div id="navbar" class="navbar-collapse collapse"> <ul class="nav navbar-nav"> <li> <a href="index.html">Home</a> </li> <li> <a href="about.html">About</a> </li> <li> <a href="license.html">License</a> </li> </ul> <ul class="nav navbar-nav navbar-right"> <li> <a href="https://github.com/jdblischak/fucci-seq"> <span class="fa fa-github"></span> </a> </li> </ul> </div><!--/.nav-collapse --> </div><!--/.container --> </div><!--/.navbar --> <!-- Add a small amount of space between sections. --> <style type="text/css"> div.section { padding-top: 12px; } </style> <div class="fluid-row" id="header"> <h1 class="title toc-ignore">Compares gene annotations between two different cell time types</h1> <h4 class="author"><em>Joyce Hsiao</em></h4> </div> <div id="TOC"> <ul> <li><a href="#goals">Goals</a></li> <li><a href="#retrieve-gene-lists">Retrieve gene lists</a></li> <li><a href="#overlap-with-each-other">Overlap with each other</a></li> <li><a href="#overlap-with-seurat-genes">Overlap with Seurat genes</a></li> <li><a href="#save-top-100-genes-symbols-to-output-table">Save top 100 genes symbols to output table</a></li> <li><a href="#session-information">Session information</a></li> </ul> </div> <!-- The file analysis/chunks.R contains chunks that define default settings shared across the workflowr files. --> <!-- Update knitr chunk options --> <!-- Insert the date the file was last updated --> <p><strong>Last updated:</strong> 2018-07-16</p> <!-- Insert the code version (Git commit SHA1) if Git repository exists and R package git2r is installed --> <p><strong>Code version:</strong> 20b2161</p> <hr /> <div id="goals" class="section level2"> <h2>Goals</h2> <p>Consider top X cyclical genes, check GO categories.</p> <ol style="list-style-type: decimal"> <li><p>Examine number of genes selected at top X cut-offs: Across cut-offs, more selected when cyclical trend is based on fucci time instead of fucci + dapi time.</p></li> <li><p>Compare the prediction error patterns between these two scenarios. While both are higher than when the expression data is used to predict random cell time lables, the effect of adding more genes is quite different on prediction error. When the cyclical genes are learned from fucci times, there appears to be roughly an increase of .01 between top 5 and top 100 genes prediction. On the contrary, when the cyclical genes are learned from fucci-times, there appears to be roughly a decrease of .01 between top 5 and top 100 gene prediction.</p></li> <li><p>It is possible that the cell times based on fucci and dapi does not reflect the cell time ordering accurately. The PCs based on FUCCI and DAPI form an ellipse rather than a circle. Hence I am re-running the analysis using a different data transformation that account for the fact that the PC1 and PC2 form an ellipse rather than a circle.</p></li> <li><p>In terms of GO annotation, there’s not much difference between the two. Both have 37 genes found to be related to the Cell Cycle GO term (0007049).</p></li> </ol> <hr /> </div> <div id="retrieve-gene-lists" class="section level2"> <h2>Retrieve gene lists</h2> <pre class="r"><code>genes_list <- readRDS(file = "../data/results/results_topgenes.rds") genes_list_triple <- readRDS(file = "../data/results/triple_results_topgenes.rds") all_genes <- genes_list[length(genes_list)][[1]] library(biomaRt) ensembl <- useMart(biomart = "ensembl", dataset = "hsapiens_gene_ensembl") symbols <- getBM(attributes = c("hgnc_symbol",'ensembl_gene_id'), filters = c('ensembl_gene_id'), values = all_genes, mart = ensembl) # get gene symbols for gene list under fucci cell time prediction genes_list_symbols <- lapply(1:length(genes_list), function(i) { ll <- genes_list[i][[1]] #symbols[match(ll,symbols$ensembl_gene_id),] symbs <- symbols[which(symbols$ensembl_gene_id %in% ll),] non_symbs <- ll[which(!(ll %in% symbols$ensembl_gene_id))] df_non_symbs <- data.frame(hgnc_symbol=NA, ensembl_gene_id=non_symbs) out <- rbind(symbs, df_non_symbs) out <- out[match(ll,out$ensembl_gene_id),] return(out) }) names(genes_list_symbols) <- names(genes_list) # get gene symbols for gene list under fucci and dapi cell time prediction genes_list_symbols_triple <- lapply(1:length(genes_list_triple), function(i) { ll <- genes_list_triple[i][[1]] #symbols[match(ll,symbols$ensembl_gene_id),] symbs <- symbols[which(symbols$ensembl_gene_id %in% ll),] non_symbs <- ll[which(!(ll %in% symbols$ensembl_gene_id))] if (length(non_symbs)==0) { out <- symbs } if (length(non_symbs)>0) { df_non_symbs <- data.frame(hgnc_symbol=NA, ensembl_gene_id=non_symbs) out <- rbind(symbs, df_non_symbs) } out <- out[match(ll,out$ensembl_gene_id),] return(out) }) names(genes_list_symbols_triple) <- names(genes_list_triple) saveRDS(genes_list_symbols, "../output/method-train-genes-fucci-vs-triple.Rmd/genes_list_symbols.rds") saveRDS(genes_list_symbols_triple, "../output/method-train-genes-fucci-vs-triple.Rmd/genes_list_symbols_triple.rds")</code></pre> <hr /> </div> <div id="overlap-with-each-other" class="section level2"> <h2>Overlap with each other</h2> <pre class="r"><code>genes_list <- readRDS(file = "../data/results/results_topgenes.rds") genes_list_triple <- readRDS(file = "../data/results/triple_results_topgenes.rds") both_overlap <- sapply(1:length(genes_list), function(i) { overlap_genes <- intersect(genes_list[[i]],genes_list_triple[[i]]) length(overlap_genes) }) par(mfrow=c(1,2)) plot(x=names(genes_list)[1:21], y=both_overlap[1:21], ylim=c(0,100), xlab="Top X cyclical genes", ylab="Number of selected genes") points(x=names(genes_list)[1:21], y=sapply(genes_list, length)[1:21], col="blue", pch=16, cex=.7) points(x=names(genes_list_triple)[1:21], y=sapply(genes_list_triple, length)[1:21], col="forestgreen", pch=16, cex=.7) legend("topleft", legend=c("both", "fucci", "triple"), col=c("black", "blue", "forestgreen"), pch=1) plot(x=names(genes_list)[1:11], y=both_overlap[1:11], ylim=c(0,60), xlab="Top X cyclical genes", ylab="Number of selected genes") points(x=names(genes_list)[1:11], y=sapply(genes_list, length)[1:11], col="blue", pch=16, cex=.7) points(x=names(genes_list_triple)[1:11], y=sapply(genes_list_triple, length)[1:11], col="forestgreen", pch=16, cex=.7) title("Overlap between selected genes", outer=TRUE, line=-1)</code></pre> <p><img src="figure/method-train-genes-fucci-vs-triple.Rmd/unnamed-chunk-2-1.png" width="672" style="display: block; margin: auto;" /></p> <hr /> </div> <div id="overlap-with-seurat-genes" class="section level2"> <h2>Overlap with Seurat genes</h2> <pre class="r"><code>genes_list <- readRDS(file = "../data/results/results_topgenes.rds") genes_list_triple <- readRDS(file = "../data/results/triple_results_topgenes.rds") genes_list_symbols <- readRDS("../output/method-train-genes-fucci-vs-triple.Rmd/genes_list_symbols.rds") genes_list_symbols_triple <- readRDS("../output/method-train-genes-fucci-vs-triple.Rmd/genes_list_symbols_triple.rds") seurat.genes <- readLines( con = "../data/cellcycle-genes-previous-studies/seurat_cellcycle/regev_lab_cell_cycle_genes.txt") seurat.genes <- list(s.genes=seurat.genes[1:43], g2m.genes=seurat.genes[44:97]) double_overlap <- sapply(genes_list_symbols, function(x) sum(x$hgnc_symbol %in% unlist(seurat.genes))) triple_overlap <- sapply(genes_list_symbols_triple, function(x) sum(x$hgnc_symbol %in% unlist(seurat.genes))) par(mfrow=c(1,2)) plot(x=names(genes_list)[1:40], sapply(genes_list, length)[1:40], xlab="Top X cyclical genes", ylab="Number of selected genes", main = "Up to top 400") points(x=names(genes_list_triple)[1:40], sapply(genes_list_triple, length)[1:40], col="blue", pch=1) legend("topleft", pch=1, col=c("black", "blue"), legend=c("fucci time", "fucci and dapi time")) plot(x=names(genes_list)[1:11], sapply(genes_list, length)[1:11], xlab="Top X cyclical genes", ylab="Number of selected genes", main = "Up to to 100", ylim=c(0, 65)) points(x=names(genes_list_triple)[1:11], sapply(genes_list_triple, length)[1:11], col="blue", pch=1)</code></pre> <p><img src="figure/method-train-genes-fucci-vs-triple.Rmd/unnamed-chunk-3-1.png" width="672" style="display: block; margin: auto;" /></p> <pre class="r"><code>par(mfrow=c(1,2)) plot(x=names(genes_list)[1:40], double_overlap[1:40], xlab="Top X cyclical genes", ylab="Number of Seurat genes (total 92 detected)", main = "Up to top 400", ylim=c(0,80)) points(x=names(genes_list_triple)[1:40], triple_overlap[1:40], col="blue", pch=1) legend("topleft", pch=1, col=c("black", "blue"), legend=c("fucci time", "fucci and dapi time")) plot(x=names(genes_list)[1:11], double_overlap[1:11], xlab="Top X cyclical genes", ylab="Number of Seurat genes (total 92 detected)", main = "Up to top 100", ylim=c(0,30)) points(x=names(genes_list_triple)[1:11], triple_overlap[1:11], col="blue", pch=1)</code></pre> <p><img src="figure/method-train-genes-fucci-vs-triple.Rmd/unnamed-chunk-3-2.png" width="672" style="display: block; margin: auto;" /></p> <hr /> </div> <div id="save-top-100-genes-symbols-to-output-table" class="section level2"> <h2>Save top 100 genes symbols to output table</h2> <pre class="r"><code>write.table(genes_list_symbols[[11]]$hgnc_symbol, file = "../output/method-train-genes-fucci-vs-triple.Rmd/topgenes.txt", row.names=F, col.names=F, quote=F) write.table(genes_list_symbols_triple[[11]]$hgnc_symbol, file = "../output/method-train-genes-fucci-vs-triple.Rmd/triple_topgenes.txt", row.names=F, col.names=F, quote=F) write.table(genes_list_symbols[[length(genes_list_symbols)]][,1], file = "../output/method-train-genes-fucci-vs-triple.Rmd/allgenes.txt", row.names=F, col.names=F, quote=F)</code></pre> <hr /> </div> <div id="session-information" class="section level2"> <h2>Session information</h2> <pre class="r"><code>sessionInfo()</code></pre> <pre><code>R version 3.4.3 (2017-11-30) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Scientific Linux 7.4 (Nitrogen) Matrix products: default BLAS/LAPACK: /software/openblas-0.2.19-el7-x86_64/lib/libopenblas_haswellp-r0.2.19.so locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=en_US.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base loaded via a namespace (and not attached): [1] compiler_3.4.3 backports_1.1.2 magrittr_1.5 rprojroot_1.3-2 [5] tools_3.4.3 htmltools_0.3.6 yaml_2.1.16 Rcpp_0.12.17 [9] stringi_1.1.6 rmarkdown_1.10 knitr_1.20 git2r_0.21.0 [13] stringr_1.2.0 digest_0.6.15 evaluate_0.10.1</code></pre> </div> <!-- Adjust MathJax settings so that all math formulae are shown using TeX fonts only; see http://docs.mathjax.org/en/latest/configuration.html. This will make the presentation more consistent at the cost of the webpage sometimes taking slightly longer to load. Note that this only works because the footer is added to webpages before the MathJax javascript. --> <script type="text/x-mathjax-config"> MathJax.Hub.Config({ "HTML-CSS": { availableFonts: ["TeX"] } }); </script> <hr> <p> This <a href="http://rmarkdown.rstudio.com">R Markdown</a> site was created with <a href="https://github.com/jdblischak/workflowr">workflowr</a> </p> <hr> <!-- To enable disqus, uncomment the section below and provide your disqus_shortname --> <!-- disqus <div id="disqus_thread"></div> <script type="text/javascript"> /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */ var disqus_shortname = 'rmarkdown'; // required: replace example with your forum shortname /* * * DON'T EDIT BELOW THIS LINE * * */ (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })(); </script> <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> <a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a> --> </div> <script> // add bootstrap table styles to pandoc tables function bootstrapStylePandocTables() { $('tr.header').parent('thead').parent('table').addClass('table table-condensed'); } $(document).ready(function () { bootstrapStylePandocTables(); }); </script> <!-- dynamically load mathjax for compatibility with self-contained --> <script> (function () { var script = document.createElement("script"); script.type = "text/javascript"; script.src = "https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"; document.getElementsByTagName("head")[0].appendChild(script); })(); </script> </body> </html>