+ fixed some index bugs in the weights calculation
[qpalma.git] / python / set_param_palma.py
index 761d7ff..e4befad 100644 (file)
@@ -49,7 +49,7 @@ class Plf: #means piecewise linear function
       ps = QPalmaDP.penalty_struct()
    
       ps.limits = QPalmaDP.createDoubleArrayFromList(self.limits)
-      ps.penalties = QPalmaDP.createDoubleArrayFromList([elem[0] for elem in self.penalties.tolist()])
+      ps.penalties = QPalmaDP.createDoubleArrayFromList(self.penalties)
 
       ps.max_len = self.max_len
       ps.min_len = self.min_len
@@ -113,7 +113,7 @@ def set_param_palma(param, train_with_intronlengthinformation,\
    # Gapfunktion
    ####################
    h.limits    = logspace(math.log(min_intron_len,10),math.log(max_intron_len,10),30) 
-   h.penalties = param[0:30] 
+   h.penalties = param[0:30].flatten().tolist()[0]
    #h.transform = '+1' 
    h.transform = '' 
    h.name      = 'h' 
@@ -128,7 +128,7 @@ def set_param_palma(param, train_with_intronlengthinformation,\
    # Donorfunktion
    ####################
    d.limits    = linspace(min_svm_score,max_svm_score,30) 
-   d.penalties = param[30:60]
+   d.penalties = param[30:60].flatten().tolist()[0]
    #d.transform = '+1' 
    d.transform = '' 
    d.name      = 'd' 
@@ -143,7 +143,7 @@ def set_param_palma(param, train_with_intronlengthinformation,\
    # Acceptorfunktion
    ####################
    a.limits    = linspace(min_svm_score,max_svm_score,30) 
-   a.penalties = param[60:90]
+   a.penalties = param[60:90].flatten().tolist()[0]
    #a.transform = '+1' 
    a.transform = '' 
    a.name      = 'a'