ThorbenFroehlking commited on
Commit
f506fb3
·
1 Parent(s): c85a5b0
Files changed (2) hide show
  1. .ipynb_checkpoints/app-checkpoint.py +5 -4
  2. app.py +5 -4
.ipynb_checkpoints/app-checkpoint.py CHANGED
@@ -67,7 +67,7 @@ def process_pdb(pdb_id, segment):
67
  except KeyError:
68
  return "Invalid Chain ID", None, None
69
 
70
- # Comprehensive amino acid mapping
71
  aa_dict = {
72
  'ALA': 'A', 'CYS': 'C', 'ASP': 'D', 'GLU': 'E', 'PHE': 'F',
73
  'GLY': 'G', 'HIS': 'H', 'ILE': 'I', 'LYS': 'K', 'LEU': 'L',
@@ -77,10 +77,11 @@ def process_pdb(pdb_id, segment):
77
  }
78
 
79
  # Exclude non-amino acid residues
80
- sequence = [
81
- residue for residue in chain
 
82
  if residue.get_resname().strip() in aa_dict
83
- ]
84
 
85
  # Prepare input for model prediction
86
  input_ids = tokenizer(" ".join(sequence), return_tensors="pt").input_ids.to(device)
 
67
  except KeyError:
68
  return "Invalid Chain ID", None, None
69
 
70
+
71
  aa_dict = {
72
  'ALA': 'A', 'CYS': 'C', 'ASP': 'D', 'GLU': 'E', 'PHE': 'F',
73
  'GLY': 'G', 'HIS': 'H', 'ILE': 'I', 'LYS': 'K', 'LEU': 'L',
 
77
  }
78
 
79
  # Exclude non-amino acid residues
80
+ sequence = "".join(
81
+ aa_dict[residue.get_resname().strip()]
82
+ for residue in chain
83
  if residue.get_resname().strip() in aa_dict
84
+ )
85
 
86
  # Prepare input for model prediction
87
  input_ids = tokenizer(" ".join(sequence), return_tensors="pt").input_ids.to(device)
app.py CHANGED
@@ -67,7 +67,7 @@ def process_pdb(pdb_id, segment):
67
  except KeyError:
68
  return "Invalid Chain ID", None, None
69
 
70
- # Comprehensive amino acid mapping
71
  aa_dict = {
72
  'ALA': 'A', 'CYS': 'C', 'ASP': 'D', 'GLU': 'E', 'PHE': 'F',
73
  'GLY': 'G', 'HIS': 'H', 'ILE': 'I', 'LYS': 'K', 'LEU': 'L',
@@ -77,10 +77,11 @@ def process_pdb(pdb_id, segment):
77
  }
78
 
79
  # Exclude non-amino acid residues
80
- sequence = [
81
- residue for residue in chain
 
82
  if residue.get_resname().strip() in aa_dict
83
- ]
84
 
85
  # Prepare input for model prediction
86
  input_ids = tokenizer(" ".join(sequence), return_tensors="pt").input_ids.to(device)
 
67
  except KeyError:
68
  return "Invalid Chain ID", None, None
69
 
70
+
71
  aa_dict = {
72
  'ALA': 'A', 'CYS': 'C', 'ASP': 'D', 'GLU': 'E', 'PHE': 'F',
73
  'GLY': 'G', 'HIS': 'H', 'ILE': 'I', 'LYS': 'K', 'LEU': 'L',
 
77
  }
78
 
79
  # Exclude non-amino acid residues
80
+ sequence = "".join(
81
+ aa_dict[residue.get_resname().strip()]
82
+ for residue in chain
83
  if residue.get_resname().strip() in aa_dict
84
+ )
85
 
86
  # Prepare input for model prediction
87
  input_ids = tokenizer(" ".join(sequence), return_tensors="pt").input_ids.to(device)