Last updated: 2020-09-09

Checks: 7 0

Knit directory: neural_scRNAseq/

This reproducible R Markdown analysis was created with workflowr (version 1.6.2). The Checks 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(20200522) 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 job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.

Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.

The results in this page were generated with repository version 88fccd1. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.

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:    .DS_Store
    Ignored:    .Rhistory
    Ignored:    .Rproj.user/
    Ignored:    ._.DS_Store
    Ignored:    ._Rplots.pdf
    Ignored:    ._Rplots_largeViz.pdf
    Ignored:    ._Rplots_separate.pdf
    Ignored:    .__workflowr.yml
    Ignored:    ._neural_scRNAseq.Rproj
    Ignored:    analysis/.DS_Store
    Ignored:    analysis/.Rhistory
    Ignored:    analysis/._.DS_Store
    Ignored:    analysis/._01-preprocessing.Rmd
    Ignored:    analysis/._01-preprocessing.html
    Ignored:    analysis/._02.1-SampleQC.Rmd
    Ignored:    analysis/._03-filtering.Rmd
    Ignored:    analysis/._04-clustering.Rmd
    Ignored:    analysis/._04-clustering.knit.md
    Ignored:    analysis/._04.1-cell_cycle.Rmd
    Ignored:    analysis/._05-annotation.Rmd
    Ignored:    analysis/._Lam-0-NSC_no_integration.Rmd
    Ignored:    analysis/._Lam-01-NSC_integration.Rmd
    Ignored:    analysis/._Lam-02-NSC_annotation.Rmd
    Ignored:    analysis/._NSC-1-clustering.Rmd
    Ignored:    analysis/._NSC-2-annotation.Rmd
    Ignored:    analysis/.__site.yml
    Ignored:    analysis/._additional_filtering.Rmd
    Ignored:    analysis/._additional_filtering_clustering.Rmd
    Ignored:    analysis/._index.Rmd
    Ignored:    analysis/._organoid-01-clustering.Rmd
    Ignored:    analysis/._organoid-02-integration.Rmd
    Ignored:    analysis/._organoid-03-cluster_analysis.Rmd
    Ignored:    analysis/._organoid-04-group_integration.Rmd
    Ignored:    analysis/._organoid-05-group_integration_cluster_analysis.Rmd
    Ignored:    analysis/._organoid-06-1-prepare-sce.Rmd
    Ignored:    analysis/._organoid-06-conos-analysis-Seurat.Rmd
    Ignored:    analysis/._organoid-06-conos-analysis.Rmd
    Ignored:    analysis/._organoid-07-conos-visualization.Rmd
    Ignored:    analysis/01-preprocessing_cache/
    Ignored:    analysis/02-1-SampleQC_cache/
    Ignored:    analysis/02-quality_control_cache/
    Ignored:    analysis/02.1-SampleQC_cache/
    Ignored:    analysis/03-filtering_cache/
    Ignored:    analysis/04-clustering_cache/
    Ignored:    analysis/04.1-cell_cycle_cache/
    Ignored:    analysis/05-annotation_cache/
    Ignored:    analysis/Lam-01-NSC_integration_cache/
    Ignored:    analysis/Lam-02-NSC_annotation_cache/
    Ignored:    analysis/NSC-1-clustering_cache/
    Ignored:    analysis/NSC-2-annotation_cache/
    Ignored:    analysis/additional_filtering_cache/
    Ignored:    analysis/additional_filtering_clustering_cache/
    Ignored:    analysis/organoid-01-clustering_cache/
    Ignored:    analysis/organoid-02-integration_cache/
    Ignored:    analysis/organoid-03-cluster_analysis_cache/
    Ignored:    analysis/organoid-04-group_integration_cache/
    Ignored:    analysis/organoid-05-group_integration_cluster_analysis_cache/
    Ignored:    analysis/sample5_QC_cache/
    Ignored:    data/.DS_Store
    Ignored:    data/._.DS_Store
    Ignored:    data/._.smbdeleteAAA17ed8b4b
    Ignored:    data/._Lam_figure2_markers.R
    Ignored:    data/._known_NSC_markers.R
    Ignored:    data/._known_cell_type_markers.R
    Ignored:    data/._metadata.csv
    Ignored:    data/data_sushi/
    Ignored:    data/filtered_feature_matrices/
    Ignored:    output/.DS_Store
    Ignored:    output/._.DS_Store
    Ignored:    output/._NSC_cluster1_marker_genes.txt
    Ignored:    output/._organoid_integration_cluster1_marker_genes.txt
    Ignored:    output/Lam-01-clustering.rds
    Ignored:    output/NSC_1_clustering.rds
    Ignored:    output/NSC_cluster1_marker_genes.txt
    Ignored:    output/NSC_cluster2_marker_genes.txt
    Ignored:    output/NSC_cluster3_marker_genes.txt
    Ignored:    output/NSC_cluster4_marker_genes.txt
    Ignored:    output/NSC_cluster5_marker_genes.txt
    Ignored:    output/NSC_cluster6_marker_genes.txt
    Ignored:    output/NSC_cluster7_marker_genes.txt
    Ignored:    output/additional_filtering.rds
    Ignored:    output/conos/
    Ignored:    output/figures/
    Ignored:    output/organoid_integration_cluster10_marker_genes.txt
    Ignored:    output/organoid_integration_cluster11_marker_genes.txt
    Ignored:    output/organoid_integration_cluster12_marker_genes.txt
    Ignored:    output/organoid_integration_cluster13_marker_genes.txt
    Ignored:    output/organoid_integration_cluster14_marker_genes.txt
    Ignored:    output/organoid_integration_cluster15_marker_genes.txt
    Ignored:    output/organoid_integration_cluster16_marker_genes.txt
    Ignored:    output/organoid_integration_cluster17_marker_genes.txt
    Ignored:    output/organoid_integration_cluster1_marker_genes.txt
    Ignored:    output/organoid_integration_cluster2_marker_genes.txt
    Ignored:    output/organoid_integration_cluster3_marker_genes.txt
    Ignored:    output/organoid_integration_cluster4_marker_genes.txt
    Ignored:    output/organoid_integration_cluster5_marker_genes.txt
    Ignored:    output/organoid_integration_cluster6_marker_genes.txt
    Ignored:    output/organoid_integration_cluster7_marker_genes.txt
    Ignored:    output/organoid_integration_cluster8_marker_genes.txt
    Ignored:    output/organoid_integration_cluster9_marker_genes.txt
    Ignored:    output/sce_01_preprocessing.rds
    Ignored:    output/sce_02_quality_control.rds
    Ignored:    output/sce_03_filtering.rds
    Ignored:    output/sce_03_filtering_all_genes.rds
    Ignored:    output/sce_organoid-01-clustering.rds
    Ignored:    output/sce_preprocessing.rds
    Ignored:    output/so_04-group_integration.rds
    Ignored:    output/so_04_1_cell_cycle.rds
    Ignored:    output/so_04_clustering.rds
    Ignored:    output/so_additional_filtering_clustering.rds
    Ignored:    output/so_integrated_organoid-02-integration.rds
    Ignored:    output/so_merged_organoid-02-integration.rds
    Ignored:    output/so_organoid-01-clustering.rds
    Ignored:    output/so_sample_organoid-01-clustering.rds

