ktrns / scrnaseq

Workflow for single-cell RNA-seq analysis using Seurat
MIT License
37 stars 15 forks source link

Small changes before release #102

Closed ktrns closed 2 years ago

ktrns commented 3 years ago

I figured that for my projects it is helpful to plot QC again after we filtered based on the given thresholds. I'd like to include this into the main scrnaseq.Rmd.

Edit 23.2.22: done

ktrns commented 3 years ago

Double-check chunk headers

Edit 23.2.22: done

ktrns commented 3 years ago

Table Number of cells per sample and cluster: column names = clusters are not sorted

Edit 23.2.22: done

ktrns commented 3 years ago

UPDATE: We changed this back to the original. We need to consider both values, but not systematically like below. More of a visual inspection of the QC scatter plots.


QC-filter cells only if they break all numeric filters, e.g. more than 20% mitochondrial reads AND less than 500 genes. Citation from the best practice paper:

"[...], cells with a comparatively high fraction of mitochondrial counts may be involved in respiratory processes. Likewise, other QC covariates also have biological interpretations. Cells with low counts and/or genes may correspond to quiescent cell populations, and cells with high counts may be larger in size. Indeed, molecular counts can differ strongly between cells [...]. Thus, QC covariates should be considered jointly when univariate thresholding decisions are made [...], and these thresholds should be set as permissive as possible to avoid filtering out viable cell populations unintentionally."

Solution in chunk filter_cells:

  filter_result_sep = purrr::map(list_names(param$cell_filter[[n]]), function(f) {
    filter = param$cell_filter[[n]][[f]]
    if (is.numeric(filter)) {
      if (is.na(filter[1])) filter[1] = -Inf # Minimum
      if (is.na(filter[2])) filter[2] = Inf  # Maximum 
      idx_exclude = sc[[n]][[f, drop=TRUE]] < filter[1] | sc[[n]][[f, drop=TRUE]] > filter[2]
      return(names(which(idx_exclude)))
    } else if (is.character(filter)) { 
      idx_exclude = !sc[[n]][[f, drop=TRUE]] %in% filter
      return(Cells(sc[[n]])[idx_exclude])
    }
  })

  filter_result = list()
  filter_result$qc_jointly = filter_result_sep %>% purrr::reduce(.f=intersect)
ktrns commented 2 years ago

Update docs/*.md on how to run the pipelines

Edit 23.2.22: added a separate #112

ktrns commented 2 years ago

Solve #73 - add a point to the main README.md

Edit 23.2.22: done

ktrns commented 2 years ago

@andpet0101 fixed a range of small bugs:

Open issues: