@sjcrh/proteinpaint-rust 2.119.0-0 → 2.120.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/package.json +2 -2
- package/src/DEanalysis.rs +9 -16
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "2.
|
|
2
|
+
"version": "2.120.0",
|
|
3
3
|
"name": "@sjcrh/proteinpaint-rust",
|
|
4
4
|
"description": "Rust-based utilities for proteinpaint",
|
|
5
5
|
"main": "index.js",
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"tape": "^5.2.2"
|
|
40
40
|
},
|
|
41
|
-
"pp_release_tag": "v2.
|
|
41
|
+
"pp_release_tag": "v2.120.0"
|
|
42
42
|
}
|
package/src/DEanalysis.rs
CHANGED
|
@@ -497,8 +497,8 @@ fn input_data_from_text(
|
|
|
497
497
|
#[derive(Debug, Serialize, Deserialize)]
|
|
498
498
|
struct AdjustedPValueIndexes {
|
|
499
499
|
index: usize,
|
|
500
|
+
gene_id: String,
|
|
500
501
|
gene_name: String,
|
|
501
|
-
gene_symbol: String,
|
|
502
502
|
fold_change: f64,
|
|
503
503
|
original_p_value: f64,
|
|
504
504
|
adjusted_p_value: f64,
|
|
@@ -506,8 +506,8 @@ struct AdjustedPValueIndexes {
|
|
|
506
506
|
|
|
507
507
|
struct PValueIndexes {
|
|
508
508
|
index: usize,
|
|
509
|
+
gene_id: String,
|
|
509
510
|
gene_name: String,
|
|
510
|
-
gene_symbol: String,
|
|
511
511
|
fold_change: f64,
|
|
512
512
|
p_value: f64,
|
|
513
513
|
}
|
|
@@ -664,14 +664,6 @@ fn main() {
|
|
|
664
664
|
//println!("filtering time:{:?}", filtering_time.elapsed());
|
|
665
665
|
//println!("filtered_matrix_rows:{:?}", filtered_matrix.nrows());
|
|
666
666
|
//println!("filtered_matrix_cols:{:?}", filtered_matrix.ncols());
|
|
667
|
-
if filtered_matrix.nrows() == 0 {
|
|
668
|
-
// Its possible after filtering there might not be any genes left in the matrix, in such a case the rust code must exit gracefully with an error.
|
|
669
|
-
panic!("Number of genes after filtering = 0, cannot proceed any further")
|
|
670
|
-
}
|
|
671
|
-
if filtered_matrix.ncols() == 0 {
|
|
672
|
-
// Its possible after filtering there might not be any samples left in the matrix, in such a case the rust code must exit gracefully with an error.
|
|
673
|
-
panic!("Number of samples after filtering = 0, cannot proceed any further")
|
|
674
|
-
}
|
|
675
667
|
//let cpm_normalization_time = Instant::now();
|
|
676
668
|
let mut normalized_matrix = cpm(&filtered_matrix);
|
|
677
669
|
//println!(
|
|
@@ -754,8 +746,8 @@ fn main() {
|
|
|
754
746
|
{
|
|
755
747
|
p_values.push(PValueIndexes {
|
|
756
748
|
index: i,
|
|
757
|
-
|
|
758
|
-
|
|
749
|
+
gene_id: filtered_genes[i].to_owned(),
|
|
750
|
+
gene_name: filtered_gene_names[i].to_owned(),
|
|
759
751
|
fold_change: (treated_mean.unwrap()
|
|
760
752
|
/ control_mean.unwrap())
|
|
761
753
|
.log2(),
|
|
@@ -841,9 +833,9 @@ fn main() {
|
|
|
841
833
|
{
|
|
842
834
|
p_values_thread.push(PValueIndexes {
|
|
843
835
|
index: i,
|
|
844
|
-
|
|
836
|
+
gene_id: filtered_genes_temp[i]
|
|
845
837
|
.to_owned(),
|
|
846
|
-
|
|
838
|
+
gene_name: filtered_gene_names_temp
|
|
847
839
|
[i]
|
|
848
840
|
.to_owned(),
|
|
849
841
|
fold_change: (treated_mean.unwrap()
|
|
@@ -927,8 +919,8 @@ fn adjust_p_values(mut original_p_values: Vec<PValueIndexes>) -> String {
|
|
|
927
919
|
adjusted_p_values.push(AdjustedPValueIndexes {
|
|
928
920
|
index: original_p_values[i].index,
|
|
929
921
|
fold_change: original_p_values[i].fold_change,
|
|
922
|
+
gene_id: original_p_values[i].gene_id.to_owned(),
|
|
930
923
|
gene_name: original_p_values[i].gene_name.to_owned(),
|
|
931
|
-
gene_symbol: original_p_values[i].gene_symbol.to_owned(),
|
|
932
924
|
original_p_value: original_p_values[i].p_value,
|
|
933
925
|
adjusted_p_value: adjusted_p_val,
|
|
934
926
|
});
|
|
@@ -959,8 +951,8 @@ fn adjust_p_values_bonferroni(original_p_values: Vec<PValueIndexes>) -> Vec<Adju
|
|
|
959
951
|
}
|
|
960
952
|
adjusted_p_values.push(AdjustedPValueIndexes {
|
|
961
953
|
index: original_p_values[i].index,
|
|
954
|
+
gene_id: original_p_values[i].gene_id.to_owned(),
|
|
962
955
|
gene_name: original_p_values[i].gene_name.to_owned(),
|
|
963
|
-
gene_symbol: original_p_values[i].gene_symbol.to_owned(),
|
|
964
956
|
fold_change: original_p_values[i].fold_change,
|
|
965
957
|
original_p_value: original_p_values[i].p_value,
|
|
966
958
|
adjusted_p_value: adjusted_p_value,
|
|
@@ -1222,6 +1214,7 @@ fn calc_factor_quantile(
|
|
|
1222
1214
|
for i in 0..input_matrix.nrows() {
|
|
1223
1215
|
row_vec.push(input_matrix[(i, j)] as f64);
|
|
1224
1216
|
}
|
|
1217
|
+
//println!("row_vec:{:?}", row_vec);
|
|
1225
1218
|
let quan = calc_quantile(row_vec, P);
|
|
1226
1219
|
//println!("quan:{}", quan);
|
|
1227
1220
|
let num = quan / lib_sizes[j];
|