Skip to content

Instantly share code, notes, and snippets.

Created February 27, 2015 16:23
Show Gist options
  • Save anonymous/01322e89b39846045a9f to your computer and use it in GitHub Desktop.
Save anonymous/01322e89b39846045a9f to your computer and use it in GitHub Desktop.
test
def specific_remap_dict(path_to_pdb):
sd = {}
idx = 0
with open(path_to_pdb) as pdb_file:
for line in pdb_file:
if line.startswith('ATOM'):
annotated = line[12].strip()
specific_element = line[13:16].strip()
if annotated:
element = annotated
else:
element = line[13].strip()
sd[specific_element] = element
idx += 1
return sd
fp = r'C:\Users\dealga\Documents\GitHub\BioBlender\Test_molecules\06_1L2Y_4GE.pdb'
sd = specific_remap_dict(path_to_pdb=fp)
import pprint
pprint.pprint(sd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment