Class MMCIFFileTools


  • public class MMCIFFileTools
    extends Object
    Some tools for mmCIF file writing. See http://www.iucr.org/__data/assets/pdf_file/0019/22618/cifguide.pdf CIF categories are represented as a simple bean, typically extending AbstractBean. By default, all fields from the bean are taken as the CIF labels. Fields may be omitted by annotating them as @IgnoreField. The CIF label for a field may be changed (for instance, for fields that are not valid Java identifiers) by defining a function static Map getCIFLabelMap() mapping from the field's name to the correct label.
    Author:
    Jose Duarte, Spencer Bliven
    • Method Detail

      • getFieldNames

        public static String[] getFieldNames​(Field[] fields)
        Gets the mmCIF record name for each field. This is generally just the name of the field or the value specified by the @CIFLabel annotation. As a side effect, calls setAccessible(true) on all fields.
        Parameters:
        fields -
        Returns:
      • convertAtomToAtomSite

        public static AtomSite convertAtomToAtomSite​(Atom a,
                                                     int model,
                                                     String chainName,
                                                     String chainId)
        Converts an Atom object to an AtomSite object.
        Parameters:
        a -
        model - the model number for the output AtomSites
        chainName - the chain identifier (author id) for the output AtomSites
        chainId - the internal chain identifier (asym id) for the output AtomSites
        Returns:
      • convertAtomToAtomSite

        public static AtomSite convertAtomToAtomSite​(Atom a,
                                                     int model,
                                                     String chainName,
                                                     String chainId,
                                                     int atomId)
        Converts an Atom object to an AtomSite object.
        Parameters:
        a - the atom
        model - the model number for the output AtomSites
        chainName - the chain identifier (author id) for the output AtomSites
        chainId - the internal chain identifier (asym id) for the output AtomSites
        atomId - the atom id to be written to AtomSite
        Returns:
      • convertGroupToAtomSites

        public static List<AtomSiteconvertGroupToAtomSites​(Group g,
                                                             int model,
                                                             String chainName,
                                                             String chainId)
        Converts a Group into a List of AtomSite objects. Atoms in other altloc groups (different from the main group) are also included, removing possible duplicates via using the atom identifier to assess uniqueness.
        Parameters:
        g - the group
        model - the model number for the output AtomSites
        chainName - the chain identifier (author id) for the output AtomSites
        chainId - the internal chain identifier (asym id) for the output AtomSites
        Returns:
      • convertChainToAtomSites

        public static List<AtomSiteconvertChainToAtomSites​(Chain c,
                                                             int model,
                                                             String chainName,
                                                             String chainId)
        Converts a Chain into a List of AtomSite objects
        Parameters:
        c - the chain
        model - the model number for the output AtomSites
        chainName - the chain identifier (author id) for the output AtomSites
        chainId - the internal chain identifier (asym id) for the output AtomSites
        Returns: