Skip to content

Commit c80c2b7

Browse files
author
Jan Ludwiczak
committed
2 parents cf7b3b5 + 6b041d5 commit c80c2b7

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

pipred.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import sys
55
import random
66
import numpy as np
7-
from utils import enc_seq_onehot, enc_pssm, is_fasta, get_pssm_sequence, PiPred_Model, decode
7+
from utils import enc_seq_onehot, enc_pssm, is_fasta, get_pssm_sequence, PiPred_Model, decode,exit
88
import keras.backend as K
99

1010
# cx_freeze specific
@@ -91,9 +91,13 @@
9191
except ValueError:
9292
print("ERROR: Malformed PSSM file for entry %s!" % entry)
9393
exit()
94+
9495
if not parsed_pssm.shape[0] == len(seq) and parsed_pssm.shape[1] == 20:
95-
print("ERROR: Malformed PSSM file for entry %s!" % entry)
96-
exit()
96+
if parsed_pssm.shape[0] == len(seq)-2:
97+
parsed_pssm = np.genfromtxt(pssm_fn, skip_header=3, skip_footer=3, usecols=(i for i in range(2, 22)))
98+
else:
99+
print("ERROR: Malformed PSSM file for entry %s!" % entry)
100+
exit()
97101
pssm_files.append(pssm_fn)
98102

99103
print("Encoding sequences...")

0 commit comments

Comments
 (0)