stuart-lab / signac

R toolkit for the analysis of single-cell chromatin data
https://stuartlab.org/signac/
Other
302 stars 84 forks source link

TSS enrichment is different in cellranger report and Signac #1691

Closed Shuresearcher closed 1 month ago

Shuresearcher commented 2 months ago

I did scATACseq using BM LSK cells from mice. TSS enrichment score likes fine - the peak is at around 10 in cellranger report. But TSS enrichment score is bad - the peak is around 2. I saw they used different name. Cellranger used relative enrichment in the report. Signac used mean TSS enrichment score. Does they used different calculation methods? Do I have some problem in code?

metadata <- read.csv( file = "./ND-A2/singlecell.csv", header = TRUE, row.names = 1 ) row.names(counts)[1:10]

chrom_assay <- CreateChromatinAssay( counts = counts, sep = c(":", "-"), genome = "mm10",#mm10 is for C57 and in v75 fragments = './ND-A2/fragments.tsv.gz', min.cells = 1#clude features detected in at least this many cells. Will subset the counts matrix as well. To reintroduce excluded features, create a new object with a lower cutoff. )

NDLSK <- CreateSeuratObject( counts = chrom_assay, assay = "peaks", project = 'LSK_ND',# we will know which data when we merge different data meta.data = metadata )

extract gene annotations from EnsDb

annotations <- GetGRangesFromEnsDb(ensdb = EnsDb.Mmusculus.v79)

change to UCSC style since the data was mapped to mm10

seqlevels(annotations) <- paste0('chr', seqlevels(annotations)) genome(annotations) <- "mm10"

add the gene information to the object

Annotation(NDLSK) <- annotations

Computing QC Metrics

NDLSK <- NucleosomeSignal(object = NDLSK)

NDLSK$nucleosome_group <- ifelse(NDLSK$nucleosome_signal > 2, 'NS > 2', 'NS < 2') FragmentHistogram(object = NDLSK, group.by = 'nucleosome_group', region = 'chr1-1-10000000') ggsave( filename = "./NDLSK single sample/1.2.1 before QC data quiclity FragmentHistogram.pdf", width = 8, height = 4 ) FragmentHistogram(object = NDLSK, region = 'chr1-1-10000000')

NDLSK <- TSSEnrichment(NDLSK, fast = FALSE) NDLSK$high.tss <- ifelse(NDLSK$TSS.enrichment > 1, 'High', 'Low') TSSPlot(NDLSK, group.by = 'high.tss') + NoLegend()

TSSPlot(NDLSK) + NoLegend()

cell ranger: image

signac: image

timoast commented 1 month ago

These are different software implementations, different implementations of the visualisation, and potentially different set of cells. We don't expect the output to be identical, please reopen this issue if you think there is a bug in the software and can provide a reproducible example