Created
August 2, 2017 15:26
-
-
Save normcyr/8daac70b125569782de588a64973b652 to your computer and use it in GitHub Desktop.
Read a PDB entry using the pypdb module
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
from pypdb import * | |
#testPdb = '4xkl' | |
#testPdb = '5v4k' | |
testPdb = '3vtv' | |
entityExtraInfo = get_all_info(testPdb) | |
print(entityExtraInfo) | |
print('\n') | |
if int(describe_pdb(testPdb)['nr_entities']) == 1: | |
print(entityExtraInfo.get('polymer').get('macroMolecule').get('@name')) | |
elif int(describe_pdb(testPdb)['nr_entities']) > 1: | |
for mol in entityExtraInfo['polymer']: | |
print(mol.get('macroMolecule').get('@name')) | |
else: | |
print('No molecule name available') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment