Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
./ligand-pdb.py: line 4: FK5: command not found
./ligand-pdb.py: line 6: isatom: command not found
./ligand-pdb.py: line 7: syntax error near unexpected token `('
./ligand-pdb.py: line 7: `with open(dataname) as f:'
# Remove rows from .pdb
import numpy as np
dataname='1yat.pdb'
keyword= 'FK5'
isatom = False
with open(dataname) as f:
for line in f:
new_str=' '.join(line.split())
vals= new_str.split(' ')
if isatom == False:
print(line, end='')
if vals[0] == 'ATOM':
isatom = True
if vals[0] == 'ATOM' or vals[0] == 'HETATM' :
if vals[3] != keyword:
print(line,end='')
pass
f.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.