-
Notifications
You must be signed in to change notification settings - Fork 0
/
Variant test.R
71 lines (39 loc) · 2.29 KB
/
Variant test.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
library(stringr)
VDelta_21A <- c("T19R","V70F","T95I","G142D","F157del","R158del","A222V","W258L",
"K417N","L452R","T478K","D614G","P681R","D950N")
VDelta_B1.617.2 <- c("T19R","T95I","G142D","F157del","R158del",
"L452R","T478K","D614G","P681R","D950N")
VDelta_B1.617.2_inco <- c("T19R","G142D","F157del","R158del",
"L452R","T478K","D614G","P681R","D950N")
VDelta_AY.1.22 <- c("T19R","T95I","G142D","F157del","R158del","W258L",
"K417N","L452R","T478K","D614G","P681R","D950N")
VDelta_AY.1.22_incos <- c("T19R","G142D","F157del","R158del","W258L",
"K417N","L452R","T478K","D614G","P681R","D950N")
VDelta_AY.2 <- c("T19R","V70F","G142D","F157del","R158del","A222V",
"K417N","L452R","T478K","D614G","P681R","D950N")
covid_seq$ExistingMutList[1]
str_detect(covid_seq$ExistingMutList, pattern = VDelta_21A)
length(covid_seq$ExistingMutList)
lapply(covid_seq$ExistingMutList, str_detect, pattern=VDelta_AY.1.22)
lapply(covid_seq$ExistingMutList, str_detect, pattern=VDelta_AY.1.22_incos)
lapply(covid_seq$ExistingMutList, str_detect, pattern=VDelta_B1.617.2_inco)
lapply(covid_seq$ExistingMutList, str_detect, pattern=VDelta_B1.617.2)
covidDeltal_VDelta_AY.1.22 <-lapply(covid_seq$ExistingMutList, str_count, pattern=VDelta_AY.1.22)
covidDeltal_VDelta_AY.1.22_inco <-lapply(covid_seq$ExistingMutList, str_count, pattern=VDelta_AY.1.22_incos)
covidDeltal_VDelta_B1.617.2_inco <-lapply(covid_seq$ExistingMutList, str_count, pattern=VDelta_B1.617.2_inco)
covidDeltal_VDelta_B1.617.2 <- lapply(covid_seq$ExistingMutList, str_count, pattern=VDelta_B1.617.2)
length(VDelta_B1.617.2)
lapply(covidDeltal_VDelta_B1.617.2, sum)==length(VDelta_B1.617.2)
lapply(covidDeltal_VDelta_B1.617.2_inco, sum) ==length(VDelta_B1.617.2_inco)
table(lapply(covidDeltal_VDelta_B1.617.2_inco, sum) ==length(VDelta_B1.617.2_inco))
length(VDelta_AY.1.22)
length(VDelta_AY.1.22_incos)
lapply(covidDeltal, sum)
rm(VariantDelta_B1.617.2)
covid_seq1 <- as.data.frame(covid_seq)
(str_detect(covid_seq$ExistingMutList[1], pattern = VDelta_B1.617.2))== TRUE
VariantDelta_B1.617.2 <- as.list(NULL)
for (i in 1:nrow(covid_seq1)){
VariantDelta_B1.617.2[i] <- str_detect(covid_seq$ExistingMutList[1], pattern = VDelta_B1.617.2)
}
VariantDelta_B1.617.2