-
-
Save zeffii/5aa56e22193ef6fff7ce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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