Dinesh1102 commited on
Commit
edb6497
·
verified ·
1 Parent(s): 6159956

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -41,16 +41,16 @@ def get_embeddings(seq):
41
 
42
  return emb_0_per_protein
43
 
44
- def predict(filepath):
45
- sequences = SeqIO.parse(filepath, "fasta")
46
 
47
  ids = []
48
  num_sequences=sum(1 for seq in sequences)
49
  embeds = np.zeros((num_sequences, 1024))
50
  i = 0
51
- with open(filepath, "r") as fasta_file:
52
  # Iterate over each sequence in the file
53
- for sequence in SeqIO.parse(fasta_file, "fasta"):
54
  # Access the sequence ID and sequence data
55
  seq_id = sequence.id
56
  seq_data = str(sequence.seq)
@@ -116,7 +116,8 @@ def predict(filepath):
116
 
117
  gr.Interface(
118
  predict,
119
- title = 'Protein Function Prediction using fasta file,upload a fasta file',
120
  inputs="file",
121
- outputs="file"
 
122
  ).launch()
 
41
 
42
  return emb_0_per_protein
43
 
44
+ def predict(fasta_file):
45
+ sequences = SeqIO.parse(fasta_file, "fasta")
46
 
47
  ids = []
48
  num_sequences=sum(1 for seq in sequences)
49
  embeds = np.zeros((num_sequences, 1024))
50
  i = 0
51
+ with open(fasta_file, "r") as fastafile:
52
  # Iterate over each sequence in the file
53
+ for sequence in SeqIO.parse(fastafile, "fasta"):
54
  # Access the sequence ID and sequence data
55
  seq_id = sequence.id
56
  seq_data = str(sequence.seq)
 
116
 
117
  gr.Interface(
118
  predict,
119
+ title = 'Multi-label Protein Function Prediction',
120
  inputs="file",
121
+ outputs="file",
122
+ description="Upload a fasta file containing protein sequence"
123
  ).launch()