I'm trying to separate RNA from protein in a complex protein/RNA PDB file and I want all RNA info with the hetero atoms in between the bases BUT without H20 etc. In short I want RNA part of pdb file without discontinuous lines.
I managed to separate RNA from protein with Bio PDB Select but it consider hetero atoms as amino acid when I use is_aa(residue). So hetero atoms wont appear in my "only RNA" file.
from Bio.PDB import *
from Bio.PDB import PDBParser, PDBIO, Select
import os
class ProtSelect(Select):
def accept_residue(self, residue):
return 1 if is_aa(residue) == True else 0
class RNASelect(Select):
def accept_residue(self, residue):
return 1 if is_aa(residue) == False and residue.id[0] != "W" else 0
pdb = PDBParser().get_structure("2bh2", "pdb2bh2.ent")
io = PDBIO()
io.set_structure(pdb)
io.save("seqprotest.pdb", ProtSelect())
io.save("seqRNAtest.pdb", RNASelect())