@sjcrh/proteinpaint-server 2.108.0 → 2.109.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.
@@ -69,7 +69,7 @@ to parse line as gene file, require following:
69
69
 
70
70
  */
71
71
 
72
- import checkReadingFrame from './checkReadingFrame'
72
+ import checkReadingFrame from './checkReadingFrame.js'
73
73
 
74
74
  //a valid exonFrames field can only contain members of validFrames, names -1, 0, 1, or 2
75
75
  const validFrames = new Set(['-1', '0', '1', '2'])
package/src/run_R.js CHANGED
@@ -11,7 +11,7 @@ Standard output of the R script is returned.
11
11
  */
12
12
 
13
13
  import fs from 'fs'
14
- import serverconfig from './serverconfig'
14
+ import serverconfig from './serverconfig.js'
15
15
  import { spawn } from 'child_process'
16
16
  import { Readable } from 'stream'
17
17
 
package/utils/edge.R CHANGED
@@ -30,13 +30,6 @@ filter_genes_by_global_variance <- function(read_counts, gene_id_symbols, num_va
30
30
  return(list(read_counts = read_counts, gene_id_symbols = gene_id_symbols))
31
31
  }
32
32
 
33
- # Will implement this later
34
- filter_genes_by_group_variance <- function(read_counts, gene_id_symbols, num_variable_genes, cases, controls) {
35
- # Divide the read counts into two groups
36
- case_read_counts <- read_counts[, cases]
37
- control_read_counts <- read_counts[, controls]
38
- }
39
-
40
33
  # Read JSON input from stdin
41
34
  read_json_time <- system.time({
42
35
  con <- file("stdin", "r")
@@ -146,15 +139,29 @@ if (length(input$conf1) == 0) { # No adjustment of confounding factors
146
139
  # Check the type of confounding variable
147
140
  if (input$conf1_mode == "continuous") { # If this is float, the input conf1 vector should be converted into a numeric vector
148
141
  conf1 <- as.numeric(input$conf1)
149
- } else { # When input$conf1_mode == "discrete" keep the vector as string. PLEASE ASK WHAT OTHER POSSIBLE TERM TYPES ARE POSSIBLE
142
+ } else { # When input$conf1_mode == "discrete" keep the vector as string.
150
143
  conf1 <- as.factor(input$conf1)
151
144
  }
152
145
 
153
- y$samples <- data.frame(conditions = conditions, conf1 = conf1)
154
- model_gen_time <- system.time({
155
- design <- model.matrix(~ conditions + conf1, data = y$samples)
156
- })
157
- #cat("Time for making design matrix: ", model_gen_time[3], " seconds\n")
146
+ if (length(input$conf2) == 0) { # No adjustment of confounding factor 2
147
+ y$samples <- data.frame(conditions = conditions, conf1 = conf1)
148
+ model_gen_time <- system.time({
149
+ design <- model.matrix(~ conditions + conf1, data = y$samples)
150
+ })
151
+ #cat("Time for making design matrix: ", model_gen_time[3], " seconds\n")
152
+ } else {
153
+ # Check the type of confounding variable 2
154
+ if (input$conf2_mode == "continuous") { # If this is float, the input conf2 vector should be converted into a numeric vector
155
+ conf2 <- as.numeric(input$conf2)
156
+ } else { # When input$conf2_mode == "discrete" keep the vector as string.
157
+ conf2 <- as.factor(input$conf2)
158
+ }
159
+ y$samples <- data.frame(conditions = conditions, conf1 = conf1, conf2 = conf2)
160
+ model_gen_time <- system.time({
161
+ design <- model.matrix(~ conditions + conf1 + conf2, data = y$samples)
162
+ })
163
+ #cat("Time for making design matrix: ", model_gen_time[3], " seconds\n")
164
+ }
158
165
 
159
166
  dispersion_time <- system.time({
160
167
  y <- estimateDisp(y, design)
@@ -167,7 +174,7 @@ if (length(input$conf1) == 0) { # No adjustment of confounding factors
167
174
  #cat("Fit time: ", fit_time[3], " seconds\n")
168
175
 
169
176
  test_statistics_time <- system.time({
170
- et <- glmLRT(fit, coef = 2)
177
+ et <- glmLRT(fit, coef = "conditionsDiseased")
171
178
  })
172
179
  #cat("Test statistics time: ", test_statistics_time[3], " seconds\n")
173
180
  }
@@ -192,3 +199,11 @@ multiple_testing_correction_time <- system.time({
192
199
 
193
200
  # Output results
194
201
  toJSON(output)
202
+
203
+ #-----------------------------------#
204
+ # Will implement this later
205
+ filter_genes_by_group_variance <- function(read_counts, gene_id_symbols, num_variable_genes, cases, controls) {
206
+ # Divide the read counts into two groups
207
+ case_read_counts <- read_counts[, cases]
208
+ control_read_counts <- read_counts[, controls]
209
+ }
package/utils/hwe.R DELETED
@@ -1,11 +0,0 @@
1
- library('hwde')
2
-
3
- con <- file("stdin","r")
4
- dat <- read.table(con,sep="\t",header=F,quote="")
5
-
6
- for (i in 1:nrow(dat)) {
7
- pvalue <- hwexact( dat[i,1], dat[i,2], dat[i,3] )
8
- cat(pvalue,"\n",sep="")
9
- }
10
-
11
- close(con)