-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdebug.R
52 lines (32 loc) · 1.07 KB
/
debug.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
compr <- dplyr::group_by(compr, qid)
truth.read.anno <- dplyr::group_by(truth.read.anno, qid)
#### check number of reads aligned(correct or not)
df <- dplyr::summarize(compr, aligned=any(nAln>0))
table(df$aligned, useNA="ifany")
## FALSE TRUE
## 8469 491531
dplyr::filter(truth.read.anno, aligned) %>% nrow()
## [1] 491531
## PASS
#### check number reads aligned correctly
df <- dplyr::summarize(compr,
aligned=any(nAln>0),
isAligned=any(nAln>0) & any(hit))
table(df$aligned, useNA="ifany")
## FALSE TRUE
## 8469 491531
table(df$isAligned, useNA="ifany")
## FALSE TRUE
## 10073 489927
## PASS
#### check distribution by if they are in repeat region
sum(table(truth.read.anno$isRep, useNA="ifany"))
##[1] 500000
#### check reads aligned incorrectly
df <- dplyr::summarize(compr,
aligned=any(nAln>0),
isAligned=any(nAln>0) & any(hit),
alignedNotRight = aligned & (! isAligned) )
table(df$alignedNotRight, useNA="ifany")
## FALSE TRUE
##498396 1604