@@ -24,14 +24,23 @@ extr_iris <- function(casrn = NULL, verbose = TRUE) {
24
24
# Check if online
25
25
check_internet(verbose = verbose )
26
26
27
+
28
+ # Need to downgrade libcurl?
29
+ if (isTRUE(check_need_libcurl_condathis())) {
30
+ condathis_downgrade_libcurl()
31
+ extr_iris_to_use <- extr_iris_openssl_
32
+ } else {
33
+ extr_iris_to_use <- extr_iris_
34
+ }
35
+
27
36
if (length(casrn ) > 1 ) {
28
- dat <- lapply(casrn , extr_iris_ ,
37
+ dat <- lapply(casrn , extr_iris_to_use ,
29
38
cancer_types = cancer_types ,
30
39
verbose = verbose
31
40
)
32
41
out <- do.call(rbind , dat )
33
42
} else {
34
- out <- extr_iris_ (
43
+ out <- extr_iris_to_use (
35
44
casrn = casrn ,
36
45
cancer_types = cancer_types ,
37
46
verbose = verbose
@@ -130,7 +139,7 @@ extr_iris_ <- function(casrn = NULL,
130
139
}
131
140
132
141
133
- # ' extr_iris_linux
142
+ # ' extr_iris_openssl_
134
143
# '
135
144
# ' @inheritParams extr_iris_
136
145
extr_iris_openssl_ <- function (casrn ,
@@ -161,9 +170,17 @@ extr_iris_openssl_ <- function(casrn,
161
170
env_name = " openssl-linux-env" , verbose = FALSE
162
171
)
163
172
164
- out <- curl_res $ stdout | >
173
+ dat <- curl_res $ stdout | >
165
174
rvest :: read_html() | >
166
175
rvest :: html_table()
167
176
168
- out [[1 ]]
177
+ out <- dat [[1 ]][dat [[1 ]]$ CASRN %in% casrn , ]
178
+
179
+ if (nrow(out ) > 0 ) {
180
+ out [, " query" ] <- casrn
181
+ } else {
182
+ out [1 , " query" ] <- casrn
183
+ }
184
+
185
+ out
169
186
}
0 commit comments