Skip to content

Instantly share code, notes, and snippets.

@lcolladotor
Last active October 19, 2020 19:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lcolladotor/242dcc56515b77fdc4cf7341f824fcf9 to your computer and use it in GitHub Desktop.
Save lcolladotor/242dcc56515b77fdc4cf7341f824fcf9 to your computer and use it in GitHub Desktop.
library("BiocFileCache")
library("SummarizedExperiment")
library("googlesheets4")
## Location for temporarely downloading the files
bfc_temp <- BiocFileCache(tempdir())
## Download the BSP1 and BSP2 data
bsp1_data <- bfcrpath(bfc_temp, "https://s3.us-east-2.amazonaws.com/jaffe-nat-neuro-2018/rse_gene_BrainSeq_Phase1_hg19_TopHat2_EnsemblV75.rda")
bsp2_data <- bfcrpath(bfc_temp, "https://s3.us-east-2.amazonaws.com/libd-brainseq2/rse_gene_unfiltered.Rdata")
## For BSP1, use the data at JHPCE with the MDD and BPD samples
bsp1_data <- "/dcl01/ajaffe/data/lab/brainseq_phase1/count_data/dlpfc_polyA_brainseq_phase1_hg38_rseGene_merged_n732.rda"
## Same file as the one available on the web for BSP2
bsp2_data <- "/dcl01/lieber/ajaffe/lab/brainseq_phase2/expr_cutoff/unfiltered/rse_gene_unfiltered.Rdata"
## Load into R
load(bsp1_data, verbose = TRUE)
rse_bsp1 <- rse_gene
load(bsp2_data, verbose = TRUE)
rse_bsp2 <- rse_gene
## Explore how the data is labeled
colnames(colData(rse_bsp1))
colnames(colData(rse_bsp2))
## Extract a few variables of interest
meta_bsp1 <- with(colData(rse_bsp1), data.frame(
"BrainID" = BrNum,
"SampleID" = RNum,
"Diagnosis" = Dx,
"Age" = Age,
"Sex" = Sex,
"Region" = "DLPFC",
"RNAseqDataAvailable" = TRUE,
"GenotypingPlatform" = NA,
"Phase" = "BSP1",
"GenotypeRegion" = NA,
"IDAT_prefix" = NA
))
meta_bsp2 <- with(colData(rse_bsp2), data.frame(
"BrainID" = BrNum,
"SampleID" = RNum,
"Diagnosis" = Dx,
"Age" = Age,
"Sex" = Sex,
"Region" = Region,
"RNAseqDataAvailable" = TRUE,
"GenotypingPlatform" = NA,
"Phase" = "BSP2",
"GenotypeRegion" = NA,
"IDAT_prefix" = NA
))
## Combine
meta_both <- rbind(meta_bsp1, meta_bsp2)
## Share
ss <- gs4_create(
"BSP1_BSP2_samples"
)
sheet_write(meta_both, ss = "1BAEJcjUM5qfFdFSAoo7bToFgaWHdNd6YjLd0NYkWjHw")
with(meta_both, table(Diagnosis, Phase))
# Phase
# Diagnosis BSP1 BSP2
# Bipolar 67 0
# Control 336 614
# MDD 150 0
# Schizo 179 286
## View data at https://docs.google.com/spreadsheets/d/1BAEJcjUM5qfFdFSAoo7bToFgaWHdNd6YjLd0NYkWjHw/edit?usp=sharing
## Reproducibility information
options(width = 120)
sessioninfo::session_info()
# - Session info -------------------------------------------------------------------------------------------------------
# setting value
# version R version 4.0.2 (2020-06-22)
# os Windows 10 x64
# system x86_64, mingw32
# ui RStudio
# language (EN)
# collate English_United States.1252
# ctype English_United States.1252
# tz America/New_York
# date 2020-10-19
#
# - Packages -----------------------------------------------------------------------------------------------------------
# package * version date lib source
# askpass 1.1 2019-01-13 [1] CRAN (R 4.0.2)
# assertthat 0.2.1 2019-03-21 [1] CRAN (R 4.0.2)
# backports 1.1.10 2020-09-15 [1] CRAN (R 4.0.2)
# Biobase * 2.48.0 2020-04-27 [1] Bioconductor
# BiocFileCache * 1.12.1 2020-08-04 [1] Bioconductor
# BiocGenerics * 0.34.0 2020-04-27 [1] Bioconductor
# bit 4.0.4 2020-08-04 [1] CRAN (R 4.0.2)
# bit64 4.0.5 2020-08-30 [1] CRAN (R 4.0.2)
# bitops 1.0-6 2013-08-17 [1] CRAN (R 4.0.0)
# blob 1.2.1 2020-01-20 [1] CRAN (R 4.0.2)
# callr 3.5.1 2020-10-13 [1] CRAN (R 4.0.2)
# cellranger 1.1.0 2016-07-27 [1] CRAN (R 4.0.2)
# cli 2.1.0 2020-10-12 [1] CRAN (R 4.0.2)
# crayon 1.3.4 2017-09-16 [1] CRAN (R 4.0.2)
# curl 4.3 2019-12-02 [1] CRAN (R 4.0.2)
# DBI 1.1.0 2019-12-15 [1] CRAN (R 4.0.2)
# dbplyr * 1.4.4 2020-05-27 [1] CRAN (R 4.0.2)
# DelayedArray * 0.14.1 2020-07-15 [1] Bioconductor
# desc 1.2.0 2018-05-01 [1] CRAN (R 4.0.2)
# devtools * 2.3.2 2020-09-18 [1] CRAN (R 4.0.2)
# digest 0.6.25 2020-02-23 [1] CRAN (R 4.0.2)
# dplyr 1.0.2 2020-08-18 [1] CRAN (R 4.0.2)
# ellipsis 0.3.1 2020-05-15 [1] CRAN (R 4.0.2)
# fansi 0.4.1 2020-01-08 [1] CRAN (R 4.0.2)
# fs 1.5.0 2020-07-31 [1] CRAN (R 4.0.2)
# gargle 0.5.0 2020-05-06 [1] CRAN (R 4.0.2)
# generics 0.0.2 2018-11-29 [1] CRAN (R 4.0.2)
# GenomeInfoDb * 1.24.2 2020-06-15 [1] Bioconductor
# GenomeInfoDbData 1.2.3 2020-06-30 [1] Bioconductor
# GenomicRanges * 1.40.0 2020-04-27 [1] Bioconductor
# glue 1.4.2 2020-08-27 [1] CRAN (R 4.0.2)
# googledrive 1.0.1 2020-05-05 [1] CRAN (R 4.0.2)
# googlesheets4 * 0.2.0 2020-05-08 [1] CRAN (R 4.0.2)
# here 0.1 2017-05-28 [1] CRAN (R 4.0.2)
# httr 1.4.2 2020-07-20 [1] CRAN (R 4.0.2)
# IRanges * 2.22.2 2020-05-21 [1] Bioconductor
# jsonlite 1.7.1 2020-09-07 [1] CRAN (R 4.0.2)
# lattice 0.20-41 2020-04-02 [1] CRAN (R 4.0.2)
# lifecycle 0.2.0 2020-03-06 [1] CRAN (R 4.0.2)
# magrittr 1.5 2014-11-22 [1] CRAN (R 4.0.2)
# Matrix 1.2-18 2019-11-27 [1] CRAN (R 4.0.2)
# matrixStats * 0.57.0 2020-09-25 [1] CRAN (R 4.0.2)
# memoise 1.1.0 2017-04-21 [1] CRAN (R 4.0.2)
# openssl 1.4.3 2020-09-18 [1] CRAN (R 4.0.2)
# pillar 1.4.6 2020-07-10 [1] CRAN (R 4.0.2)
# pkgbuild 1.1.0 2020-07-13 [1] CRAN (R 4.0.2)
# pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.0.2)
# pkgload 1.1.0 2020-05-29 [1] CRAN (R 4.0.2)
# prettyunits 1.1.1 2020-01-24 [1] CRAN (R 4.0.2)
# processx 3.4.4 2020-09-03 [1] CRAN (R 4.0.2)
# ps 1.3.4 2020-08-11 [1] CRAN (R 4.0.2)
# purrr 0.3.4 2020-04-17 [1] CRAN (R 4.0.2)
# R6 2.4.1 2019-11-12 [1] CRAN (R 4.0.2)
# rappdirs 0.3.1 2016-03-28 [1] CRAN (R 4.0.2)
# Rcpp 1.0.5 2020-07-06 [1] CRAN (R 4.0.2)
# RCurl 1.98-1.2 2020-04-18 [1] CRAN (R 4.0.0)
# remotes 2.2.0 2020-07-21 [1] CRAN (R 4.0.2)
# rlang 0.4.7 2020-07-09 [1] CRAN (R 4.0.2)
# rprojroot 1.3-2 2018-01-03 [1] CRAN (R 4.0.2)
# RSQLite 2.2.1 2020-09-30 [1] CRAN (R 4.0.2)
# rstudioapi 0.11 2020-02-07 [1] CRAN (R 4.0.2)
# S4Vectors * 0.26.1 2020-05-16 [1] Bioconductor
# sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 4.0.2)
# SummarizedExperiment * 1.18.2 2020-07-09 [1] Bioconductor
# testthat * 2.3.2 2020-03-02 [1] CRAN (R 4.0.2)
# tibble 3.0.3 2020-07-10 [1] CRAN (R 4.0.2)
# tidyselect 1.1.0 2020-05-11 [1] CRAN (R 4.0.2)
# usethis * 1.6.3 2020-09-17 [1] CRAN (R 4.0.2)
# vctrs 0.3.4 2020-08-29 [1] CRAN (R 4.0.2)
# withr 2.3.0 2020-09-22 [1] CRAN (R 4.0.2)
# XVector 0.28.0 2020-04-27 [1] Bioconductor
# zlibbioc 1.34.0 2020-04-27 [1] Bioconductor
#
# [1] D:/R/R-4.0.2/library
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment