Browse code

Getting the correct python binaries for py2

Jean-Philippe Fortin authored on 04/10/2023 17:16:59
Showing 3 changed files

... ...
@@ -83,8 +83,13 @@ getAzimuthScores <- function(sequences, fork=FALSE){
83 83
             sequences.valid <- rep(sequences.valid, 2)
84 84
         }
85 85
         .dumpToFile(sequences.valid, inputfile)
86
-        system2("python",
87
-                c(programFile, inputfile, outputfile))
86
+
87
+        pyBinary <- basilisk.utils:::getPythonBinary(env)
88
+
89
+        system2(c(pyBinary,
90
+                  programFile,
91
+                  inputfile,
92
+                  outputfile))
88 93
         scores <- read.table(outputfile)[,1]
89 94
         if (sum(good)==1){
90 95
             scores <- scores[1]
... ...
@@ -179,8 +179,14 @@ getCrispraiScores <- function(tss_df,
179 179
                            "getWeissmanScores.py",
180 180
                            package="crisprScore",
181 181
                            mustWork=TRUE)
182
-    system2("python",
183
-            c(program, rosterFile, modality, outputFile, verbose))
182
+
183
+    pyBinary <- basilisk.utils:::getPythonBinary(env)
184
+    system2(c(pyBinary,
185
+              program,
186
+              rosterFile,
187
+              modality,
188
+              outputFile,
189
+              verbose))
184 190
 
185 191
     scores <- read.table(outputFile)
186 192
     scores <- as.data.frame(scores)
... ...
@@ -89,8 +89,13 @@ getDeepSpCas9Scores <- function(sequences,
89 89
     #              outputfile)
90 90
     if (sum(good)>0){
91 91
         .dumpToFile(sequences.valid, inputfile)
92
-        system2("python",
93
-                c(programFile, inputfile, modelDir, outputfile))
92
+        pyBinary <- basilisk.utils:::getPythonBinary(env)
93
+
94
+        system2(c(pyBinary,
95
+                  programFile,
96
+                  inputfile,
97
+                  modelDir,
98
+                  outputfile))
94 99
         scores <- read.table(outputfile)[,1]
95 100
         #scores <- read.table(outputfile)
96 101
         scores <- scores/100