@sjcrh/proteinpaint-rust 2.116.0 → 2.119.0-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 +2 -1
- package/package.json +2 -2
- package/src/DEanalysis.rs +51 -44
- package/src/readHDF5.rs +809 -240
- package/src/topGeneByExpressionVariance.rs +144 -144
|
@@ -64,15 +64,15 @@ fn input_data_hdf5(
|
|
|
64
64
|
let file = match File::open(filename) {
|
|
65
65
|
Ok(f) => f,
|
|
66
66
|
Err(err) => {
|
|
67
|
-
eprintln!("Failed to open HDF5 file: {}", err);
|
|
68
|
-
println!(
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
);
|
|
67
|
+
// eprintln!("Failed to open HDF5 file: {}", err);
|
|
68
|
+
// println!(
|
|
69
|
+
// "{}",
|
|
70
|
+
// serde_json::json!({
|
|
71
|
+
// "status": "error",
|
|
72
|
+
// "message": format!("Failed to open HDF5 file: {}", err),
|
|
73
|
+
// "file_path": filename
|
|
74
|
+
// })
|
|
75
|
+
// );
|
|
76
76
|
return Err(hdf5::Error::Internal(format!(
|
|
77
77
|
"Failed to open HDF5 file: {}",
|
|
78
78
|
err
|
|
@@ -81,20 +81,20 @@ fn input_data_hdf5(
|
|
|
81
81
|
};
|
|
82
82
|
|
|
83
83
|
// Read gene symbols dataset
|
|
84
|
-
let genes_dataset = match file.dataset("
|
|
84
|
+
let genes_dataset = match file.dataset("gene_names") {
|
|
85
85
|
Ok(ds) => ds,
|
|
86
86
|
Err(err) => {
|
|
87
|
-
eprintln!("Failed to open
|
|
88
|
-
println!(
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
);
|
|
87
|
+
// eprintln!("Failed to open gene_names dataset: {}", err);
|
|
88
|
+
// println!(
|
|
89
|
+
// "{}",
|
|
90
|
+
// serde_json::json!({
|
|
91
|
+
// "status": "error",
|
|
92
|
+
// "message": format!("Failed to open gene_names dataset: {}", err),
|
|
93
|
+
// "file_path": filename
|
|
94
|
+
// })
|
|
95
|
+
// );
|
|
96
96
|
return Err(hdf5::Error::Internal(format!(
|
|
97
|
-
"Failed to open
|
|
97
|
+
"Failed to open gene_names dataset: {}",
|
|
98
98
|
err
|
|
99
99
|
)));
|
|
100
100
|
}
|
|
@@ -104,15 +104,15 @@ fn input_data_hdf5(
|
|
|
104
104
|
let genes_varlen = match genes_dataset.read_1d::<VarLenAscii>() {
|
|
105
105
|
Ok(g) => g,
|
|
106
106
|
Err(err) => {
|
|
107
|
-
eprintln!("Failed to read gene symbols: {}", err);
|
|
108
|
-
println!(
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
);
|
|
107
|
+
// eprintln!("Failed to read gene symbols: {}", err);
|
|
108
|
+
// println!(
|
|
109
|
+
// "{}",
|
|
110
|
+
// serde_json::json!({
|
|
111
|
+
// "status": "error",
|
|
112
|
+
// "message": format!("Failed to read gene symbols: {}", err),
|
|
113
|
+
// "file_path": filename
|
|
114
|
+
// })
|
|
115
|
+
// );
|
|
116
116
|
return Err(hdf5::Error::Internal(format!(
|
|
117
117
|
"Failed to read gene symbols: {}",
|
|
118
118
|
err
|
|
@@ -121,15 +121,15 @@ fn input_data_hdf5(
|
|
|
121
121
|
};
|
|
122
122
|
|
|
123
123
|
// Convert to Vec<String> for easier handling
|
|
124
|
-
let
|
|
125
|
-
let num_genes =
|
|
124
|
+
let gene_names: Vec<String> = genes_varlen.iter().map(|g| g.to_string()).collect();
|
|
125
|
+
let num_genes = gene_names.len();
|
|
126
126
|
// eprintln!("Found {} gene symbols", num_genes);
|
|
127
127
|
|
|
128
128
|
// Read sample names
|
|
129
129
|
let samples_dataset = match file.dataset("samples") {
|
|
130
130
|
Ok(ds) => ds,
|
|
131
131
|
Err(err) => {
|
|
132
|
-
eprintln!("Failed to open samples dataset: {}", err);
|
|
132
|
+
// eprintln!("Failed to open samples dataset: {}", err);
|
|
133
133
|
println!(
|
|
134
134
|
"{}",
|
|
135
135
|
serde_json::json!({
|
|
@@ -149,7 +149,7 @@ fn input_data_hdf5(
|
|
|
149
149
|
let samples_varlen = match samples_dataset.read_1d::<VarLenAscii>() {
|
|
150
150
|
Ok(s) => s,
|
|
151
151
|
Err(err) => {
|
|
152
|
-
eprintln!("Failed to read sample names: {}", err);
|
|
152
|
+
// eprintln!("Failed to read sample names: {}", err);
|
|
153
153
|
println!(
|
|
154
154
|
"{}",
|
|
155
155
|
serde_json::json!({
|
|
@@ -175,16 +175,16 @@ fn input_data_hdf5(
|
|
|
175
175
|
if let Some(index) = all_samples.iter().position(|s| s == sample) {
|
|
176
176
|
column_indices.push(index);
|
|
177
177
|
} else {
|
|
178
|
-
eprintln!("Sample {} not found in the dataset", sample);
|
|
179
|
-
println!(
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
);
|
|
178
|
+
// eprintln!("Sample {} not found in the dataset", sample);
|
|
179
|
+
// println!(
|
|
180
|
+
// "{}",
|
|
181
|
+
// serde_json::json!({
|
|
182
|
+
// "status": "error",
|
|
183
|
+
// "message": format!("Sample '{}' not found in the dataset", sample),
|
|
184
|
+
// "file_path": filename,
|
|
185
|
+
// "available_samples": all_samples
|
|
186
|
+
// })
|
|
187
|
+
// );
|
|
188
188
|
return Err(hdf5::Error::Internal(format!(
|
|
189
189
|
"Sample '{}' not found in the dataset",
|
|
190
190
|
sample
|
|
@@ -196,15 +196,15 @@ fn input_data_hdf5(
|
|
|
196
196
|
let counts_dataset = match file.dataset("counts") {
|
|
197
197
|
Ok(ds) => ds,
|
|
198
198
|
Err(err) => {
|
|
199
|
-
eprintln!("Failed to open counts dataset: {}", err);
|
|
200
|
-
println!(
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
);
|
|
199
|
+
// eprintln!("Failed to open counts dataset: {}", err);
|
|
200
|
+
// println!(
|
|
201
|
+
// "{}",
|
|
202
|
+
// serde_json::json!({
|
|
203
|
+
// "status": "error",
|
|
204
|
+
// "message": format!("Failed to open counts dataset: {}", err),
|
|
205
|
+
// "file_path": filename
|
|
206
|
+
// })
|
|
207
|
+
// );
|
|
208
208
|
return Err(hdf5::Error::Internal(format!(
|
|
209
209
|
"Failed to open counts dataset: {}",
|
|
210
210
|
err
|
|
@@ -215,16 +215,16 @@ fn input_data_hdf5(
|
|
|
215
215
|
// Get dataset dimensions for validation
|
|
216
216
|
let dataset_shape = counts_dataset.shape();
|
|
217
217
|
if dataset_shape.len() != 2 {
|
|
218
|
-
eprintln!("Counts dataset does not have the expected 2D shape");
|
|
219
|
-
println!(
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
);
|
|
218
|
+
// eprintln!("Counts dataset does not have the expected 2D shape");
|
|
219
|
+
// println!(
|
|
220
|
+
// "{}",
|
|
221
|
+
// serde_json::json!({
|
|
222
|
+
// "status": "error",
|
|
223
|
+
// "message": "Expected a 2D dataset for counts",
|
|
224
|
+
// "file_path": filename,
|
|
225
|
+
// "actual_shape": dataset_shape
|
|
226
|
+
// })
|
|
227
|
+
// );
|
|
228
228
|
return Err(hdf5::Error::Internal(
|
|
229
229
|
"Expected a 2D dataset for counts".to_string(),
|
|
230
230
|
));
|
|
@@ -232,19 +232,19 @@ fn input_data_hdf5(
|
|
|
232
232
|
|
|
233
233
|
// Check dimensions match expected values
|
|
234
234
|
if dataset_shape[0] != num_genes {
|
|
235
|
-
eprintln!(
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
);
|
|
239
|
-
println!(
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
);
|
|
235
|
+
// eprintln!(
|
|
236
|
+
// "Counts dataset first dimension ({}) doesn't match number of genes ({})",
|
|
237
|
+
// dataset_shape[0], num_genes
|
|
238
|
+
// );
|
|
239
|
+
// println!(
|
|
240
|
+
// "{}",
|
|
241
|
+
// serde_json::json!({
|
|
242
|
+
// "status": "error",
|
|
243
|
+
// "message": format!("Counts dataset first dimension ({}) doesn't match number of genes ({})",
|
|
244
|
+
// dataset_shape[0], num_genes),
|
|
245
|
+
// "file_path": filename
|
|
246
|
+
// })
|
|
247
|
+
// );
|
|
248
248
|
return Err(hdf5::Error::Internal(format!(
|
|
249
249
|
"Counts dataset first dimension ({}) doesn't match number of genes ({})",
|
|
250
250
|
dataset_shape[0], num_genes
|
|
@@ -252,20 +252,20 @@ fn input_data_hdf5(
|
|
|
252
252
|
}
|
|
253
253
|
|
|
254
254
|
if dataset_shape[1] != all_samples.len() {
|
|
255
|
-
eprintln!(
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
);
|
|
260
|
-
println!(
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
);
|
|
255
|
+
// eprintln!(
|
|
256
|
+
// "Counts dataset second dimension ({}) doesn't match number of samples ({})",
|
|
257
|
+
// dataset_shape[1],
|
|
258
|
+
// all_samples.len()
|
|
259
|
+
// );
|
|
260
|
+
// println!(
|
|
261
|
+
// "{}",
|
|
262
|
+
// serde_json::json!({
|
|
263
|
+
// "status": "error",
|
|
264
|
+
// "message": format!("Counts dataset second dimension ({}) doesn't match number of samples ({})",
|
|
265
|
+
// dataset_shape[1], all_samples.len()),
|
|
266
|
+
// "file_path": filename
|
|
267
|
+
// })
|
|
268
|
+
// );
|
|
269
269
|
return Err(hdf5::Error::Internal(format!(
|
|
270
270
|
"Counts dataset second dimension ({}) doesn't match number of samples ({})",
|
|
271
271
|
dataset_shape[1],
|
|
@@ -277,15 +277,15 @@ fn input_data_hdf5(
|
|
|
277
277
|
let all_counts = match counts_dataset.read::<f64, Dim<[usize; 2]>>() {
|
|
278
278
|
Ok(data) => data,
|
|
279
279
|
Err(err) => {
|
|
280
|
-
eprintln!("Failed to read expression data: {}", err);
|
|
281
|
-
println!(
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
);
|
|
280
|
+
// eprintln!("Failed to read expression data: {}", err);
|
|
281
|
+
// println!(
|
|
282
|
+
// "{}",
|
|
283
|
+
// serde_json::json!({
|
|
284
|
+
// "status": "error",
|
|
285
|
+
// "message": format!("Failed to read expression data: {}", err),
|
|
286
|
+
// "file_path": filename
|
|
287
|
+
// })
|
|
288
|
+
// );
|
|
289
289
|
return Err(hdf5::Error::Internal(format!(
|
|
290
290
|
"Failed to read expression data: {}",
|
|
291
291
|
err
|
|
@@ -316,7 +316,7 @@ fn input_data_hdf5(
|
|
|
316
316
|
// dm.ncols()
|
|
317
317
|
// );
|
|
318
318
|
|
|
319
|
-
Ok((dm,
|
|
319
|
+
Ok((dm, gene_names))
|
|
320
320
|
}
|
|
321
321
|
|
|
322
322
|
// The original input_data function for text files is kept as is
|
|
@@ -330,7 +330,7 @@ fn input_data(
|
|
|
330
330
|
// Build the CSV reader and iterate over each record.
|
|
331
331
|
let mut reader = BGZFReader::new(fs::File::open(filename).unwrap()).unwrap();
|
|
332
332
|
let mut num_lines: usize = 0;
|
|
333
|
-
let mut
|
|
333
|
+
let mut gene_names: Vec<String> = Vec::with_capacity(500);
|
|
334
334
|
|
|
335
335
|
let mut buffer = String::new();
|
|
336
336
|
reader.read_to_string(&mut buffer).unwrap();
|
|
@@ -358,7 +358,7 @@ fn input_data(
|
|
|
358
358
|
} else {
|
|
359
359
|
num_lines += 1;
|
|
360
360
|
//println!("line2:{:?}", line2);
|
|
361
|
-
|
|
361
|
+
gene_names.push(line2[3].to_string());
|
|
362
362
|
for i in &column_numbers {
|
|
363
363
|
let field = line2[*i];
|
|
364
364
|
let num = FromStr::from_str(field);
|
|
@@ -386,7 +386,7 @@ fn input_data(
|
|
|
386
386
|
|
|
387
387
|
let dm = DMatrix::from_row_slice(num_lines, sample_list.len(), &input_vector);
|
|
388
388
|
//println!("dm:{:?}", dm);
|
|
389
|
-
(dm,
|
|
389
|
+
(dm, gene_names)
|
|
390
390
|
}
|
|
391
391
|
|
|
392
392
|
#[allow(dead_code)]
|
|
@@ -398,7 +398,7 @@ struct GeneInfo {
|
|
|
398
398
|
|
|
399
399
|
fn calculate_variance(
|
|
400
400
|
input_matrix: Matrix<f64, Dyn, Dyn, VecStorage<f64, Dyn, Dyn>>,
|
|
401
|
-
|
|
401
|
+
gene_names: Vec<String>,
|
|
402
402
|
mut min_sample_size: f64,
|
|
403
403
|
filter_extreme_values: bool,
|
|
404
404
|
rank_type: String,
|
|
@@ -478,12 +478,12 @@ fn calculate_variance(
|
|
|
478
478
|
{
|
|
479
479
|
gene_infos.push(GeneInfo {
|
|
480
480
|
rank_type: gene_counts.variance(),
|
|
481
|
-
gene_symbol:
|
|
481
|
+
gene_symbol: gene_names[row].clone(),
|
|
482
482
|
});
|
|
483
483
|
} else if filter_extreme_values == false {
|
|
484
484
|
gene_infos.push(GeneInfo {
|
|
485
485
|
rank_type: gene_counts.variance(),
|
|
486
|
-
gene_symbol:
|
|
486
|
+
gene_symbol: gene_names[row].clone(),
|
|
487
487
|
});
|
|
488
488
|
}
|
|
489
489
|
} else {
|
|
@@ -496,12 +496,12 @@ fn calculate_variance(
|
|
|
496
496
|
{
|
|
497
497
|
gene_infos.push(GeneInfo {
|
|
498
498
|
rank_type: gene_counts_data.interquartile_range(),
|
|
499
|
-
gene_symbol:
|
|
499
|
+
gene_symbol: gene_names[row].clone(),
|
|
500
500
|
});
|
|
501
501
|
} else if filter_extreme_values == false {
|
|
502
502
|
gene_infos.push(GeneInfo {
|
|
503
503
|
rank_type: gene_counts_data.interquartile_range(),
|
|
504
|
-
gene_symbol:
|
|
504
|
+
gene_symbol: gene_names[row].clone(),
|
|
505
505
|
});
|
|
506
506
|
}
|
|
507
507
|
}
|
|
@@ -536,28 +536,28 @@ fn cpm(
|
|
|
536
536
|
}
|
|
537
537
|
|
|
538
538
|
fn main() {
|
|
539
|
-
//
|
|
539
|
+
// println!("Starting gene variance calculation...");
|
|
540
540
|
let mut input = String::new();
|
|
541
541
|
match io::stdin().read_line(&mut input) {
|
|
542
542
|
// Accepting the piped input from nodejs (or command line from testing)
|
|
543
543
|
Ok(_bytes_read) => {
|
|
544
|
-
// eprintln!("Read {} bytes from stdin",
|
|
545
|
-
//println!("{} bytes read", bytes_read);
|
|
546
|
-
//println!("{}", input);
|
|
544
|
+
// eprintln!("Read {} bytes from stdin", bytes_read);
|
|
545
|
+
// println!("{} bytes read", bytes_read);
|
|
546
|
+
// println!("{}", input);
|
|
547
547
|
let input_json = json::parse(&input);
|
|
548
548
|
match input_json {
|
|
549
549
|
Ok(json_string) => {
|
|
550
|
-
//
|
|
550
|
+
// println!("Successfully parsed JSON input");
|
|
551
551
|
// let now = Instant::now();
|
|
552
552
|
let samples_string_result = &json_string["samples"].to_owned();
|
|
553
553
|
let samples_string;
|
|
554
554
|
match samples_string_result.as_str() {
|
|
555
555
|
Some(x) => {
|
|
556
556
|
samples_string = x.to_string();
|
|
557
|
-
//
|
|
557
|
+
// println!("Samples: {}", samples_string);
|
|
558
558
|
}
|
|
559
559
|
None => {
|
|
560
|
-
eprintln!("ERROR: Samples not provided in JSON");
|
|
560
|
+
// eprintln!("ERROR: Samples not provided in JSON");
|
|
561
561
|
println!(
|
|
562
562
|
"{}",
|
|
563
563
|
serde_json::json!({
|
|
@@ -583,14 +583,14 @@ fn main() {
|
|
|
583
583
|
// );
|
|
584
584
|
}
|
|
585
585
|
None => {
|
|
586
|
-
eprintln!("ERROR: File name missing in JSON");
|
|
587
|
-
println!(
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
);
|
|
586
|
+
// eprintln!("ERROR: File name missing in JSON");
|
|
587
|
+
// println!(
|
|
588
|
+
// "{}",
|
|
589
|
+
// serde_json::json!({
|
|
590
|
+
// "status": "error",
|
|
591
|
+
// "message": "File name is missing"
|
|
592
|
+
// })
|
|
593
|
+
// );
|
|
594
594
|
return;
|
|
595
595
|
}
|
|
596
596
|
}
|
|
@@ -613,14 +613,14 @@ fn main() {
|
|
|
613
613
|
// eprintln!("Rank type: {}", rank_type);
|
|
614
614
|
if rank_type != "var" && rank_type != "iqr" {
|
|
615
615
|
// Check if any unknown method has been provided
|
|
616
|
-
eprintln!("ERROR: Unknown rank method: {}", rank_type);
|
|
617
|
-
println!(
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
);
|
|
616
|
+
// eprintln!("ERROR: Unknown rank method: {}", rank_type);
|
|
617
|
+
// println!(
|
|
618
|
+
// "{}",
|
|
619
|
+
// serde_json::json!({
|
|
620
|
+
// "status": "error",
|
|
621
|
+
// "message": format!("Unknown rank method: {}. Must be 'var' or 'iqr'", rank_type)
|
|
622
|
+
// })
|
|
623
|
+
// );
|
|
624
624
|
return;
|
|
625
625
|
}
|
|
626
626
|
let filter_extreme_values_result = &json_string["filter_extreme_values"];
|
|
@@ -629,7 +629,7 @@ fn main() {
|
|
|
629
629
|
match filter_extreme_values_result.as_bool() {
|
|
630
630
|
Some(x) => {
|
|
631
631
|
filter_extreme_values = x;
|
|
632
|
-
eprintln!("Filter extreme values: {}", filter_extreme_values);
|
|
632
|
+
// eprintln!("Filter extreme values: {}", filter_extreme_values);
|
|
633
633
|
}
|
|
634
634
|
None => {
|
|
635
635
|
filter_extreme_values = true; // If filter_extreme_values field is missing, set it to true by default
|
|
@@ -648,7 +648,7 @@ fn main() {
|
|
|
648
648
|
// eprintln!("Number of genes requested: {}", num_genes);
|
|
649
649
|
}
|
|
650
650
|
None => {
|
|
651
|
-
eprintln!("ERROR: Number of genes to be given is missing");
|
|
651
|
+
// eprintln!("ERROR: Number of genes to be given is missing");
|
|
652
652
|
println!(
|
|
653
653
|
"{}",
|
|
654
654
|
serde_json::json!({
|
|
@@ -668,7 +668,7 @@ fn main() {
|
|
|
668
668
|
// eprintln!("Min count: {}", x);
|
|
669
669
|
}
|
|
670
670
|
None => {
|
|
671
|
-
eprintln!("Min count not specified, will use default");
|
|
671
|
+
// eprintln!("Min count not specified, will use default");
|
|
672
672
|
}
|
|
673
673
|
}
|
|
674
674
|
|
|
@@ -680,7 +680,7 @@ fn main() {
|
|
|
680
680
|
// eprintln!("Min total count: {}", x);
|
|
681
681
|
}
|
|
682
682
|
None => {
|
|
683
|
-
eprintln!("Min total count not specified, will use default");
|
|
683
|
+
// eprintln!("Min total count not specified, will use default");
|
|
684
684
|
}
|
|
685
685
|
}
|
|
686
686
|
|
|
@@ -689,7 +689,7 @@ fn main() {
|
|
|
689
689
|
|
|
690
690
|
// Choose the appropriate input function based on file type
|
|
691
691
|
// eprintln!("Reading data from {} file: {}", file_type, file_name);
|
|
692
|
-
let (input_matrix,
|
|
692
|
+
let (input_matrix, gene_names) = if file_type == "hdf5" {
|
|
693
693
|
// eprintln!("Using HDF5 reader function...");
|
|
694
694
|
match input_data_hdf5(&file_name, &samples_list) {
|
|
695
695
|
Ok(result) => {
|
|
@@ -731,11 +731,11 @@ fn main() {
|
|
|
731
731
|
// input_matrix.nrows(),
|
|
732
732
|
// input_matrix.ncols()
|
|
733
733
|
// );
|
|
734
|
-
// eprintln!("Number of gene symbols: {}",
|
|
735
|
-
if !
|
|
734
|
+
// eprintln!("Number of gene symbols: {}", gene_names.len());
|
|
735
|
+
if !gene_names.is_empty() {
|
|
736
736
|
// eprintln!(
|
|
737
737
|
// "First few gene symbols: {:?}",
|
|
738
|
-
// &
|
|
738
|
+
// &gene_names.iter().take(5).collect::<Vec<_>>()
|
|
739
739
|
// );
|
|
740
740
|
}
|
|
741
741
|
|
|
@@ -749,7 +749,7 @@ fn main() {
|
|
|
749
749
|
let gene_infos = match std::panic::catch_unwind(|| {
|
|
750
750
|
calculate_variance(
|
|
751
751
|
input_matrix,
|
|
752
|
-
|
|
752
|
+
gene_names,
|
|
753
753
|
samples_list.len() as f64,
|
|
754
754
|
filter_extreme_values,
|
|
755
755
|
rank_type.to_string(),
|
|
@@ -780,11 +780,11 @@ fn main() {
|
|
|
780
780
|
|
|
781
781
|
// Check if we have enough genes for the requested output
|
|
782
782
|
if gene_infos.len() < num_genes {
|
|
783
|
-
eprintln!(
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
);
|
|
783
|
+
// eprintln!(
|
|
784
|
+
// "WARNING: Only {} genes found, but {} were requested",
|
|
785
|
+
// gene_infos.len(),
|
|
786
|
+
// num_genes
|
|
787
|
+
// );
|
|
788
788
|
}
|
|
789
789
|
|
|
790
790
|
let actual_num_genes = std::cmp::min(num_genes, gene_infos.len());
|