1
1
export const SNP_AUTOCOMPLETE_QUERY = `
2
- query suggestions($assembly: String!, $snpid: String!) {
3
- snpAutocompleteQuery(assembly: $assembly, snpid: $snpid) {
4
- id
5
- coordinates {
6
- chromosome
7
- start
8
- end
9
- }
10
- }
11
- }` ;
2
+ query suggestions($assembly: String!, $snpid: String!) {
3
+ snpAutocompleteQuery(assembly: $assembly, snpid: $snpid) {
4
+ id
5
+ coordinates {
6
+ chromosome
7
+ start
8
+ end
9
+ }
10
+ }
11
+ }
12
+ ` ;
12
13
13
14
export const GENE_AUTOCOMPLETE_QUERY = `
14
- query Genes(
15
- $id: [String]
16
- $name: [String]
17
- $strand: String
18
- $chromosome: String
19
- $start: Int
20
- $end: Int
21
- $gene_type: String
22
- $havana_id: String
23
- $name_prefix: [String!]
24
- $limit: Int
25
- $assembly: String!
26
- ) {
27
- gene(
28
- id: $id
29
- name: $name
30
- strand: $strand
31
- chromosome: $chromosome
32
- start: $start
33
- end: $end
34
- gene_type: $gene_type
35
- havana_id: $havana_id
36
- name_prefix: $name_prefix
37
- limit: $limit
38
- assembly: $assembly
39
- orderby: "name"
40
- ) {
41
- id
42
- name
43
- coordinates {
44
- chromosome
45
- start
46
- end
47
- }
48
- }
49
- }
15
+ query Genes(
16
+ $id: [String]
17
+ $name: [String]
18
+ $strand: String
19
+ $chromosome: String
20
+ $start: Int
21
+ $end: Int
22
+ $gene_type: String
23
+ $havana_id: String
24
+ $name_prefix: [String!]
25
+ $limit: Int
26
+ $assembly: String!
27
+ ) {
28
+ gene(
29
+ id: $id
30
+ name: $name
31
+ strand: $strand
32
+ chromosome: $chromosome
33
+ start: $start
34
+ end: $end
35
+ gene_type: $gene_type
36
+ havana_id: $havana_id
37
+ name_prefix: $name_prefix
38
+ limit: $limit
39
+ assembly: $assembly
40
+ orderby: "name"
41
+ ) {
42
+ id
43
+ name
44
+ coordinates {
45
+ chromosome
46
+ start
47
+ end
48
+ }
49
+ }
50
+ }
50
51
` ;
51
52
52
53
export const RESOLVE_QUERY = `
53
- query q(
54
- $id: String!
55
- $assembly: String!
56
- ) {
57
- resolve(
58
- id: $id
59
- assembly: $assembly
60
- ) {
61
- coordinates {
62
- chromosome
63
- start
64
- end
65
- }
66
- }
67
- }` ;
54
+ query q(
55
+ $id: String!
56
+ $assembly: String!
57
+ ) {
58
+ resolve(
59
+ id: $id
60
+ assembly: $assembly
61
+ ) {
62
+ coordinates {
63
+ chromosome
64
+ start
65
+ end
66
+ }
67
+ }
68
+ }
69
+ ` ;
68
70
69
71
export const ICRE_AUTOCOMPLETE_QUERY = `
70
- query iCREQuery($accession_prefix: [String!], $limit: Int) {
71
- iCREQuery(accession_prefix: $accession_prefix, limit: $limit) {
72
- rdhs
73
- accession
74
- celltypes
75
- coordinates {
76
- start
77
- end
78
- chromosome
79
- }
80
- }
81
- }
72
+ query iCREQuery($accession_prefix: [String!], $limit: Int) {
73
+ iCREQuery(accession_prefix: $accession_prefix, limit: $limit) {
74
+ rdhs
75
+ accession
76
+ celltypes
77
+ coordinates {
78
+ start
79
+ end
80
+ chromosome
81
+ }
82
+ }
83
+ }
82
84
` ;
83
85
84
86
export const CCRE_AUTOCOMPLETE_QUERY = `
85
- query cCREQuery($accession_prefix: [String!], $limit: Int, $assembly: String!) {
86
- cCREQuery(accession_prefix: $accession_prefix, assembly: $assembly, limit: $limit) {
87
- accession
88
- coordinates {
89
- start
90
- end
91
- chromosome
92
- }
93
- }
87
+ query cCREAutocompleteQuery(
88
+ $accession_prefix: [String!]
89
+ $assembly: String!
90
+ $includeiCREs: Boolean
91
+ $limit: Int
92
+ ) {
93
+ cCREAutocompleteQuery(
94
+ includeiCREs: $includeiCREs
95
+ assembly: $assembly
96
+ limit: $limit
97
+ accession_prefix: $accession_prefix
98
+ ) {
99
+ accession
100
+ isiCRE
101
+ coordinates {
102
+ chromosome
103
+ start
104
+ end
105
+ }
94
106
}
107
+ }
95
108
` ;
96
109
97
110
export const getICREs = async ( value : string , limit : number ) => {
@@ -109,23 +122,33 @@ export const getICREs = async (value: string, limit: number) => {
109
122
return response . json ( ) ;
110
123
} ;
111
124
112
- export const getCCREs = async ( value : string , assembly : string , limit : number ) => {
125
+ export const getCCREs = async (
126
+ value : string ,
127
+ assembly : string ,
128
+ limit : number ,
129
+ showiCREFlag : boolean
130
+ ) => {
113
131
const response = await fetch ( "https://screen.api.wenglab.org/graphql" , {
114
132
method : "POST" ,
115
133
body : JSON . stringify ( {
116
- query : CCRE_AUTOCOMPLETE_QUERY ,
134
+ query : CCRE_AUTOCOMPLETE_QUERY ,
117
135
variables : {
118
136
accession_prefix : [ value ] ,
119
137
assembly : assembly . toLowerCase ( ) ,
120
138
limit : limit ,
139
+ includeiCREs : showiCREFlag
121
140
} ,
122
141
} ) ,
123
142
headers : { "Content-Type" : "application/json" } ,
124
143
} ) ;
125
144
return response . json ( ) ;
126
145
} ;
127
146
128
- export const getGenes = async ( value : string , assembly : string , limit : number ) => {
147
+ export const getGenes = async (
148
+ value : string ,
149
+ assembly : string ,
150
+ limit : number
151
+ ) => {
129
152
const response = await fetch ( "https://screen.api.wenglab.org/graphql" , {
130
153
method : "POST" ,
131
154
body : JSON . stringify ( {
@@ -142,7 +165,11 @@ export const getGenes = async (value: string, assembly: string, limit: number) =
142
165
return response . json ( ) ;
143
166
} ;
144
167
145
- export const getSNPs = async ( value : string , assembly : string , limit : number ) => {
168
+ export const getSNPs = async (
169
+ value : string ,
170
+ assembly : string ,
171
+ limit : number
172
+ ) => {
146
173
const response = await fetch ( "https://screen.api.wenglab.org/graphql" , {
147
174
method : "POST" ,
148
175
body : JSON . stringify ( {
0 commit comments