Last updated: 2020-01-14

Checks: 7 0

Knit directory: Simon_et_al_2020/

This reproducible R Markdown analysis was created with workflowr (version 1.6.0). 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(20200113) 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 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:    .DS_Store
    Ignored:    .Rhistory
    Ignored:    .Rproj.user/
    Ignored:    analysis/.Rhistory
    Ignored:    code/.Rhistory
    Ignored:    data/.DS_Store
    Ignored:    output/.DS_Store
    Ignored:    output/.Rhistory

Untracked files:
    Untracked:  analysis/2019-02-22_RNA-seq_DE_1.Rmd
    Untracked:  analysis/2019-02-22_RNA-seq_DE_2.Rmd
    Untracked:  analysis/2019-02-22_RNA-seq_DE_3.Rmd
    Untracked:  analysis/2020-01-12_TCR-seq_EDA_2.Rmd
    Untracked:  data/RNA/
    Untracked:  data/TCR/
    Untracked:  data/clinical-data/
    Untracked:  data/gene-sets/
    Untracked:  misc/
    Untracked:  output/2019-02-22_RNA-seq_DE_1.RData
    Untracked:  output/2019-02-27_TCR-seq_QC.RData
    Untracked:  output/2019-02-28_TCR-seq_EDA.RData
    Untracked:  output/2020-01-12_TCR-seq_EDA_2.RData
    Untracked:  output/RNA_count.rds
    Untracked:  output/RNA_raw_count.rds
    Untracked:  output/TCR_count.rds
    Untracked:  output/TCR_pData.rds
    Untracked:  output/output_2019-02-22/

Unstaged changes:
    Modified:   analysis/index.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 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 a98e6a5 ValentinVoillet 2020-01-14 Edits .Rmd (RNA-seq_QC & TCR-seq_QC)
html 85b86fd ValentinVoillet 2020-01-14 Add .html files
Rmd 378d173 ValentinVoillet 2020-01-14 Edits .Rmd (TCR-seq_QC)

File creation: February, 27th 2019
Update: January, 14th 2020

1 Description & importing data


RNA was extracted from 12 patients. Alignment and quantification of TCR sequences have been performed by QIAGEN

  • 12 patients: P5, P6, P7, P8, P14, P15, P16, P18, P19, P21, P22 and P23;

  • Four time points: T0, M1, M2 & M6;

  • One treatment: anti-PD1;

  • Four fractions: PD-1+TIGIT+, PD-1+, TIGIT+ and PD-1-TIGIT-;

  • Two outcomes: NR and R;

  • Three batches.

According to QIAGEN, some samples have small library sizes (in which mainly reads were > 55bp); and others have libraries of correct size but mostly with reads < 55 bp.

As in Simon et al. (2018), to leverage the power of UMI tagging to reduce NGS errors leading to fals clonotype calls, QIAGEN discarded cdr3 calls that did not have at least one UMI supported by three reads.

2 Quality Control


Version Author Date
85b86fd ValentinVoillet 2020-01-14

It appears that some samples have a pretty low total of read pairs.

Version Author Date
85b86fd ValentinVoillet 2020-01-14

Some samples have less than 40% of their total reads that have been used for clonotype calls.

Version Author Date
85b86fd ValentinVoillet 2020-01-14

Few samples have less than 3 as mean read pairs per UMI.

Samples w/ less than 250000 total read pairs, less than 40% of total reads usable for clonotype calls and less than 3 as mean read pairs per UMI are removed for downstream analyses.
In total, 14 samples are removed (6-ZC-T0-PD1, 6-ZC-M1-PD1, 8-CJ-M2-PD1, 8-CJ-M6-TIGIT, 16-PR-M2-TIGIT, P19-BM-M2-DPOS, P22-GM-M1-DPOS, P22-GM-M1-TIGIT, P23-MA-T0-DPOS, P23-MA-T0-DNEG, P23-MA-T0-PD1, P23-MA-M2-DPOS, P23-MA-M2-DNEG & P23-MA-M2-PD1).

