R: unable to use select() on variables in dataframe from PDB

22 views Asked by At

I have been using R but new to PDB files for protein structure. I hope to modify values in PDB files as if they are common dataframe.

Here's what I did:

library(bio3d)
library(tidyverse)

pdb <- read.pdb("7nhx")
atom <- as.data.frame(pdb$atom)

but then I cannot do something like

pb1_atom <- atom %>% 
  select(atom$chain == "B")

Is this because of the nature of PDB files? Is there any way to make the "atom" section a normal dataframe and convert it back after making some modifications? Thank you!

0

There are 0 answers