Last active
August 29, 2015 14:07
-
-
Save JoaoRodrigues/6a2569e8e12eb8c9f35b 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
#!/usr/bin/env python | |
from Bio.PDB import PDBParser, PDBIO, | |
class PREFilter(Select): | |
def accept_atom(self, atom): | |
forbidden_atoms = set(['N', 'C', '...']) | |
if atom.parent.resname == 'CYS' and atom.name in forbidden_atoms: | |
if atom - atom.parent['CA'] > 3.0: | |
continue | |
parser = PDBParser(QUIET=1) | |
structure = parser.get_structure('example', 'example.pdb') | |
io = PDBIO() | |
io.set_structure(structure) | |
io.save('exmaple_filtered.pdb', PREFilter()) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment