Last updated: 2019-05-16

Checks: 6 0

Knit directory: 10x-adipocyte-analysis/

This reproducible R Markdown analysis was created with workflowr (version 1.2.0). The Report tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.


Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.

Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.

The command set.seed(20181026) was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.

Great job! Recording the operating system, R version, and package versions is critical for reproducibility.

Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.

Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility. The version displayed above was the version of the Git repository at the time these results were generated.

Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish or wflow_git_commit). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:


Ignored files:
    Ignored:    code/.Rhistory
    Ignored:    figures/
    Ignored:    output/bulk_analysis/
    Ignored:    output/demuxlet/
    Ignored:    output/markergenes/
    Ignored:    output/monocle/
    Ignored:    output/seurat_objects/
    Ignored:    output/velocyto/
    Ignored:    output/wgcna/
    Ignored:    tables/

Untracked files:
    Untracked:  .rstudio_old10/
    Untracked:  10x-adipocyte-analysis-copy.Rproj
    Untracked:  analysis/.ipynb_checkpoints/velocyto_notebook_180831-checkpoint.ipynb
    Untracked:  analysis/10-180831-monocle-per-depot.Rmd
    Untracked:  analysis/10x-180831-BEAM-heatmap.Rmd
    Untracked:  analysis/10x-180831-pseudotime.Rmd
    Untracked:  code/BEAM-heatmaps.R
    Untracked:  code/BEAM_gsea.R
    Untracked:  code/colors.R

Unstaged changes:
    Deleted:    10x-adipocyte-analysis.Rproj
    Modified:   analysis/10x-180504-DEGs-depots.Rmd
    Modified:   analysis/10x-180504-alignment.Rmd
    Modified:   analysis/10x-180504-depot-markers.Rmd
    Modified:   analysis/10x-180831-BATLAS.Rmd
    Modified:   analysis/10x-180831-beamGOplot.Rmd
    Modified:   analysis/10x-180831-colors.Rmd
    Modified:   analysis/10x-180831-figures.Rmd
    Modified:   analysis/10x-180831-general-analysis.Rmd
    Modified:   analysis/10x-180831-supplementary_figures.Rmd
    Modified:   analysis/velocyto_notebook_180504.ipynb
    Modified:   analysis/velocyto_notebook_180831.ipynb
    Deleted:    code/REMOVE/find-brown-sample-markers-180504-REMOVE.R
    Deleted:    code/REMOVE/find-white-sample-markers-180504-REMOVE.R
    Deleted:    code/REMOVE/get-genes-monocle-180831-REMOVE.R
    Modified:   code/compute-genelists-monocle-depots.R
    Modified:   code/find-depot-markers-180504.R
    Modified:   code/find-markers.R
    Modified:   code/preprocess-data.R
    Modified:   code/run-alignment.R
    Modified:   code/run-monocle.R
    Modified:   code/velocyto_preprocess.py

Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.


These are the previous versions of the R Markdown and HTML files. If you’ve configured a remote Git repository (see ?wflow_git_remote), click on the hyperlinks in the table below to view them.

File Version Author Date Message
Rmd c0c497a Pytrik Folkertsma 2019-05-16 Notebook cleanup
html 0ee1184 Pytrik Folkertsma 2019-05-16 Build site.
Rmd 3591346 Pytrik Folkertsma 2019-05-16 Notebook cleanup
html f751344 Pytrik Folkertsma 2019-05-14 Build site.
Rmd 51f4e37 Pytrik Folkertsma 2019-05-14 Notebook cleanup
html 635f749 Pytrik Folkertsma 2019-04-17 Build site.
Rmd 7fffd4e Pytrik Folkertsma 2019-04-17 updated TF analysis
html 7351b89 Pytrik Folkertsma 2019-04-12 Build site.
Rmd 4654ec3 Pytrik Folkertsma 2019-04-12 TF analysis
html a5d13d1 Pytrik Folkertsma 2019-04-10 Build site.
Rmd ea0009a Pytrik Folkertsma 2019-04-10 TF analysis

library(data.table)
library(readr)
library(dplyr)
library(knitr)
library(kableExtra)
library(Seurat)

seurobj <- readRDS('output/seurat_objects/180831/10x-180831')
gene_annotations <- fread('tables/tables_paper/all_tables/genes_biomart.txt', sep='\t', quote="", header=T)
ids2symbols <- read.table('tables/tables_paper/all_tables/10x-180831-geneids-genesymbols.tsv', header=T)

BEAM clusters

combined <- list()

