Emily
Emily

Reputation: 1

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

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!

Upvotes: 0

Views: 24

Answers (0)

Related Questions