I'm using R and I'm trying to import specific records from a PDB file (e.g.
HETSYN). Unfortunately, it seems the
read.pdb function of either
Rpdb aren't capable of it.
Bioinformatics Stack Exchange is a question and answer site for researchers, developers, students, teachers, and end users interested in bioinformatics. It only takes a minute to sign up.Sign up to join this community
If your file is in PDB format as the one shown here in .pdb format then you can simply extract your desired fields using sed which is a programming language used to parse and transform text. As for this structure i.e 6C4A in .pdb format HETNAM and HETSYN can be extracted using sed as follows:
sed -n -e '/HETNAM/ p' -e '/HETSYN/ p' 6C4A.pdb HETNAM EJA S-[(1Z)-2-CARBOXY-N-HYDROXYETHANIMIDOYL]-L-CYSTEINE HETNAM PYR PYRUVIC ACID HETNAM MG MAGNESIUM ION HETNAM 3NP 3-NITROPROPANOIC ACID HETNAM PEG DI(HYDROXYETHYL)ETHER HETNAM EPE 4-(2-HYDROXYETHYL)-1-PIPERAZINE ETHANESULFONIC ACID HETSYN EPE HEPES