for (i in 1:6){
  beam_genelist <- read.table(paste('tables/tables_paper/all_tables/BEAM/heatmap_logFC0.3_ncluster6/genelist_cluster', i, '.tsv', sep=''), sep='\t', header=T)
  beam_genelist['ensembl_gene_id'] <- ids2symbols$ensembl_gene_id[match(beam_genelist$gene_short_name, ids2symbols$gene_symbol)]
  beam_genelist['cluster'] <- i
  
  #add geneinfo
  merged <- merge(beam_genelist, gene_annotations[,c('Gene stable ID', 'Gene type', 'GO term accession', 'GO term name')], by.y='Gene stable ID', by.x='ensembl_gene_id')
  
  #filter for tf's and gene type != protein coding
  filtered <- merged[c(which(c(merged$`GO term name`) %like% 'transcription factor'),
                     which(merged$`GO term definition` %like% 'transcription factor'),
                     which(merged$`Gene type` != 'protein_coding')),]
  
  #filter out duplicate genes
  filtered <- filtered[!duplicated(filtered$gene_short_name),]
  
  combined[[i]] <- filtered
}

combined <- do.call("rbind", combined)
kable(combined[c('gene_short_name', 'qval', 'avgLogFC_State2_State3', 'cluster', 'Gene type', 'GO term accession', 'GO term name')]) %>%
  kable_styling(bootstrap_options = "striped")
gene_short_name qval avgLogFC_State2_State3 cluster Gene type GO term accession GO term name
1614 C1QBP 0 0.4210100 1 protein_coding GO:0008134 transcription factor binding
4113 YWHAZ 0 0.3358994 1 protein_coding GO:0008134 transcription factor binding
4589 PHB 0 0.3788402 1 protein_coding GO:0000981 DNA-binding transcription factor activity, RNA polymerase II-specific
238 MLXIPL 0 0.3673746 2 protein_coding GO:0000981 DNA-binding transcription factor activity, RNA polymerase II-specific
754 NR1H3 0 0.3569965 2 protein_coding GO:0003700 DNA-binding transcription factor activity
1808 SREBF1 0 0.4302819 2 protein_coding GO:0000981 DNA-binding transcription factor activity, RNA polymerase II-specific
4371 CAT 0 0.3321904 2 protein_coding GO:0032088 negative regulation of NF-kappaB transcription factor activity
5709 PPARG 0 0.3226131 2 protein_coding GO:0001103 RNA polymerase II repressing transcription factor binding
7406 CD36 0 1.4585314 2 protein_coding GO:0051092 positive regulation of NF-kappaB transcription factor activity
11046 MESP1 0 0.4067898 2 protein_coding GO:0003700 DNA-binding transcription factor activity
11896 FZD4 0 0.3027719 2 protein_coding GO:0051091 positive regulation of DNA-binding transcription factor activity
12856 PTMA 0 0.6008086 2 protein_coding GO:0033613 activating transcription factor binding
14113 CEBPA 0 0.3466449 2 protein_coding GO:0000981 DNA-binding transcription factor activity, RNA polymerase II-specific
13969 EPHA1-AS1 0 0.3000552 2 antisense
264 SNAI2 0 -0.5313284 3 protein_coding GO:0000981 DNA-binding transcription factor activity, RNA polymerase II-specific
1320 EGR1 0 -0.4104048 3 protein_coding GO:0000981 DNA-binding transcription factor activity, RNA polymerase II-specific
1409 CLU 0 -0.7825588 3 protein_coding GO:0051092 positive regulation of NF-kappaB transcription factor activity
2373 ZEB1 0 -0.4307388 3 protein_coding GO:0000981 DNA-binding transcription factor activity, RNA polymerase II-specific
2683 ZFP36L2 0 -0.3991944 3 protein_coding GO:0003700 DNA-binding transcription factor activity
2993 PPAP2B 0 -0.5215079 3 protein_coding GO:0051091 positive regulation of DNA-binding transcription factor activity
3109 OSR2 0 -0.5893658 3 protein_coding GO:0000981 DNA-binding transcription factor activity, RNA polymerase II-specific
3745 FOS 0 -0.6405352 3 protein_coding GO:0051090 regulation of DNA-binding transcription factor activity
3982 CD34 0 -0.4275094 3 protein_coding GO:0008134 transcription factor binding
4254 ZFP36L1 0 -0.5867891 3 protein_coding GO:0003700 DNA-binding transcription factor activity
4537 MIR24-2 0 -0.3113038 3 antisense
2073 PTGIS 0 -0.3420740 4 protein_coding GO:0032088 negative regulation of NF-kappaB transcription factor activity
2661 CYP1B1 0 -0.6809188 4 protein_coding GO:0032088 negative regulation of NF-kappaB transcription factor activity
3478 ARID5B 0 -0.4524769 4 protein_coding GO:0000981 DNA-binding transcription factor activity, RNA polymerase II-specific
3580 CARHSP1 0 -0.3443580 4 protein_coding GO:0000981 DNA-binding transcription factor activity, RNA polymerase II-specific
5930 TMSB4X 0 -0.3553073 4 protein_coding GO:0032088 negative regulation of NF-kappaB transcription factor activity
4861 MIR4435-1HG 0 -0.4703532 4 lincRNA
5050 ZFAS1 0 -0.3843600 4 antisense
6029 LINC00152 0 -0.5044662 4 lincRNA
6067 RP11-14N7.2 0 -0.3392808 4 lincRNA
411 PRRX1 0 -0.5139881 5 protein_coding GO:0000981 DNA-binding transcription factor activity, RNA polymerase II-specific
1868 DDR2 0 -0.4279312 5 protein_coding GO:0051091 positive regulation of DNA-binding transcription factor activity
2060 JUNB 0 -0.7652085 5 protein_coding GO:0000981 DNA-binding transcription factor activity, RNA polymerase II-specific
2452 TCF4 0 -0.4466219 5 protein_coding GO:0005667 transcription factor complex
3593 VGLL3 0 -0.4709351 5 protein_coding GO:0000981 DNA-binding transcription factor activity, RNA polymerase II-specific
1562 BOLA3 0 0.3568609 6 protein_coding GO:0000981 DNA-binding transcription factor activity, RNA polymerase II-specific
1608 PRDX2 0 0.5220889 6 protein_coding GO:0032088 negative regulation of NF-kappaB transcription factor activity
#write.table(combined, file='../tables/tables_paper/all_tables/BEAM/heatmap_logFC0.3_ncluster6/genelist_TFs.tsv', sep='\t', quote=F, row.names=F)
#write.table(combined, file='../tables/tables_paper/supplementary_tables/BEAM_logFC0.3_nclusters6/genelist_TFs.tsv', sep='\t', quote=F, row.names=F)
#for (gene in as.vector(combined$gene_short_name)){
#  p <- FeaturePlot(seurobj, features.plot=as.vector(combined$gene_short_name), nCol=2, cols.use=c('gray', 'blue'), no.legend=F, do.return = T)[[gene]]
#  save_plot(paste('../figures/figures_paper/supplementary_figures/tf_analysis/BEAM_logFC0.3_ncluster6_413genes/', gene, '.pdf', sep=''), p, base_width=5, base_height=4)
#}

