Last updated: 2019-04-12

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:    analysis/figure/
    Ignored:    figures/
    Ignored:    output/bulk_analysis/
    Ignored:    output/markergenes/
    Ignored:    output/monocle/
    Ignored:    output/seurat_objects/
    Ignored:    output/velocyto/
    Ignored:    output/wgcna/
    Ignored:    tables/

Untracked files:
    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-figures.Rmd
    Untracked:  analysis/10x-180831-pseudotime.Rmd
    Untracked:  code/BEAM-heatmaps.R
    Untracked:  code/BEAM_gsea.R
    Untracked:  code/colors.R

Unstaged changes:
    Deleted:    analysis/10x-180831-BATLAS.Rmd
    Modified:   analysis/10x-180831-beamGOplot.Rmd
    Modified:   analysis/10x-180831-colors.Rmd
    Modified:   analysis/10x-180831-general-analysis.Rmd
    Modified:   analysis/10x-180831-monocle.Rmd
    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-markers.R
    Modified:   code/preprocess-data.R
    Modified:   code/run-monocle.R

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 e55aa11 Pytrik Folkertsma 2019-04-12 Supplementary figures

library(Seurat)
Loading required package: ggplot2
Loading required package: cowplot

Attaching package: 'cowplot'
The following object is masked from 'package:ggplot2':

    ggsave
Loading required package: Matrix
library(knitr)
library(ggplot2)
require(scales)
Loading required package: scales
seurobj <- readRDS('output/seurat_objects/180831/10x-180831')
source('code/colors.R')

BATLAS

Calculate averages for clusters from resolution 1.5:

p <- TSNEPlot(seurobj, group.by='res.1.5', do.label=T, pt.size=0.1)

p

v1 <- VlnPlot(seurobj, features.plot='percent.mito', point.size.use=-1, group.by='res.1.5')
v1

v2 <- VlnPlot(seurobj, features.plot='percent.mito', point.size.use=-1, group.by='res.1.5', y.max=0.2)
v2
Warning: Removed 58 rows containing non-finite values (stat_ydensity).
Warning: Removed 58 rows containing missing values (geom_point).

save_plot(p, file='figures/figures_paper/supplementary_figures/batlas/10x-180831_tsne_res.1.5.pdf', base_width=5, base_height=4)
save_plot(v1, file='figures/figures_paper/supplementary_figures/batlas/10x-180831_vlnplot_percent.mito_clustering.1.5.pdf', base_width=12, base_height=10)
save_plot(v2, file='figures/figures_paper/supplementary_figures/batlas/10x-180831_vlnplot_percent.mito_clustering.1.5_y-cutoff-0.2.pdf', base_width=12, base_height=4)
Warning: Removed 58 rows containing non-finite values (stat_ydensity).
Warning: Removed 58 rows containing missing values (geom_point).
#Average expression is calculated by: (mean(1expm(seurobj@data[gene, cluster])))
#average.expression <- AverageExpression(SetAllIdent(seurobj, id='res.1.5'))

BATLAS results.

batlas <- read.table('tables/tables_paper/supplementary_tables/BATLAS/BATLAS.txt', header=T, sep='\t')
batlas$cluster <- as.character(batlas$cluster)
kable(batlas)
cluster brown white
0 0.389 0.611
1 0.471 0.529
2 0.384 0.616
3 0.600 0.400
4 0.567 0.433
5 0.422 0.578
6 0.315 0.685
7 0.607 0.393
8 0.560 0.440
9 0.680 0.320
10 0.479 0.521
11 0.545 0.455
12 0.420 0.580
13 0.542 0.458
14 0.723 0.277
15 0.443 0.557
16 0.845 0.155
17 0.769 0.231
18 0.488 0.512
19 0.446 0.554
20 0.390 0.610
21 0.578 0.422
p <- ggplot(data=batlas, aes(x=cluster, y=brown)) +
  geom_bar(stat="identity") +
  ylab('Brown percentage estimate') +
  coord_flip()
p

save_plot('figures/figures_paper/supplementary_figures/batlas/BATLAS_results.pdf', p, base_height=6, base_width=12)

BATLAS results log normalized.

