Last updated: 2021-12-28

Checks: 7 0

Knit directory: ChromatinSplicingQTLs/analysis/

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(20191126) 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 89517ff. 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:    analysis/.Rhistory
    Ignored:    code/.DS_Store
    Ignored:    code/.Rhistory
    Ignored:    code/._.DS_Store
    Ignored:    code/._README.md
    Ignored:    code/._dag.pdf
    Ignored:    code/._report.html
    Ignored:    code/.ipynb_checkpoints/
    Ignored:    code/.snakemake/
    Ignored:    code/Alignments/
    Ignored:    code/ENCODE/
    Ignored:    code/ExpressionAnalysis/
    Ignored:    code/Fastq/
    Ignored:    code/FastqFastp/
    Ignored:    code/FastqFastpSE/
    Ignored:    code/FastqSE/
    Ignored:    code/Gather_gwas_summary_stats/
    Ignored:    code/Genotypes/
    Ignored:    code/Multiqc/
    Ignored:    code/Multiqc_chRNA/
    Ignored:    code/PeakCalling/
    Ignored:    code/Phenotypes/
    Ignored:    code/PlotGruberQTLs/
    Ignored:    code/ProCapAnalysis/
    Ignored:    code/QC/
    Ignored:    code/QTLs/
    Ignored:    code/ReferenceGenome/
    Ignored:    code/Session.vim
    Ignored:    code/SplicingAnalysis/
    Ignored:    code/TODO
    Ignored:    code/bigwigs/
    Ignored:    code/bigwigs_FromNonWASPFilteredReads/
    Ignored:    code/config/.DS_Store
    Ignored:    code/config/._.DS_Store
    Ignored:    code/config/ExternalFastqDataAccessions/
    Ignored:    code/config/OldSamplesConfig/
    Ignored:    code/dag.pdf
    Ignored:    code/featureCounts/
    Ignored:    code/gwas_summary_stats/
    Ignored:    code/hyprcoloc/
    Ignored:    code/logs/
    Ignored:    code/notebooks/.ipynb_checkpoints/
    Ignored:    code/out.hap.ld
    Ignored:    code/out.log
    Ignored:    code/report.html
    Ignored:    code/rules/OldRules/
    Ignored:    code/scratch/
    Ignored:    code/scripts/GTFtools_0.8.0/
    Ignored:    code/scripts/__pycache__/
    Ignored:    code/scripts/liftOverBedpe/liftOverBedpe.py
    Ignored:    code/snakemake.log
    Ignored:    code/snakemake.sbatch.log
    Ignored:    data/._PRJEB1350_RunTable.Ding_etal_CTCF.txt
    Ignored:    data/._igsr_samples.tsv
    Ignored:    data/._list_gwas_summary_statistics_PMID27863252.csv
    Ignored:    data/GrowthNotes/._20210830_GrowthNotes_chRNA.ConcentrationsToReplate.txt

Untracked files:
    Untracked:  code/snakemake_profiles/slurm/__pycache__/