LogFC > 0

combined_upper_branch <- combined[combined$avgLogFC_State2_State3 > 0,]
combined_lower_branch <- combined[combined$avgLogFC_State2_State3 < 0,]
plots_upper <- FeaturePlot(seurobj, features.plot=as.vector(combined_upper_branch$gene_short_name), nCol=4, cols.use=c('gray', 'blue'), no.legend=F, no.axes=T, do.return=T)
plots_upper_edited <- list()

for (p in names(plots_upper)){
  plots_upper_edited[[p]] <- plots_upper[[p]] + scale_color_gradient(name='Expr.', low='gray', high='blue', guide='colorbar') + theme(legend.title=element_text(size=9), legend.text=element_text(size=9), legend.key.height = unit(0.6, 'cm'), legend.key.width=unit(0.2, 'cm'))
}
grid_upper <- plot_grid(plotlist=plots_upper_edited, ncol=4)
grid_upper

Version Author Date
0ee1184 Pytrik Folkertsma 2019-05-16
f751344 Pytrik Folkertsma 2019-05-14
#save_plot('figures/figures_paper/supplementary_figures/10_tf-analysis/TFs_upper_branch.pdf', grid_upper, base_height=9.14, base_width=12)
#save_plot('figures/figures_paper/supplementary_figures/10_tf-analysis/TFs_upper_branch.png', grid_upper, base_height=9.14, base_width=12)
plots_lower <- FeaturePlot(seurobj, features.plot=as.vector(combined_lower_branch$gene_short_name), nCol=3, cols.use=c('gray', 'blue'), no.legend=F, no.axes=T, do.return=T)
plots_lower_edited <- list()

for (p in names(plots_lower)){
  plots_lower_edited[[p]] <- plots_lower[[p]] + scale_color_gradient(name='Expr.', low='gray', high='blue', guide='colorbar') + theme(legend.title=element_text(size=9), legend.text=element_text(size=9), legend.key.height = unit(0.6, 'cm'), legend.key.width=unit(0.2, 'cm'))
}
grid_lower <- plot_grid(plotlist=plots_lower_edited, ncol=4)
grid_lower

