-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSQL-SRA-QRY-anno-distribution2.txt
126 lines (121 loc) · 4.44 KB
/
SQL-SRA-QRY-anno-distribution2.txt
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
-- Studies, their total Experiment counts and the number/% of these experiments annotated
-- for all, fragmentation, ligation or enrichment
-- DEPENDENCIES: study_exp_count [must first run SQL-SRA-QRY-anno-distribution.txt SQL script]
select 'fragmentation' as anno, *, count(score) as score_c from
(
select id, total, c, cast (c as real)/cast (total as real) * 100 as score from
(
select
stu.study_accession id, exp_count.total as total, count(library_construction_protocol) as c from study as stu
join
experiment as exp
on exp.study_accession = stu.study_accession
join
study_exp_count as exp_count
on exp_count.stu_id = stu.study_accession
where
library_construction_protocol like "% shear%"
or library_construction_protocol like "% restriction%"
or library_construction_protocol like "% digest%"
or library_construction_protocol like "% fragment%"
or library_construction_protocol like "% breaks %"
or library_construction_protocol like "% nebulis%" or library_construction_protocol like "% nebuliz%"
or library_construction_protocol like "% acoustic%"
or library_construction_protocol like "% sonic%"
group by id
)
) group by score
union all
select 'ligation' as anno, *, count(score) as score_c from
(
select id, total, c, cast (c as real)/cast (total as real) * 100 as score from
(
select
stu.study_accession id, exp_count.total as total, count(library_construction_protocol) as c from study as stu
join
experiment as exp
on exp.study_accession = stu.study_accession
join
study_exp_count as exp_count
on exp_count.stu_id = stu.study_accession
where
library_construction_protocol like "% adapter%"
or library_construction_protocol like "% ligat%"
or library_construction_protocol like "% blunt%"
or library_construction_protocol like "% phosphorylat%"
or library_construction_protocol like "% overhang"
or library_construction_protocol like "% t4-PNK%"
or library_construction_protocol like "% t4%"
or library_construction_protocol like "% pnk%"
or library_construction_protocol like "% kinase%"
or library_construction_protocol like "% a-tail%"
group by id
)
) group by score
union all
select 'enrichment' as anno, *, count(score) as score_c from
(
select id, total, c, cast (c as real)/cast (total as real) * 100 as score from
(
select
stu.study_accession id, exp_count.total as total, count(library_construction_protocol) as c from study as stu
join
experiment as exp
on exp.study_accession = stu.study_accession
join
study_exp_count as exp_count
on exp_count.stu_id = stu.study_accession
where
library_construction_protocol like "% clone%"
or library_construction_protocol like "% clonin%"
or library_construction_protocol like "% pcr %"
or library_construction_protocol like "% amplif%"
or library_construction_protocol like "% polymerase%"
or library_construction_protocol like "% taq%"
or library_construction_protocol like "% phusion%"
or library_construction_protocol like "% temperat%"
or library_construction_protocol like "% thermal%"
or library_construction_protocol like "% anneal%"
or library_construction_protocol like "% denature%"
group by id
)
) group by score
union all
select 'all' as anno, *, count(score) as score_c from
(
select id, total, c, cast (c as real)/cast (total as real) * 100 as score from
(
select
stu.study_accession id, exp_count.total as total, count(library_construction_protocol) as c from study as stu
join
experiment as exp
on exp.study_accession = stu.study_accession
join
study_exp_count as exp_count
on exp_count.stu_id = stu.study_accession
where
( library_construction_protocol like "% shear%"
or library_construction_protocol like "% restriction%"
or library_construction_protocol like "% digest%"
or library_construction_protocol like "% fragment%"
or library_construction_protocol like "% breaks %"
or library_construction_protocol like "% nebulis%"
or library_construction_protocol like "% nebuliz%"
or library_construction_protocol like "% acoustic%"
or library_construction_protocol like "% sonic%"
) AND
(
library_construction_protocol like "% adapter%"
or library_construction_protocol like "% ligat%"
or library_construction_protocol like "% blunt%"
or library_construction_protocol like "% phosphorylat%"
or library_construction_protocol like "% overhang"
or library_construction_protocol like "% t4-PNK%"
or library_construction_protocol like "% t4%"
or library_construction_protocol like "% pnk%"
or library_construction_protocol like "% kinase%"
or library_construction_protocol like "% a-tail%"
)
group by id
)
) group by score;