-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPromotechCNNPredict.py
40 lines (29 loc) · 1.04 KB
/
PromotechCNNPredict.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#Main function to load module and make predictions
#Author: Delano Thomas
#Email; dmthomas@mun.ca
#COMP6999 - Researh Project
#July 27, 2021
#Setup the environment library
from PromotechCNN import PromotechCNN
import sys
from tensorflow import keras
from keras.models import load_model
###Get Input argument list
inputArg = sys.argv
###Parse input to ensure correct number of argument was entered
if len(inputArg) != 3:
print("The number of arguments is not correct. \nThe format is: PromotechCNNPredict.py Promotech-CNN-20210720.h5 negative.fasta")
else:
###Process input arguments to get input file names
h5_File,fasta_File=inputArg[1],inputArg[2]
#Load the Origial Class to use functions
code = PromotechCNN()
#Load the module
print("Loading the Model")
code.model = load_model(h5_File)
#summarize model.
print("Model Summary----")
code.model.summary()
#Run prediction
print("Making prediciton on fasta file", fasta_File)
code.predictSequenceFile(fasta_File)