The aim of this tutorial is to load the content of the log file, in output from SHELXC/D/E, in the workspace and create dataframes that can be used for further analysis or data visualisation. The cry
function readSHELXlog
can load in the R working memory all the log files in output from SHELXC/D/E and give in output a dataframe for SHELXC/D and a list of dataframes for SHELXE.
Some sample files are stored as external data in this package. Among them there are the SHELXC/D/E log files available with the current release. To access the files, first load the cry
package.
library(cry)
Next, have a look at what is included in the external-data directory of cry
.
<- system.file("extdata",package="cry")
datadir <- list.files(datadir)
all_files print(all_files)
## [1] "1dei-sf.cif" "1dei_phases.mtz"
## [3] "2ol9_phases.mtz" "6vww_xds_ascii_merged.hkl"
## [5] "AMS_DATA.cif" "e-65-00i60-Isup2.rtv"
## [7] "shelxc.log" "shelxd.log"
## [9] "shelxe_i.log" "shelxe_o.log"
## [11] "xds00_ascii.hkl"
Let start to have look at SHELXC log file.
<- file.path(datadir,"shelxc.log")
filename <- readSHELXlog(filename)
obj_shelxc class(obj_shelxc)
## [1] "data.frame"
names(obj_shelxc)
## [1] "Res" "N_data" "Chi_sq" "I_sig" "Complete" "d_sig" "CC1_2"
Plot \(Delta*F/sig(Delta*F)\) vs resolution.
library(ggplot2)
ggplot(obj_shelxc, aes(1/(Res)^2, d_sig)) +
geom_point() + geom_line() + theme_bw() +
xlab(expression(h^2 * (ring(A)^-2))) +
ylab(expression(Delta*F/sig(Delta*F)))
<- file.path(datadir,"shelxd.log")
filename <- readSHELXlog(filename)
obj_shelxd class(obj_shelxd)
## [1] "data.frame"
names(obj_shelxd)
## [1] "CCall" "CCweak"
Plot CCall vs CCweak using ggplot2
library(ggplot2)
ggplot(obj_shelxd, aes(CCall, CCweak)) +
geom_point() + theme_bw() +
xlab('CCall') + ylab('CCweak')
The function readSHELXlog
when reading log files from SHELXE five in output a list of dataframes. The user can choose the data frame to use for further analysis.
## read the two hands log files separately
<- file.path(datadir,"shelxe_i.log")
filename_i <- readSHELXlog(filename_i)
obj_shelxe_i class(obj_shelxe_i)
## [1] "list"
names(obj_shelxe_i)
## [1] "CYCLE" "FOM_mapCC" "Site1" "Site2"
<- obj_shelxe_i$CYCLE
cycle_i class(cycle_i)
## [1] "data.frame"
names(cycle_i)
## [1] "wt" "Contrast" "Connect" "cycle"
<- obj_shelxe_i$FOM_mapCC
FOM_mapCC_i class(FOM_mapCC_i)
## [1] "data.frame"
names(FOM_mapCC_i)
## [1] "Res" "FOM" "mapCC" "N"
<- obj_shelxe_i$Site1
Site1_i class(Site1_i)
## [1] "data.frame"
names(Site1_i)
## [1] "Site" "x" "y" "z" "occ.Z" "density"
<- obj_shelxe_i$Site2
Site2_i class(Site2_i)
## [1] "data.frame"
names(Site2_i)
## [1] "Site" "x" "y" "z" "h.sig." "near" "old" "near.1"
## [9] "new"
<- file.path(datadir,"shelxe_o.log")
filename_o <- readSHELXlog(filename_o)
obj_shelxe_o class(obj_shelxe_o)
## [1] "list"
names(obj_shelxe_o)
## [1] "CYCLE" "FOM_mapCC" "Site1" "Site2"
<- obj_shelxe_o$CYCLE
cycle_o class(cycle_i)
## [1] "data.frame"
names(cycle_i)
## [1] "wt" "Contrast" "Connect" "cycle"
<- obj_shelxe_o$FOM_mapCC
FOM_mapCC_0 class(FOM_mapCC_i)
## [1] "data.frame"
names(FOM_mapCC_i)
## [1] "Res" "FOM" "mapCC" "N"
<- obj_shelxe_o$Site1
Site1_o class(Site1_i)
## [1] "data.frame"
names(Site1_i)
## [1] "Site" "x" "y" "z" "occ.Z" "density"
<- obj_shelxe_o$Site2
Site2_o class(Site2_i)
## [1] "data.frame"
names(Site2_i)
## [1] "Site" "x" "y" "z" "h.sig." "near" "old" "near.1"
## [9] "new"