Untracked files:
    Untracked:  Rplots.pdf
    Untracked:  Rplots_largeViz.pdf
    Untracked:  Rplots_separate.pdf
    Untracked:  analysis/Lam-0-NSC_no_integration.Rmd
    Untracked:  analysis/additional_filtering.Rmd
    Untracked:  analysis/additional_filtering_clustering.Rmd
    Untracked:  analysis/organoid-06-conos-analysis-Seurat.Rmd
    Untracked:  analysis/organoid-06-conos-analysis.Rmd
    Untracked:  analysis/organoid-07-conos-visualization.Rmd
    Untracked:  analysis/sample5_QC.Rmd
    Untracked:  data/Homo_sapiens.GRCh38.98.sorted.gtf
    Untracked:  data/Kanton_et_al/
    Untracked:  data/Lam_et_al/
    Untracked:  scripts/

Unstaged changes:
    Modified:   analysis/Lam-02-NSC_annotation.Rmd
    Modified:   analysis/_site.yml
    Modified:   analysis/organoid-02-integration.Rmd

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 repository in which changes were made to the R Markdown (analysis/organoid-06-1-prepare-sce.Rmd) and HTML (docs/organoid-06-1-prepare-sce.html) files. If you've configured a remote Git repository (see ?wflow_git_remote), click on the hyperlinks in the table below to view the files as they were in that past version.

File Version Author Date Message
Rmd 88fccd1 khembach 2020-09-09 Prepare sce object for conos

Load packages

library(dplyr)
library(SingleCellExperiment)

Load data

sce_org <- readRDS(file.path("output", "sce_organoid-01-clustering.rds"))
sce_org <- sce_org[, sce_org$in_FullLineage]
sce_nsc <- readRDS(file.path("output", "sce_03_filtering_all_genes.rds"))
## convert to "dgCMatrix" as input for Pagoda2
counts(sce_nsc) <- as(counts(sce_nsc), "dgCMatrix")

