|
1 | 1 | import argparse |
2 | 2 | from Bio import SeqIO |
3 | 3 | import os |
| 4 | +os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' |
| 5 | + |
4 | 6 | import sys |
5 | 7 | import random |
6 | 8 | import numpy as np |
7 | 9 | from utils import enc_seq_onehot, enc_pssm, is_fasta, get_pssm_sequence, PiPred_Model, decode,exit |
8 | | -import keras.backend as K |
| 10 | +import tensorflow as tf |
| 11 | +tf.compat.v1.logging.set_verbosity(tf.compat.v1.logging.ERROR) |
| 12 | +import tensorflow.keras.backend as K |
| 13 | + |
| 14 | + |
9 | 15 |
|
10 | | -# cx_freeze specific |
11 | | -if getattr(sys, 'frozen', False): |
12 | | - my_loc = os.path.dirname(os.path.abspath(sys.executable)) |
13 | | -else: |
14 | | - my_loc = os.path.dirname(os.path.realpath(__file__)) |
| 16 | +my_loc = os.path.dirname(os.path.abspath(__file__)) |
15 | 17 |
|
16 | | -#my_loc = os.path.dirname(os.path.abspath(__file__)) |
17 | 18 | parser = argparse.ArgumentParser(description='PiPred') |
18 | 19 | parser.add_argument('-i', |
19 | 20 | help='Input file with sequence in fasta format.', |
|
60 | 61 | print("ERROR: Sequence identifiers in the fasta file are not unique!") |
61 | 62 | exit() |
62 | 63 | # Check sequence length and presence of non standard residues |
63 | | -aa1 = "ACDEFGHIKLMNPQRSTVWY" |
| 64 | +aa1 = "ACDEFGHIKLMNPQRSTVWYX" |
64 | 65 | for entry, seq in zip(entries, sequences): |
65 | 66 | if not (len(seq) >= 25 and len(seq) <= 700): |
66 | 67 | print('ERROR: Not accepted sequence length (ID %s - %s). Only sequences between 30 and 700 residues are accepted!' % ( |
|
104 | 105 | enc_sequences.append(np.concatenate((enc_seq_onehot(seq, pad_length=700), |
105 | 106 | enc_pssm(pssm_fn, pad_length=700)), axis=1)) |
106 | 107 |
|
107 | | -# Create model (supress warnings). |
108 | | -stderr = sys.stderr |
109 | | -sys.stderr = open(os.devnull, 'w') |
| 108 | +# Create model |
110 | 109 | model = PiPred_Model() |
111 | | -sys.stderr = stderr |
| 110 | + |
| 111 | + |
112 | 112 | enc_sequences = np.asarray(enc_sequences) |
113 | 113 |
|
114 | 114 |
|
|
0 commit comments