Spaces:
Sleeping
Sleeping
minor changes to headers
Browse files
app.py
CHANGED
@@ -360,9 +360,9 @@ def mask_residue(sequence, position):
|
|
360 |
return sequence[:position] + 'X' + sequence[position+1:]
|
361 |
|
362 |
def generate_heatmap(protein_fasta):
|
363 |
-
|
364 |
-
header
|
365 |
-
protein_sequence = ''.join(
|
366 |
|
367 |
# Check if the header is valid
|
368 |
if not header.startswith('>'):
|
@@ -373,7 +373,6 @@ def generate_heatmap(protein_fasta):
|
|
373 |
if not set(protein_sequence).issubset(valid_characters):
|
374 |
return None, "Invalid protein sequence. It contains characters that are not one of the 20 standard amino acids.", None
|
375 |
|
376 |
-
|
377 |
# Tokenize and predict for original sequence
|
378 |
encoded_input = tokenizer([protein_sequence], padding=True, truncation=True, max_length=512, return_tensors="pt")
|
379 |
with torch.no_grad():
|
|
|
360 |
return sequence[:position] + 'X' + sequence[position+1:]
|
361 |
|
362 |
def generate_heatmap(protein_fasta):
|
363 |
+
lines = protein_fasta.strip().split('\n')
|
364 |
+
header = lines[0]
|
365 |
+
protein_sequence = ''.join(lines[1:])
|
366 |
|
367 |
# Check if the header is valid
|
368 |
if not header.startswith('>'):
|
|
|
373 |
if not set(protein_sequence).issubset(valid_characters):
|
374 |
return None, "Invalid protein sequence. It contains characters that are not one of the 20 standard amino acids.", None
|
375 |
|
|
|
376 |
# Tokenize and predict for original sequence
|
377 |
encoded_input = tokenizer([protein_sequence], padding=True, truncation=True, max_length=512, return_tensors="pt")
|
378 |
with torch.no_grad():
|