Version Author Date
0ee1184 Pytrik Folkertsma 2019-05-16
#save_plot('figures/figures_paper/supplementary_figures/10_tf-analysis/TFs_lower_branch.pdf', grid_lower, base_height=16, base_width=12)
#save_plot('figures/figures_paper/supplementary_figures/10_tf-analysis/TFs_lower_branch.png', grid_lower, base_height=16, base_width=12)


sessionInfo()
R version 3.5.3 (2019-03-11)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Storage

Matrix products: default
BLAS/LAPACK: /usr/lib64/libopenblas-r0.3.3.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     

other attached packages:
[1] Seurat_2.3.4      Matrix_1.2-17     cowplot_0.9.4     ggplot2_3.1.0    
[5] kableExtra_1.1.0  knitr_1.22        dplyr_0.8.0.1     readr_1.3.1      
[9] data.table_1.12.0

loaded via a namespace (and not attached):
  [1] Rtsne_0.15          colorspace_1.4-1    class_7.3-15       
  [4] modeltools_0.2-22   ggridges_0.5.1      mclust_5.4.3       
  [7] rprojroot_1.3-2     htmlTable_1.13.1    base64enc_0.1-3    
 [10] fs_1.2.7            rstudioapi_0.10     proxy_0.4-23       
 [13] npsurv_0.4-0        bit64_0.9-7         flexmix_2.3-15     
 [16] mvtnorm_1.0-10      xml2_1.2.0          codetools_0.2-16   
 [19] splines_3.5.3       R.methodsS3_1.7.1   lsei_1.2-0         
 [22] robustbase_0.93-4   jsonlite_1.6        Formula_1.2-3      
 [25] workflowr_1.2.0     ica_1.0-2           cluster_2.0.7-1    
 [28] kernlab_0.9-27      png_0.1-7           R.oo_1.22.0        
 [31] compiler_3.5.3      httr_1.4.0          backports_1.1.3    
 [34] assertthat_0.2.1    lazyeval_0.2.2      lars_1.2           
 [37] acepack_1.4.1       htmltools_0.3.6     tools_3.5.3        
 [40] igraph_1.2.4        gtable_0.3.0        glue_1.3.1         
 [43] reshape2_1.4.3      RANN_2.6.1          Rcpp_1.0.1         
 [46] trimcluster_0.1-2.1 gdata_2.18.0        ape_5.3            
 [49] nlme_3.1-137        iterators_1.0.10    fpc_2.1-11.1       
 [52] lmtest_0.9-36       gbRd_0.4-11         xfun_0.5           
 [55] stringr_1.4.0       rvest_0.3.3         irlba_2.3.3        
 [58] gtools_3.8.1        DEoptimR_1.0-8      zoo_1.8-5          
 [61] MASS_7.3-51.1       scales_1.0.0        hms_0.4.2          
 [64] doSNOW_1.0.16       parallel_3.5.3      RColorBrewer_1.1-2 
 [67] yaml_2.2.0          reticulate_1.11.1   pbapply_1.4-0      
 [70] gridExtra_2.3       segmented_0.5-3.0   rpart_4.1-13       
 [73] latticeExtra_0.6-28 stringi_1.4.3       highr_0.8          
 [76] foreach_1.4.4       checkmate_1.9.1     caTools_1.17.1.2   
 [79] bibtex_0.4.2        Rdpack_0.10-1       SDMTools_1.1-221   
 [82] rlang_0.3.2         pkgconfig_2.0.2     dtw_1.20-1         
 [85] prabclus_2.2-7      bitops_1.0-6        evaluate_0.13      
 [88] lattice_0.20-38     ROCR_1.0-7          purrr_0.3.2        
 [91] labeling_0.3        htmlwidgets_1.3     bit_1.1-14         
 [94] tidyselect_0.2.5    plyr_1.8.4          magrittr_1.5       
 [97] R6_2.4.0            snow_0.4-3          gplots_3.0.1.1     
[100] Hmisc_4.2-0         pillar_1.3.1        whisker_0.3-2      
[103] foreign_0.8-71      withr_2.1.2         mixtools_1.1.0     
[106] fitdistrplus_1.0-14 survival_2.43-3     nnet_7.3-12        
[109] tsne_0.1-3          tibble_2.1.1        crayon_1.3.4       
[112] hdf5r_1.1.1         KernSmooth_2.23-15  rmarkdown_1.12     
[115] grid_3.5.3          git2r_0.25.2        metap_1.1          
[118] digest_0.6.18       diptest_0.75-7      webshot_0.5.1      
[121] tidyr_0.8.3         R.utils_2.8.0       stats4_3.5.3       
[124] munsell_0.5.0       viridisLite_0.3.0