batlas <- read.table('tables/tables_paper/supplementary_tables/BATLAS/BATLAS_log_normalized.txt', header=T, sep='\t')
batlas$cluster <- as.character(batlas$cluster)
kable(batlas)
cluster brown white
0 0.569 0.431
1 0.590 0.410
2 0.564 0.436
3 0.634 0.366
4 0.618 0.382
5 0.578 0.422
6 0.539 0.461
7 0.635 0.365
8 0.623 0.377
9 0.659 0.341
10 0.594 0.406
11 0.618 0.382
12 0.579 0.421
13 0.618 0.382
14 0.677 0.323
15 0.579 0.421
16 0.730 0.270
17 0.697 0.303
18 0.595 0.405
19 0.583 0.417
20 0.526 0.474
21 0.634 0.366
p <- ggplot(data=batlas, aes(x=cluster, y=brown)) +
  geom_bar(stat="identity") +
  ylab('Brown percentage estimate') +
  coord_flip()
p

save_plot('figures/figures_paper/supplementary_figures/batlas/BATLAS_results_log-normalized.pdf', p, base_height=6, base_width=12)

PC analysis

p1 <- FeaturePlot(seurobj, features.plot=c('PC1'), cols.use=c('gray', 'blue'), no.legend=F, do.return=T)[['PC1']]

p2 <- FeaturePlot(seurobj, features.plot=c('Pseudotime'), cols.use=c('gray', 'blue'), no.legend=F, do.return=T)[['Pseudotime']]

p3 <- FeaturePlot(seurobj, features.plot=c('Pseudotime'), cols.use=c('gray', 'blue'), no.legend=F, min.cutoff=30, do.return=T)[['Pseudotime']]

p4 <- FeaturePlot(seurobj, features.plot=c('PC2'), cols.use=c('gray', 'blue'), no.legend=F, do.return=T)[['PC2']]

p5 <- TSNEPlot(seurobj, group.by='pc2.groups', pt.size=0.5)

p6 <- DimPlot(SetAllIdent(seurobj, id='State.names'), reduction.use = 'pca', dim.1=5, dim.2=2, cols.use=colors.states.names)

p7 <- DimPlot(SetAllIdent(seurobj, id='State.names'), reduction.use = 'pca', dim.1=1, dim.2=2, cols.use=colors.states.names)

plot_grid(
  p1, p2, p3, p4, p5, p6, p7, ncol=2
)

save_plot('figures/figures_paper/supplementary_figures/pc_analysis/PC1_featureplot.pdf', p1, base_width=6, base_height=4.5)
save_plot('figures/figures_paper/supplementary_figures/pc_analysis/Pseudotime_featureplot.pdf', p2, base_width=6, base_height=4.5)
save_plot('figures/figures_paper/supplementary_figures/pc_analysis/Pseudotime_featureplot_min.cutoff30.pdf', p1, base_width=6, base_height=4.5)
save_plot('figures/figures_paper/supplementary_figures/pc_analysis/PC2_featureplot.pdf', p4, base_width=6, base_height=4.5)
save_plot('figures/figures_paper/supplementary_figures/pc_analysis/tSNE_top10percentPC2.pdf', p5, base_width=6, base_height=4.5)
save_plot('figures/figures_paper/supplementary_figures/pc_analysis/PC5_PC2.pdf', p6, base_width=6, base_height=4.5)
save_plot('figures/figures_paper/supplementary_figures/pc_analysis/PC1_PC2.pdf', p7, base_width=6, base_height=4.5)

WGCNA

plots <- FeaturePlot(seurobj, features.plot=c('SeuratProject__blue', 'SeuratProject__lightgreen', 'SeuratProject__mediumpurple', 'SeuratProject__sandybrown', 'SeuratProject__springgreen'), cols.use=c('gray', 'blue'), no.legend=F, do.return=T)

plot_grid(
  plots$SeuratProject__blue,
  plots$SeuratProject__lightgreen,
  plots$SeuratProject__mediumpurple,
  plots$SeuratProject__sandybrown,
  plots$SeuratProject__springgreen,
  ncol=2
)

save_plot('figures/figures_paper/supplementary_figures/wgcna/blue.pdf', plots$SeuratProject__blue, base_width=6, base_height=4)
save_plot('figures/figures_paper/supplementary_figures/wgcna/lightgreen.pdf', plots$SeuratProject__lightgreen, base_width=6, base_height=4)
save_plot('figures/figures_paper/supplementary_figures/wgcna/mediumpurple.pdf', plots$SeuratProject__mediumpurple, base_width=6, base_height=4)
save_plot('figures/figures_paper/supplementary_figures/wgcna/sandybrown.pdf', plots$SeuratProject__sandybrown, base_width=6, base_height=4)
save_plot('figures/figures_paper/supplementary_figures/wgcna/springgreen.pdf', plots$SeuratProject__springgreen, base_width=6, base_height=4)

