#Indicating file path for output files
wd <- tempdir()
#wd <- getwd()
file <- file.path(wd,"test_dyn1")
#Reading pdb and dcd files
pdb <- system.file("rotamer/toy_coordinates.pdb", package= "Bios2cor")
trj <- system.file("rotamer/toy_dynamics.dcd", package= "Bios2cor")
#Creating dynamic_structure object for wanted frames
wanted_frames <- seq(from= 1, to= 40, by= 2)
dynamic_structure <- dynamic_structure(pdb, trj, wanted_frames)
#Calculating circular correlation between dihedral angles of selected residues
wanted_residues <- c("H","N","Q","F","Y","W")
dihed_corr <- dynamic_circular(dynamic_structure, wanted_residues)
#Selecting a correlation matrix
dihed_corr <- dihed_corr$Zscore
#Selecting angles of interest (here from the "top_pairs_analysis" function)
top_angles <- top_pairs_analysis(dihed_corr, top= 25, file)
my_angles <- unlist(top_angles$positions)
#Creating plots of the time evolution of the dihedral angles
evol_angles <- angles.plot(dynamic_structure, my_angles, file)
Run the code above in your browser using DataLab