Skip to contents

An MTZ file is a binary file created to carry information on x-ray diffraction experiments on crystals. It includes x-ray diffraction data and information on the experiment and the crystal.

Usage

readMTZHeader(filename, message = FALSE)

Arguments

filename

A character string. The path to a valid mtz file.

message

A logical variable. If TRUE the function prints a message highlighting what is included in the mtz header. Default value is message=FALSE.

Value

A named list. Each name correspond to a valid field in the mtz header (see details).

Details

The function returns a named list whose components are the reflections, the header and the batch_header. The header is a named list whose components are:

TITLE

A character string containing the title of the MTZ file.

NCOL

Number of columns in data frame reflections.

CELL

A numeric vector of length 6, containing the unit cell parameters.

SORT

An integer vector of length 5, containing the sort order of the first 5 columns of data.

SYMINF

Un-named list with 6 components: the number of symmetry operations (an integer), the number of primitive operations (an integer), the lattice type (a one-letter character), the space group number (an integer), the space group name (a 10-letter character string) and the point group name (a 6-letter character).

RESO

Minimum and maximum data resolution, stored as \({1/d^2}\).

NDIF

Number of datasets whose reflection data are present in the file.

SYMM

A character vector whose length depends on the type of symmetry. It describes the symmetry operations in human-readable format, International Tables style. Each string is 80 characters long.

PROJECT

A data frame whose rows provide an ID and a name (called "pname") for the projects for which the data contained have been produced.

CRYSTAL

A data frame whose rows provide an ID and a name (called "pname") for the crystals for which the data contained have been produced.

DATASET

A data frame whose rows provide an ID and a name (called "pname") for the datasets included in the reflections record.

DCELL

A data frame whose rows contain the CRYSTAL IDs and cell parameters of each crystal that has contributed to the data in the reflections record.

DWAVEL

A data frame whose rows contain the DATASET IDs and the wavelength with which the reflection data were collected.

COLUMN

A data frame describing the type of data included in the reflections record. The data frame includes the labels for each column, the dtype (see merged_reflections) for each column, min and max values and the DATASET ID.

COLSRC

A data frame with three columns. The first includes the labels of each reflections record column. The second includes a time stamp of when each data column was created. The third is the dataset ID as a string.

COLGRP

A character string vector where each component is an 80-letters string describing the name and type of data.

HISTORY

A character string vector of variable length. Each component is an 80-letter string summarising the steps that lead to the current reflections record. HISTORY can contain a maximum of 30 lines.

Examples

datadir <- system.file("extdata",package="cry")
filename <- file.path(datadir,"1dei_phases.mtz")
ltmp <- readMTZHeader(filename)
#> Warning: truncating string with embedded nuls
print(names(ltmp))
#>  [1] "TITLE"   "NCOL"    "CELL"    "SORT"    "SYMINF"  "RESO"    "NDIF"   
#>  [8] "SYMM"    "PROJECT" "CRYSTAL" "DATASET" "DCELL"   "DWAVEL"  "COLUMN" 
#> [15] "COLSRC" 
print(ltmp$CELL)
#> [1] 57.4 56.3 23.0 90.0 90.0 90.0
print(ltmp$SYMM)
#> [1] "SYMM X,  Y,  Z                                                                  "
#> [2] "SYMM -X+1/2,  -Y,  Z+1/2                                                        "
#> [3] "SYMM X+1/2,  -Y+1/2,  -Z                                                        "
#> [4] "SYMM -X,  Y+1/2,  -Z+1/2                                                        "