Unstaged changes:
    Modified:   code/scripts/GenometracksByGenotype
    Modified:   output/hyprcoloc_results/ForColoc/hyprcoloc.results.txt.gz

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/20200110_PickSamplesForGrowth.Rmd) and HTML (docs/20200110_PickSamplesForGrowth.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 304e9b7 Benjmain Fair 2021-02-11 added data about picking samples

library(tidyverse)
library(readxl)
library(knitr)

LCLs.1000Genomes.vec <- read.table("../data/GiladStrains/YRI.list.from1000Genomes.txt", sep='\t') %>% pull(V1) %>%
  gsub("^NA", "", ., perl=T)

LCLs.GiladFreezer <- read.table("../data/GiladStrains/Human_LCLs.txt", sep = '\t', header = T, stringsAsFactors = F)

LCLs.GiladFreezer.LCL.YRI.vec <- read.table("../data/GiladStrains/LCL_YRI.GiladCryoSheetTab.list.txt", stringsAsFactors = F) %>% pull(V1) %>% as.character()

GrowthNotes <- read_delim("../data/GrowthNotes/GrowthNotes.tsv", delim = '\t')

SamplesToRestock.vec <- read.table("../data/GiladStrains/Human_LCLs.ToRestock.txt", stringsAsFactors = F) %>% pull(V1) %>% as.character()

Ok now figure out which lines to pull

AlreadyDone.vec <- GrowthNotes %>%
  filter(!is.na(`Raw Count1 (x10^6)`)) %>%
  pull(`Cell Line`) %>% as.character()

#Lines that I can replenish from Briana's stocks
LinesToPutBack.vec <- intersect(SamplesToRestock.vec, AlreadyDone.vec)

LinesStillNeedToRestock.vec <- setdiff(SamplesToRestock.vec, AlreadyDone.vec)

#Are there any YRI lines in Gilad lab freezer that aren't in YRI box
LCLs.GiladFreezer.MainTab.YRI.vec <-  LCLs.GiladFreezer %>%
  filter(Human.LCL.ID %in% LCLs.1000Genomes.vec) %>%
  pull(Human.LCL.ID) %>% as.character()
setdiff(LCLs.GiladFreezer.MainTab.YRI.vec, LCLs.GiladFreezer.LCL.YRI.vec)
 [1] "18489" "18498" "18501" "18503" "18504" "18509" "18511" "18516" "18518"
[10] "18519" "18521" "18522" "18852" "18855" "18856" "18857" "18858" "18859"
[19] "18860" "18861" "18862" "18871" "18872" "18907" "18909" "18912" "18913"
[28] "18914" "18916" "19092" "19093" "19099" "19100" "19102" "19103" "19114"
[37] "19116" "19119" "19120" "19127" "19129" "19130" "19131" "19132" "19137"
[46] "19138" "19139" "19140" "19142" "19143" "19144" "19145" "19152" "19153"
[55] "19159" "19161" "19171" "19173" "19190" "19201" "19202" "19203" "19204"
[64] "19205" "19206" "19210" "19211" "19222" "18854" "19208"
#And the reverse?
setdiff(LCLs.GiladFreezer.LCL.YRI.vec, LCLs.GiladFreezer.MainTab.YRI.vec)
[1] "19193" "19128" "18520"
BlacklistFromYang <- c("18502", "18516", "18916", "19012")
BlacklistFromBriana <- c("18517", "19128")

Let’s include those reverse matches in this experiment. Let’s come up with a list of “StillToDo” strains based on the following points

  1. Not already done
  2. Not in Yang or Briana’s blacklist
  3. Pull from the LinesStillNeedToRestock.vec first, and then from other lines in LCLs.GiladFreezer and not in LCLs.GiladFreezer.LCL.YRI.vec
  4. Should be in 1000Genome’s project (some samples are not, though they are clearly YRI from Coriell)
#Start with set of LCLs in GiladFreezer Main tab
StillToDo.vec <- LCLs.GiladFreezer.MainTab.YRI.vec %>%
  #Add list of LCLs in GiladFreezer YRI tab
  union(LCLs.GiladFreezer.MainTab.YRI.vec) %>%
  #intersect with 1000Genome's YRI list
  intersect(LCLs.1000Genomes.vec) %>%
  #Subtract out the blacklist strains and the ones we've already done
  setdiff(BlacklistFromYang) %>%
  setdiff(BlacklistFromBriana) %>%
  setdiff(AlreadyDone.vec) %>% sort()
length(StillToDo.vec)
[1] 65

From that list, let’s prioritize a list of 30 strains for this experiment by

  1. Including strains I still have to restock because I took a vial and didn’t replenish it from 2019
  2. The two lines that we need to redo because of swapped pellet
  3. Prioritize strains have more than 2 vials in the freezer
  4. Things that more published data already
NumVials <- read_delim("../data/GiladStrains/Human_LCLs.NumberOfVials.counts.txt", delim = '\t', col_names = c("Strain", "Count"))


LinesStillNeedToRestock.vec
[1] "19209" "18870" "19222" "19143" "18510" "18499" "18498"
LinesToRedoFromBriannasStocks.vec <- c("18861", "19140")

Points1And2 <- union(LinesStillNeedToRestock.vec,LinesToRedoFromBriannasStocks.vec)

#Points 3 and 4
LinesWithMoreThan2Vials.vec <- NumVials %>%
  filter(Strain %in% StillToDo.vec) %>%
  filter(Count > 2) %>%
  pull(Strain) %>%
  setdiff(Points1And2)
LinesWithMoreThan2Vials.vec
 [1] "18486" "18497" "18500" "18501" "18503" "18504" "18505" "18508" "18509"
[10] "18515" "18518" "18521" "18522" "18852" "18853" "18854" "18855" "18857"
[19] "18859" "18860" "18862" "18871" "18872" "18914" "19100" "19102" "19103"
[28] "19114" "19116" "19120" "19127" "19129" "19132" "19139" "19141" "19142"
[37] "19144" "19145" "19147" "19159" "19161" "19173" "19190" "19201" "19202"
[46] "19203" "19204" "19205" "19206" "19207" "19208" "19211" "19223" "19238"
[55] "19239" "19257"
LCLs.PreviousMolecularDatasets <- read_excel("../data/GiladStrains/individuals.data.types.xlsx", col_names =c("Line", "NumberAssays", "Assay1", "Assay2", "Assay3", "Assay4", "Assay5", "Assay6", "Assay7", "Assay8"))
head(LCLs.PreviousMolecularDatasets)
# A tibble: 6 x 10
   Line NumberAssays Assay1 Assay2 Assay3   Assay4  Assay5  Assay6 Assay7 Assay8
  <dbl>        <dbl> <chr>  <chr>  <chr>    <chr>   <chr>   <chr>  <chr>  <chr> 
1 18499            8 RNAseq Decay  prot     H3K27ac methyl… DNase  ribo   4su   
2 18498            8 RNAseq Decay  prot     H3K27ac methyl… DNase  ribo   4su   
3 19159            7 RNAseq Decay  methyla… H3K27ac DNase   ribo   4su    <NA>  
4 19150            1 RNAseq <NA>   <NA>     <NA>    <NA>    <NA>   <NA>   <NA>  
5 19153            7 RNAseq Decay  prot     H3K27ac DNase   ribo   4su    <NA>  
6 19152            7 RNAseq Decay  prot     H3K27ac DNase   ribo   4su    <NA>  
Points3And4 <- LCLs.PreviousMolecularDatasets %>%
  filter(Line %in% LinesWithMoreThan2Vials.vec) %>%
  arrange(desc(NumberAssays)) %>%
  slice_head(n=32-length(Points1And2)) %>%
  pull(Line) %>% as.character()

LinesToThaw <- union(Points3And4, Points1And2)
length(LinesToThaw)
[1] 32

Lastly, let’s obtain the exact location of these strains

#Read in location of strains
GiladLabLinesLocation <- read_delim("../data/GiladStrains/Large_Cryo_2019_Human_LCLs.tsv", delim = '\t', comment = '#')

GiladLabLinesLocation %>%
  filter(Line %in% LinesToThaw) %>%
  # filter(is.na(Notes1)) %>%
  arrange(Box) %>%
  distinct(Line, .keep_all = T) %>%
  dplyr::select(Box, Position, Line, Notes1) %>%
  write_tsv("../data/GiladStrains/20200111_CellsToWake.tsv")


GiladLabLinesLocation %>%
  filter(Line %in% c("18870", "18510"))
# A tibble: 12 x 11
   LineRowNumber LineColumnNumber LineColumnLetter LineReferenceString
           <dbl>            <dbl> <chr>            <chr>              
 1           149                2 B                Human LCLs'!B149   
 2           149                3 C                Human LCLs'!C149   
 3           149                4 D                Human LCLs'!D149   
 4           149                5 E                Human LCLs'!E149   
 5           149                6 F                Human LCLs'!F149   
 6           149                7 G                Human LCLs'!G149   
 7           149                8 H                Human LCLs'!H149   
 8           149                9 I                Human LCLs'!I149   
 9           149               10 J                Human LCLs'!J149   
10           152                2 B                Human LCLs'!B152   
11           152                3 C                Human LCLs'!C152   
12           261                4 D                Human LCLs'!D261   
# … with 7 more variables: Notes1ReferenceString <chr>,
#   Notes2ReferenceString <chr>, Box <dbl>, Position <dbl>, Line <chr>,
#   Notes1 <chr>, Notes2 <lgl>

Update:

As of 1/19, only 14/32 strains that we woke up are growing well. therefore, let’s thaw 13 more strains, bringing the total to 27, which, assuming no more than three drop out due to poor growth, will leave us with a batch of 24 for fractionation.

Let’s pick which ones to do by picking from the list of cell lines left to do, subtracting the 14 lines that are growing well, and then intersecting amongst the gilad lab YRI cryo rack strains which are probably stocked in better condition and I think will grow better…

GiladLabYRI.Rack <- read_delim("../data/GiladStrains/LCL_YRI.Gilad.Positions2.txt", delim = '\t') %>%
  mutate(Line=as.character(Line))

FourteenLinesAlreadyGrowing <- GrowthNotes %>%
  filter(Thawed == "1/12/21") %>%
  filter(`CellFractionedAttempted?` == "Y") %>%
  pull(`Cell Line`) %>% as.character()

CellLinesToThaw_Jan19 <- LCLs.1000Genomes.vec %>%
  setdiff(AlreadyDone.vec) %>%
  setdiff(FourteenLinesAlreadyGrowing) %>%
  base::intersect(GiladLabYRI.Rack %>% pull(Line))
  
CellLinesToThaw_Jan19
 [1] "19225" "18500" "18505" "18517" "18497" "18853" "19128" "19147" "18508"
[10] "18510" "18515" "18502" "19239" "19238" "19207" "19257" "19209" "19223"
[19] "18520"
GiladLabYRI.Rack %>%
  filter(Line %in% CellLinesToThaw_Jan19) %>%
  slice_head(n=13) %>%
  write_tsv("../data/GiladStrains/20200119_CellsToWake.tsv")

sessionInfo()
R version 3.6.1 (2019-07-05)
Platform: x86_64-conda_cos6-linux-gnu (64-bit)
Running under: Scientific Linux 7.4 (Nitrogen)

Matrix products: default
BLAS/LAPACK: /project2/yangili1/bjf79/ChromatinSplicingQTLs/code/.snakemake/conda/4480a43d58942cece9fb73087fc984b8/lib/R/lib/libRblas.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] knitr_1.31      readxl_1.3.1    forcats_0.5.1   stringr_1.4.0  
 [5] dplyr_1.0.5     purrr_0.3.4     readr_1.4.0     tidyr_1.1.3    
 [9] tibble_3.1.0    ggplot2_3.3.3   tidyverse_1.3.0

