@sjcrh/proteinpaint-server 2.40.2 → 2.40.4
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 +1 -1
- package/routes/hicdata.ts +8 -10
- package/server.js +1 -1
- package/server.js.map +1 -1
package/package.json
CHANGED
package/routes/hicdata.ts
CHANGED
|
@@ -59,15 +59,13 @@ function handle_hicdata(q: HicdataRequest) {
|
|
|
59
59
|
const [e, file, isurl] = fileurl({ query: q })
|
|
60
60
|
if (e) reject({ error: 'illegal file name' })
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
q.resolution
|
|
70
|
-
]
|
|
62
|
+
/*Value passed from client is not the proper straw parameter.
|
|
63
|
+
Must convert to straw parameter and apply the corresponding maths to the result.
|
|
64
|
+
Use 'observed' as default if not provided.
|
|
65
|
+
*/
|
|
66
|
+
const matrixType = q.matrixType == 'log(oe)' ? 'oe' : q.matrixType ? q.matrixType : 'observed'
|
|
67
|
+
|
|
68
|
+
const par = [matrixType, q.nmeth || 'NONE', file, q.pos1, q.pos2, q.isfrag ? 'FRAG' : 'BP', q.resolution]
|
|
71
69
|
|
|
72
70
|
const ps = spawn(serverconfig.hicstraw, par)
|
|
73
71
|
const rl = readline.createInterface({ input: ps.stdout })
|
|
@@ -86,7 +84,7 @@ function handle_hicdata(q: HicdataRequest) {
|
|
|
86
84
|
}
|
|
87
85
|
const n1 = Number.parseInt(l[0])
|
|
88
86
|
const n2 = Number.parseInt(l[1])
|
|
89
|
-
const v = q.matrixType == 'oe' ? Math.log(Number.parseFloat(l[2])) : Number.parseFloat(l[2])
|
|
87
|
+
const v = q.matrixType == 'log(oe)' ? Math.log(Number.parseFloat(l[2])) : Number.parseFloat(l[2])
|
|
90
88
|
if (Number.isNaN(n1) || Number.isNaN(n2) || Number.isNaN(v)) {
|
|
91
89
|
fieldnotnumerical++
|
|
92
90
|
return
|