Merge SCE objects

## intersection of measured features
rdat <- inner_join(data.frame(rowData(sce_org)), data.frame(rowData(sce_nsc)), 
                   by = "ensembl_id", suffix = c(".org", ".nsc"))
## subset rows to intersection and harmonize row data and names
sce_org <- sce_org[paste0(rdat$ensembl_id, ".", rdat$symbol.org),]
sce_nsc <- sce_nsc[paste0(rdat$ensembl_id, ".", rdat$symbol.nsc),]
rdat <- rdat %>% dplyr::select(-symbol.org) %>% rename(symbol.nsc = "symbol")
rowData(sce_org) <- rdat
rowData(sce_nsc) <- rdat
rownames(sce_org) <- rownames(sce_nsc) 
## subset matching columns
cdat_nsc <- colData(sce_nsc)
cdat_org <- colData(sce_org)
## harmonize the colData
## we keep following columns
## sample_id, barcode, group_id, sum, detected, subsets_Mt_fraction
cdat_nsc <- cdat_nsc[, c("sample_id", "barcode", "group_id", "sum", 
                         "detected", "subsets_Mt_fraction")]
## sample_id, barcode, Species, Stage, Line, Sample, PredCellType, nGene, nUMI, 
## PercentMito, cl_FullLineage cl_LineComp 
## nsc = org --> matching columns that need to be renamed
## group_id = Stage
## sample_id = Sample
## detected = nGene
## sum = nUMI
## subsets_Mt_fraction = PercentMito
cdat_org <- cdat_org[, c("barcode", "Stage", "Line", 
                         "Sample", "PredCellType", "nGene", "nUMI", 
                         "PercentMito", "cl_FullLineage", "cl_LineComp")]
## rename columns to match the two dataframes
cdat_org <- cdat_org %>% rename(Sample = "sample_id", Line = "group_id")
cdat_nsc <- cdat_nsc %>% rename(sum = "nUMI", detected = "nGene", 
                                subsets_Mt_fraction = "PercentMito") 
cdat_nsc[,c("Stage", "PredCellType", "cl_FullLineage", "cl_LineComp")] <- NA
## reorder the columns
cdat_org <- cdat_org[, colnames(cdat_nsc)]
colData(sce_nsc) <- cdat_nsc
colData(sce_org) <- cdat_org
## combine the two sce objects
sce <- cbind(sce_nsc, sce_org)
saveRDS(sce, file.path("output", "sce_06-1-prepare-sce.rds"))

sessionInfo()
R version 4.0.0 (2020-04-24)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.6 LTS

Matrix products: default
BLAS:   /usr/local/R/R-4.0.0/lib/libRblas.so
LAPACK: /usr/local/R/R-4.0.0/lib/libRlapack.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] parallel  stats4    stats     graphics  grDevices utils     datasets 
[8] methods   base     

other attached packages:
 [1] HDF5Array_1.16.1            rhdf5_2.32.2               
 [3] SingleCellExperiment_1.10.1 SummarizedExperiment_1.18.1
 [5] DelayedArray_0.14.0         matrixStats_0.56.0         
 [7] Biobase_2.48.0              GenomicRanges_1.40.0       
 [9] GenomeInfoDb_1.24.2         IRanges_2.22.2             
[11] S4Vectors_0.26.1            BiocGenerics_0.34.0        
[13] dplyr_1.0.2                 workflowr_1.6.2            

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.5             XVector_0.28.0         pillar_1.4.6          
 [4] compiler_4.0.0         later_1.1.0.1          git2r_0.27.1          
 [7] zlibbioc_1.34.0        bitops_1.0-6           tools_4.0.0           
[10] digest_0.6.25          lattice_0.20-41        evaluate_0.14         
[13] lifecycle_0.2.0        tibble_3.0.3           pkgconfig_2.0.3       
[16] rlang_0.4.7            Matrix_1.2-18          yaml_2.2.1            
[19] xfun_0.15              GenomeInfoDbData_1.2.3 stringr_1.4.0         
[22] knitr_1.29             generics_0.0.2         fs_1.4.2              
[25] vctrs_0.3.4            grid_4.0.0             rprojroot_1.3-2       
[28] tidyselect_1.1.0       glue_1.4.2             R6_2.4.1              
[31] rmarkdown_2.3          Rhdf5lib_1.10.0        purrr_0.3.4           
[34] magrittr_1.5           whisker_0.4            backports_1.1.9       
[37] promises_1.1.1         ellipsis_0.3.1         htmltools_0.5.0       
[40] httpuv_1.5.4           stringi_1.4.6          RCurl_1.98-1.2        
[43] crayon_1.3.4