FTO analysis

plots <- FeaturePlot(seurobj, features.plot=c('FTO', 'percent.mito', 'IRX3', 'IRX5'), cols.use=c('gray', 'blue'), no.legend=F, do.return=T)

save_plot('figures/figures_paper/supplementary_figures/fto_analysis/FTO_featureplot.pdf', plots$FTO, base_width=6, base_height=4.5)
save_plot('figures/figures_paper/supplementary_figures/fto_analysis/percent.mito_featureplot.pdf', plots$percent.mito, base_width=6, base_height=4.5)
save_plot('figures/figures_paper/supplementary_figures/fto_analysis/IRX3_featureplot.pdf', plots$IRX3, base_width=6, base_height=4.5)
save_plot('figures/figures_paper/supplementary_figures/fto_analysis/IRX5_featureplot.pdf', plots$IRX5, base_width=6, base_height=4.5)
pm <- FeaturePlot(seurobj, features.plot=c('percent.mito'), cols.use=c('gray', 'blue'), no.legend=F, do.return=T, max.cutoff = 0.2)[['percent.mito']]

save_plot('figures/figures_paper/supplementary_figures/fto_analysis/percent.mito_featureplot_max.cutoff0.2.pdf', plots$percent.mito, base_width=6, base_height=4.5)


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] scales_1.0.0  knitr_1.22    Seurat_2.3.4  Matrix_1.2-17 cowplot_0.9.4
[6] ggplot2_3.1.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        flexmix_2.3-15      bit64_0.9-7        
 [16] mvtnorm_1.0-10      codetools_0.2-16    splines_3.5.3      
 [19] R.methodsS3_1.7.1   lsei_1.2-0          robustbase_0.93-4  
 [22] jsonlite_1.6        Formula_1.2-3       workflowr_1.2.0    
 [25] ica_1.0-2           cluster_2.0.7-1     kernlab_0.9-27     
 [28] png_0.1-7           R.oo_1.22.0         compiler_3.5.3     
 [31] httr_1.4.0          backports_1.1.3     assertthat_0.2.1   
 [34] lazyeval_0.2.2      lars_1.2            acepack_1.4.1      
 [37] htmltools_0.3.6     tools_3.5.3         igraph_1.2.4       
 [40] gtable_0.3.0        glue_1.3.1          reshape2_1.4.3     
 [43] RANN_2.6.1          dplyr_0.8.0.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] gbRd_0.4-11         lmtest_0.9-36       xfun_0.5           
 [55] stringr_1.4.0       irlba_2.3.3         gtools_3.8.1       
 [58] DEoptimR_1.0-8      MASS_7.3-51.1       zoo_1.8-5          
 [61] doSNOW_1.0.16       parallel_3.5.3      RColorBrewer_1.1-2 
 [64] yaml_2.2.0          reticulate_1.11.1   pbapply_1.4-0      
 [67] gridExtra_2.3       rpart_4.1-13        segmented_0.5-3.0  
 [70] latticeExtra_0.6-28 stringi_1.4.3       highr_0.8          
 [73] foreach_1.4.4       checkmate_1.9.1     caTools_1.17.1.2   
 [76] bibtex_0.4.2        Rdpack_0.10-1       SDMTools_1.1-221   
 [79] rlang_0.3.2         pkgconfig_2.0.2     dtw_1.20-1         
 [82] prabclus_2.2-7      bitops_1.0-6        evaluate_0.13      
 [85] lattice_0.20-38     ROCR_1.0-7          purrr_0.3.2        
 [88] labeling_0.3        htmlwidgets_1.3     bit_1.1-14         
 [91] tidyselect_0.2.5    plyr_1.8.4          magrittr_1.5       
 [94] R6_2.4.0            snow_0.4-3          gplots_3.0.1.1     
 [97] Hmisc_4.2-0         pillar_1.3.1        whisker_0.3-2      
[100] foreign_0.8-71      withr_2.1.2         fitdistrplus_1.0-14
[103] mixtools_1.1.0      survival_2.43-3     nnet_7.3-12        
[106] tsne_0.1-3          tibble_2.1.1        crayon_1.3.4       
[109] hdf5r_1.1.1         KernSmooth_2.23-15  rmarkdown_1.12     
[112] grid_3.5.3          data.table_1.12.0   git2r_0.25.2       
[115] metap_1.1           digest_0.6.18       diptest_0.75-7     
[118] tidyr_0.8.3         R.utils_2.8.0       stats4_3.5.3       
[121] munsell_0.5.0