fatmacankara commited on
Commit
0d9f383
·
1 Parent(s): 6d7420f

Update code/pdb_featureVector.py

Browse files
Files changed (1) hide show
  1. code/pdb_featureVector.py +16 -17
code/pdb_featureVector.py CHANGED
@@ -239,10 +239,8 @@ def pdb(input_set, mode, impute):
239
  pdb_parser = PDBParser(QUIET=True) # QUIET=True suppresses warnings
240
  pdb_file_content = StringIO(pdb_data)
241
  structure = pdb_parser.get_structure(search, pdb_file_content)
242
- st.write(structure)
243
  ppb = PPBuilder()
244
  for model in structure:
245
- st.write(model)
246
  for pp in ppb.build_peptides(model):
247
  sequence = pp.get_sequence()
248
  st.write(sequence)
@@ -255,21 +253,22 @@ def pdb(input_set, mode, impute):
255
  resolution = header.get('resolution', 'N/A')
256
  # Print UniProt IDs, chain ID, and resolution for the current model
257
  for i, chain in enumerate(model, start=1):
258
- chain_id = chain.get_id()
259
- st.write(f"---- Information for Chain {chain_id} in Model {i} ----")
260
- st.write(f"UniProt IDs: {', '.join(uniprot_ids)}")
261
- st.write(f"Chain ID: {chain_id}")
262
- st.write(f"PDB ID: {search.upper()}")
263
- st.write(f"Resolution: {resolution}")
264
- st.write(f"Sequence: {sequence}")
265
- pdb_fasta.at[index, 'pdbID'] = search
266
- pdb_fasta.at[index, 'chain'] = chain_id
267
- pdb_fasta.at[index, 'pdbSequence'] = str(sequence)
268
- pdb_info.at[index, 'uniprotID'] = ', '.join(uniprot_ids)
269
- pdb_info.at[index, 'pdbID'] = search
270
- pdb_info.at[index, 'chain'] = chain_id
271
- pdb_info.at[index, 'resolution'] = resolution
272
- index += 1
 
273
 
274
  print()
275
  st.write()
 
239
  pdb_parser = PDBParser(QUIET=True) # QUIET=True suppresses warnings
240
  pdb_file_content = StringIO(pdb_data)
241
  structure = pdb_parser.get_structure(search, pdb_file_content)
 
242
  ppb = PPBuilder()
243
  for model in structure:
 
244
  for pp in ppb.build_peptides(model):
245
  sequence = pp.get_sequence()
246
  st.write(sequence)
 
253
  resolution = header.get('resolution', 'N/A')
254
  # Print UniProt IDs, chain ID, and resolution for the current model
255
  for i, chain in enumerate(model, start=1):
256
+ if chain.dbxrefs == 'UNP:'
257
+ chain_id = chain.get_id()
258
+ st.write(f"---- Information for Chain {chain_id} in Model {i} ----")
259
+ st.write(f"UniProt IDs: {', '.join(uniprot_ids)}")
260
+ st.write(f"Chain ID: {chain_id}")
261
+ st.write(f"PDB ID: {search.upper()}")
262
+ st.write(f"Resolution: {resolution}")
263
+ st.write(f"Sequence: {sequence}")
264
+ pdb_fasta.at[index, 'pdbID'] = search
265
+ pdb_fasta.at[index, 'chain'] = chain_id
266
+ pdb_fasta.at[index, 'pdbSequence'] = str(sequence)
267
+ pdb_info.at[index, 'uniprotID'] = ', '.join(uniprot_ids)
268
+ pdb_info.at[index, 'pdbID'] = search
269
+ pdb_info.at[index, 'chain'] = chain_id
270
+ pdb_info.at[index, 'resolution'] = resolution
271
+ index += 1
272
 
273
  print()
274
  st.write()