writeMTZ | R Documentation |
Write reflections and experimental information to an MTZ file
writeMTZ(reflections, header, filename, title = NULL, batch_header = NULL)
reflections |
A data frame containing all reflection
records in columns. This is usually derived
from modifications of a previously existing
data frame obtained using
|
header |
A list whose components are other R objects. This
is normally derived from the reading of another
MTZ file using |
filename |
A character string. The path to a valid mtz file. If a file with the same name exists, it will be deleted. |
title |
A character string. The character string associated with the TITLE keyword in an MTZ file. This feature makes it easy to quickly identify the data file in CCP4 programs. Default (NULL) is for the output file to have the same title as the input file. |
batch_header |
A named list including information at data
collection time. This component is present
only for raw (unmerged) intensity data
produce after the diffraction images
integration. Merged MTZ reflection files
have |
This function does not return any R object. It outputs an MTZ reflection file to some target location.
# Read the 1dei_phases data included in the package datadir <- system.file("extdata",package="cry") filename <- file.path(datadir,"1dei_phases.mtz") lMTZ <- readMTZ(filename) # Change dataset name print(lMTZ$header$DATASET) lMTZ$header$DATASET[2,2] <- "New CRY dataset" # Add one HISTORY line (string has to be 80-letters long) addhist <- "From CRY 0.3.0 - run on Apr 2 20:12:00 2021" n <- nchar(addhist) nblanks <- 80-n for (i in 1:nblanks) addhist <- paste0(addhist," ") lMTZ$header$HISTORY <- c(lMTZ$header$HISTORY,addhist) # Write to a new MTZ file wd <- tempdir() fname <- file.path(wd,"new.mtz") writeMTZ(lMTZ$reflections,lMTZ$header,fname)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.