# Example for MSA
#File path for output files
wd <- tempdir()
#wd <-getwd()
file <- file.path(wd,"test_seq5")
#Importing MSA file
align <- import.msf(system.file("msa/toy_align.msf", package = "Bios2cor"))
#Creating OMES correlation object and selecting correlation matrix
omes <- omes(align, gap_ratio = 0.2)
cor_omes <- omes$Zscore
#Creating PCA object for selected matrix
pca <- centered_pca(cor_omes, filepathroot = file, filter = NULL, pc = NULL, dec_val = 5)
#Creating PDB and PML files (open PDB file with Pymol then "File > Run" PML file)
indices <- c(1,2,3)
write.pca.pdb(pca, file, indices)
### Example for MD
#File path for output files
wd <- tempdir()
#wd <-getwd()
file <- file.path(wd,"test_dyn5")
#Redaing 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 selected frames
nb_frames_wanted <- 40
wanted_frames <- seq(from = 5, to= nb_frames_wanted, by = 10)
dynamic_structure <- dynamic_structure(pdb, trj, wanted_frames)
#Creating rotamers object
conversion_file <- system.file("rotamer/dynameomics_rotamers.csv", package= "Bios2cor")
rotamers <- angle2rotamer(dynamic_structure, conversion_file)
#Creating OMES correlation object and selecting correlation matrix
wanted_residues <- c("W","Y","F","N")
omes <- dynamic_omes(dynamic_structure, rotamers, wanted_residues)
cor_omes <- omes$Zscore_noauto
#Creating PCA object for selected matrix
pca <- centered_pca(cor_omes, file, filter = NULL, pc = NULL, dec_val = 5)
#Creating PDB and PML files (open PDB file with Pymol then "File > Run" PML file)
indices <- c(1,2,3)
write.pca.pdb(pca, file, indices)
Run the code above in your browser using DataLab