###--- Filtering
#- TCR pData
TCR.pData %>%
  filter(`# read pairs total` < 250000 | `% reads usable for clonotype calls all` < 0.4 | `mean read pairs per UMI` < 3) %>%
  pull(QIAGEN.id) -> sample.id.r
TCR.pData %>%
  filter(QIAGEN.id %in% sample.id.r) %>% 
  View("samples.to.remove") # 14 samples
TCR.pData.2 <- TCR.pData %>%
  filter(!QIAGEN.id %in% sample.id.r)
saveRDS(object = TCR.pData.2, here("output", "TCR_pData.rds"))
#- TCR exprs
TCR.exprs %>%
  filter(QIAGEN.id %in% TCR.pData.2$QIAGEN.id) %>%
  filter(nchar(cdr3aa) >= 7 & nchar(cdr3aa) <= 25) %>%
  mutate(total.UMIs = `UMIs with >= 1 reads`) %>%
  group_by(QIAGEN.id, chain) %>%
  mutate(freq.after.filtering = total.UMIs / sum(total.UMIs)) -> TCR.exprs.2
saveRDS(object = TCR.exprs.2, here("output", "TCR_count.rds"))

###--- Comparison with RNA-seq
countData <- readRDS(file = here("output", "RNA_count.rds"))
countData$sample.id # 120 samples
TCR.pData.2$sample.id # 158 samples (M6 included)
intersect(countData$sample.id, TCR.pData.2$sample.id) # 114 samples
setdiff(countData$sample.id, TCR.pData.2$sample.id) # 7 samples
setdiff(TCR.pData.2$sample.id, countData$sample.id) # 44 samples

sessionInfo()
R version 3.6.2 (2019-12-12)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Mojave 10.14.6

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib

locale:
[1] fr_FR.UTF-8/fr_FR.UTF-8/fr_FR.UTF-8/C/fr_FR.UTF-8/fr_FR.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] here_0.1          data.table_1.12.8 janitor_1.2.0     forcats_0.4.0    
 [5] stringr_1.4.0     dplyr_0.8.3       purrr_0.3.3       readr_1.3.1      
 [9] tidyr_1.0.0       tibble_2.1.3      ggplot2_3.2.1     tidyverse_1.3.0  

loaded via a namespace (and not attached):
 [1] tidyselect_0.2.5 xfun_0.12        haven_2.2.0      lattice_0.20-38 
 [5] colorspace_1.4-1 vctrs_0.2.1      generics_0.0.2   htmltools_0.4.0 
 [9] yaml_2.2.0       rlang_0.4.2      later_1.0.0      pillar_1.4.3    
[13] withr_2.1.2      glue_1.3.1       DBI_1.1.0        dbplyr_1.4.2    
[17] modelr_0.1.5     readxl_1.3.1     lifecycle_0.1.0  munsell_0.5.0   
[21] gtable_0.3.0     workflowr_1.6.0  cellranger_1.1.0 rvest_0.3.5     
[25] evaluate_0.14    labeling_0.3     knitr_1.26       httpuv_1.5.2    
[29] fansi_0.4.1      broom_0.5.3      Rcpp_1.0.3       promises_1.1.0  
[33] backports_1.1.5  scales_1.1.0     jsonlite_1.6     farver_2.0.2    
[37] fs_1.3.1         hms_0.5.3        digest_0.6.23    stringi_1.4.5   
[41] grid_3.6.2       rprojroot_1.3-2  cli_2.0.1        tools_3.6.2     
[45] magrittr_1.5     lazyeval_0.2.2   crayon_1.3.4     whisker_0.4     
[49] pkgconfig_2.0.3  zeallot_0.1.0    xml2_1.2.2       reprex_0.3.0    
[53] lubridate_1.7.4  rstudioapi_0.10  assertthat_0.2.1 rmarkdown_2.0   
[57] httr_1.4.1       R6_2.4.1         nlme_3.1-143     git2r_0.26.1    
[61] compiler_3.6.2