@sjcrh/proteinpaint-rust 2.191.6 → 2.193.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Cargo.toml +0 -8
- package/package.json +1 -1
- package/src/gdcmaf.rs +18 -40
- package/src/bigwig.rs +0 -676
- package/src/gdcGRIN2.rs +0 -1261
package/Cargo.toml
CHANGED
|
@@ -25,7 +25,6 @@ statrs = "^0.16.0"
|
|
|
25
25
|
libc = "0.2"
|
|
26
26
|
fishers_exact="^1.0.1"
|
|
27
27
|
bio = "1.5.0"
|
|
28
|
-
bigtools = "^0.1.11"
|
|
29
28
|
libmath = "^0.2.1"
|
|
30
29
|
json = "^0.12.4"
|
|
31
30
|
serde = {version = "^1.0.147", features = ["derive"]}
|
|
@@ -67,9 +66,6 @@ path="src/indel.rs"
|
|
|
67
66
|
name="fisher"
|
|
68
67
|
path="src/fisher.rs"
|
|
69
68
|
|
|
70
|
-
[[bin]]
|
|
71
|
-
name="bigwig"
|
|
72
|
-
path="src/bigwig.rs"
|
|
73
69
|
|
|
74
70
|
[[bin]]
|
|
75
71
|
name="sv"
|
|
@@ -107,10 +103,6 @@ path="src/readHDF5.rs"
|
|
|
107
103
|
name="validateHDF5"
|
|
108
104
|
path="src/validateHDF5.rs"
|
|
109
105
|
|
|
110
|
-
[[bin]]
|
|
111
|
-
name="gdcGRIN2"
|
|
112
|
-
path="src/gdcGRIN2.rs"
|
|
113
|
-
|
|
114
106
|
[[bin]]
|
|
115
107
|
name="cerno"
|
|
116
108
|
path="src/cerno.rs"
|
package/package.json
CHANGED
package/src/gdcmaf.rs
CHANGED
|
@@ -201,46 +201,24 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|
|
201
201
|
)) as Box<dyn std::error::Error>);
|
|
202
202
|
};
|
|
203
203
|
|
|
204
|
-
let client = reqwest::Client::builder()
|
|
205
|
-
.timeout(Duration::from_secs(30)) // 30-second timeout per request
|
|
206
|
-
.connect_timeout(Duration::from_secs(15))
|
|
207
|
-
.pool_max_idle_per_host(0) // avoid "connection closed before message completed" race
|
|
208
|
-
.build()
|
|
209
|
-
.map_err(|e| {
|
|
210
|
-
let client_error = ErrorEntry {
|
|
211
|
-
url: String::new(),
|
|
212
|
-
error: format!("Client build error: {}", e),
|
|
213
|
-
};
|
|
214
|
-
let client_error_js = serde_json::to_string(&client_error)
|
|
215
|
-
.unwrap_or_else(|_| "{\"url\":\"\",\"error\":\"Failed to serialize client build error\"}".to_string());
|
|
216
|
-
writeln!(io::stderr(), "{}", client_error_js).expect("Failed to write client build error to stderr");
|
|
217
|
-
e
|
|
218
|
-
})?;
|
|
219
|
-
|
|
220
204
|
//downloading maf files parallelly and merge them into single maf file
|
|
221
205
|
let download_futures = futures::stream::iter(url.into_iter().map(|url| {
|
|
222
|
-
let
|
|
223
|
-
let req_headers = req_headers.clone();
|
|
206
|
+
let req_headers_clone = req_headers.clone();
|
|
224
207
|
async move {
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
}
|
|
240
|
-
Err(e) => break Err(e),
|
|
241
|
-
}
|
|
242
|
-
};
|
|
243
|
-
match send_result {
|
|
208
|
+
let client = reqwest::Client::builder()
|
|
209
|
+
.timeout(Duration::from_secs(60)) // 60-second timeout per request
|
|
210
|
+
.connect_timeout(Duration::from_secs(15))
|
|
211
|
+
.default_headers(req_headers_clone.clone())
|
|
212
|
+
.build()
|
|
213
|
+
.map_err(|_e| {
|
|
214
|
+
let client_error = ErrorEntry {
|
|
215
|
+
url: url.clone(),
|
|
216
|
+
error: "Client build error".to_string(),
|
|
217
|
+
};
|
|
218
|
+
let client_error_js = serde_json::to_string(&client_error).unwrap();
|
|
219
|
+
writeln!(io::stderr(), "{}", client_error_js).expect("Failed to build reqwest client!");
|
|
220
|
+
});
|
|
221
|
+
match client.unwrap().get(&url).send().await {
|
|
244
222
|
Ok(resp) if resp.status().is_success() => match resp.bytes().await {
|
|
245
223
|
Ok(content) => {
|
|
246
224
|
let mut decoder = GzDecoder::new(&content[..]);
|
|
@@ -262,11 +240,11 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|
|
262
240
|
}
|
|
263
241
|
},
|
|
264
242
|
Ok(resp) => {
|
|
265
|
-
let error_msg = format!("HTTP error: {
|
|
243
|
+
let error_msg = format!("HTTP error: {}", resp.status());
|
|
266
244
|
Err((url.clone(), error_msg))
|
|
267
245
|
}
|
|
268
246
|
Err(e) => {
|
|
269
|
-
let error_msg = format!("Server request failed: {
|
|
247
|
+
let error_msg = format!("Server request failed: {}", e);
|
|
270
248
|
Err((url.clone(), error_msg))
|
|
271
249
|
}
|
|
272
250
|
}
|
|
@@ -286,7 +264,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|
|
286
264
|
}
|
|
287
265
|
|
|
288
266
|
download_futures
|
|
289
|
-
.buffer_unordered(
|
|
267
|
+
.buffer_unordered(20)
|
|
290
268
|
.for_each(|result| {
|
|
291
269
|
let encoder = Arc::clone(&encoder); // Clone the Arc for each task
|
|
292
270
|
let maf_col_cp = maf_col.clone();
|