loaded via a namespace (and not attached):
 [1] tidyselect_1.1.0  xfun_0.20         bslib_0.2.4       haven_2.3.1      
 [5] colorspace_2.0-0  vctrs_0.3.7       generics_0.1.0    htmltools_0.5.1.1
 [9] yaml_2.2.1        utf8_1.2.1        rlang_0.4.10      jquerylib_0.1.3  
[13] later_1.1.0.1     pillar_1.5.1      withr_2.4.1       glue_1.4.2       
[17] DBI_1.1.1         dbplyr_2.1.1      modelr_0.1.8      lifecycle_1.0.0  
[21] cellranger_1.1.0  munsell_0.5.0     gtable_0.3.0      workflowr_1.6.2  
[25] rvest_1.0.0       evaluate_0.14     ps_1.6.0          httpuv_1.5.5     
[29] fansi_0.4.2       broom_0.7.6       Rcpp_1.0.6        promises_1.2.0.1 
[33] backports_1.2.1   scales_1.1.1      jsonlite_1.7.2    fs_1.5.0         
[37] hms_1.0.0         digest_0.6.27     stringi_1.4.3     rprojroot_2.0.2  
[41] grid_3.6.1        cli_2.4.0         tools_3.6.1       magrittr_2.0.1   
[45] sass_0.3.1        crayon_1.4.1      whisker_0.4       pkgconfig_2.0.3  
[49] ellipsis_0.3.1    xml2_1.3.2        reprex_1.0.0      lubridate_1.7.10 
[53] rstudioapi_0.13   assertthat_0.2.1  rmarkdown_2.7     httr_1.4.2       
[57] R6_2.5.0          git2r_0.28.0      compiler_3.6.1