@sjcrh/proteinpaint-rust 2.34.0 → 2.38.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 +4 -4
- package/package.json +1 -1
- package/src/gdcmaf.rs +15 -3
package/Cargo.toml
CHANGED
|
@@ -26,7 +26,7 @@ serde = {version = "^1.0.147", features = ["derive"]}
|
|
|
26
26
|
serde_json="^1.0.88"
|
|
27
27
|
num = "^0.4.1"
|
|
28
28
|
csv = "^1.2.2"
|
|
29
|
-
|
|
29
|
+
r_mathlib="^0.2.0" # Uncomment this line to activate DE expression app for high sample sizes
|
|
30
30
|
tokio = { version="1", features = ["full"] }
|
|
31
31
|
reqwest = "0.11"
|
|
32
32
|
flate2 = "1"
|
|
@@ -81,6 +81,6 @@ path="src/gene_variance.rs"
|
|
|
81
81
|
#path="src/wilcoxon.rs"
|
|
82
82
|
|
|
83
83
|
# Uncomment the lines below to use DE app for higher sample sizes
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
[[bin]]
|
|
85
|
+
name="DEanalysis"
|
|
86
|
+
path="src/DEanalysis.rs"
|
package/package.json
CHANGED
package/src/gdcmaf.rs
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
This script download cohort maf files from GDC, combine them into a single file, and output the sorted file based on chromsome and Start_Position.
|
|
3
|
+
|
|
4
|
+
Input JSON:
|
|
5
|
+
host: GDC host
|
|
6
|
+
fileIdLst: An array of uuid
|
|
7
|
+
Output gzip compressed maf file to stdout.
|
|
8
|
+
|
|
9
|
+
Example of usage:
|
|
10
|
+
echo '{"host": "https://api.gdc.cancer.gov/data/", "fileIdLst": ["8b31d6d1-56f7-4aa8-b026-c64bafd531e7", "b429fcc1-2b59-4b4c-a472-fb27758f6249"]}'|./target/release/gdcmaf
|
|
11
|
+
*/
|
|
12
|
+
|
|
1
13
|
use flate2::read::GzDecoder;
|
|
2
14
|
use flate2::write::GzEncoder;
|
|
3
15
|
use flate2::Compression;
|
|
@@ -85,14 +97,14 @@ const MAF_COL: [&str;96] = ["Hugo_Symbol", "Entrez_Gene_Id", "Center", "NCBI_Bui
|
|
|
85
97
|
async fn main() -> Result<(),Box<dyn std::error::Error>> {
|
|
86
98
|
// Accepting the piped input json from jodejs and assign to the variable
|
|
87
99
|
// host: GDC host
|
|
88
|
-
// save output into json string
|
|
89
100
|
// url: urls to download single maf files
|
|
90
101
|
let mut buffer = String::new();
|
|
91
102
|
io::stdin().read_line(&mut buffer)?;
|
|
92
103
|
let file_id_lst_js = serde_json::from_str::<Value>(&buffer).expect("Error reading input and serializing to JSON");
|
|
93
|
-
let host =
|
|
104
|
+
let host = file_id_lst_js.get("host").expect("Host was not provided").as_str().expect("Host is not a string");
|
|
94
105
|
let mut url: Vec<String> = Vec::new();
|
|
95
|
-
|
|
106
|
+
let file_id_lst = file_id_lst_js.get("fileIdLst").expect("File ID list is missed!").as_array().expect("File ID list is not an array");
|
|
107
|
+
for v in file_id_lst {
|
|
96
108
|
url.push(Path::new(&host).join(&v.as_str().unwrap()).display().to_string());
|
|
97
109
|
};
|
|
98
110
|
|