Skip to content

Commit 2a39f81

Browse files
committed
correct minor underestimation of overall FrIP in the report
1 parent 9affe20 commit 2a39f81

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

complete_update_history.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## Complete Update History
22
- Version 1.4.2 released
33
* correct bugs in processing single-end sequencing data
4+
* correct minor underestimate of overall FrIP in the qc report
45
- Version 1.4.1 released
56
* *qc_per_barcode*: add tss enrichment score per cell into the QC metrics
67
* update tutorial

scripts/src/scATAC-pro_report.Rmd

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ library(RColorBrewer)
4747
library(ggplot2)
4848
library(cicero)
4949
library(viridis)
50+
library(GenomicRanges)
5051

5152
```
5253

@@ -147,10 +148,15 @@ mapq30.frac.in.cell = paste0(round(sum(frags[bc %in% barcodes]$ndup)/sum(frags$n
147148

148149
med.frag.per.cell = round(median(qc_sele$total_frags))
149150
frac.uniq = paste0(round(nrow(frags[bc %in% barcodes])/sum(frags[bc %in% barcodes]$ndup), 3) * 100, '%')
150-
frac.in.peak = sum(bc_stat$total_frags * bc_stat$frac_peak)/sum(bc_stat$total_frags)
151+
152+
#frac.in.peak = sum(bc_stat$total_frags * bc_stat$frac_peak)/sum(bc_stat$total_frags)
153+
names(peaks)[1:3] = c('chr', 'start', 'end')
154+
frac.in.peak <- GenomicRanges::countOverlaps(makeGRangesFromDataFrame(frags), makeGRangesFromDataFrame(peaks))
155+
frac.in.peak <- mean(frac.in.peak > 0)
151156
frac.in.peak = paste0(round(frac.in.peak, 3)*100, '%')
152157

153-
frac.in.cell = sum(qc_sele$total_frags)/sum(bc_stat$total_frags)
158+
#frac.in.cell = sum(qc_sele$total_frags)/sum(bc_stat$total_frags)
159+
frac.in.cell = sum(qc_sele$total_frags)/nrow(frags)
154160
frac.in.cell = paste0(round(frac.in.cell, 3)*100, '%')
155161

156162
cell.table = data.frame(c(PEAK_CALLER, nrow(peaks),

0 commit comments

Comments
 (0)