public class MMCIFFileTools extends Object
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 MapModifier and Type | Field and Description |
---|---|
static String |
MMCIF_DEFAULT_VALUE
The character to be printed out as a default value in mmCIF files, e.g. for the default alt_locs
|
static String |
MMCIF_MISSING_VALUE
The character to be printed out in cases where a value is not assigned in mmCIF files
|
Constructor and Description |
---|
MMCIFFileTools() |
Modifier and Type | Method and Description |
---|---|
static AtomSite |
convertAtomToAtomSite(Atom a,
int model,
String chainName,
String chainId)
Converts an Atom object to an
AtomSite object. |
static AtomSite |
convertAtomToAtomSite(Atom a,
int model,
String chainName,
String chainId,
int atomId)
Converts an Atom object to an
AtomSite object. |
static List<AtomSite> |
convertChainToAtomSites(Chain c,
int model,
String chainName,
String chainId)
Converts a Chain into a List of
AtomSite objects |
static Cell |
convertCrystalCellToCell(CrystalCell c)
Converts a CrystalCell object to a
Cell object. |
static List<AtomSite> |
convertGroupToAtomSites(Group g,
int model,
String chainName,
String chainId)
Converts a Group into a List of
AtomSite objects. |
static Symmetry |
convertSpaceGroupToSymmetry(SpaceGroup sg)
Converts a SpaceGroup object to a
Symmetry object. |
static List<AtomSite> |
convertStructureToAtomSites(Structure s)
Converts a Structure into a List of
AtomSite objects |
static String[] |
getFieldNames(Field[] fields)
Gets the mmCIF record name for each field.
|
static Field[] |
getFields(Class<?> c)
Gets all fields for a particular class, filtering fields annotated
with
@IgnoreField . |
static String |
toLoopMmCifHeaderString(String categoryName,
String className)
Produces a mmCIF loop header string for the given categoryName and className.
|
static <T> String |
toMMCIF(List<T> list,
Class<T> klass)
Converts a list of mmCIF beans (see
org.biojava.nbio.structure.io.mmcif.model to
a String representing them in mmCIF loop format with one record per line. |
static String |
toMMCIF(String categoryName,
Object o)
Converts a mmCIF bean (see
org.biojava.nbio.structure.io.mmcif.model to
a String representing it in mmCIF (single-record) format. |
public static final String MMCIF_MISSING_VALUE
public static final String MMCIF_DEFAULT_VALUE
public MMCIFFileTools()
public static String toLoopMmCifHeaderString(String categoryName, String className) throws ClassNotFoundException
org.biojava.nbio.structure.io.mmcif.model
packagecategoryName
- className
- ClassNotFoundException
- if the given className can not be foundpublic static String toMMCIF(String categoryName, Object o)
org.biojava.nbio.structure.io.mmcif.model
to
a String representing it in mmCIF (single-record) format.categoryName
- o
- public static Field[] getFields(Class<?> c)
@IgnoreField
.
As a side effect, calls setAccessible(true)
on all fields.c
- public static String[] getFieldNames(Field[] fields)
@CIFLabel
annotation.
As a side effect, calls setAccessible(true)
on all fields.fields
- public static <T> String toMMCIF(List<T> list, Class<T> klass)
org.biojava.nbio.structure.io.mmcif.model
to
a String representing them in mmCIF loop format with one record per line.list
- public static Symmetry convertSpaceGroupToSymmetry(SpaceGroup sg)
Symmetry
object.sg
- public static Cell convertCrystalCellToCell(CrystalCell c)
Cell
object.c
- public static AtomSite convertAtomToAtomSite(Atom a, int model, String chainName, String chainId)
AtomSite
object.a
- model
- the model number for the output AtomSiteschainName
- the chain identifier (author id) for the output AtomSiteschainId
- the internal chain identifier (asym id) for the output AtomSitespublic static AtomSite convertAtomToAtomSite(Atom a, int model, String chainName, String chainId, int atomId)
AtomSite
object.a
- the atommodel
- the model number for the output AtomSiteschainName
- the chain identifier (author id) for the output AtomSiteschainId
- the internal chain identifier (asym id) for the output AtomSitesatomId
- the atom id to be written to AtomSitepublic static List<AtomSite> convertGroupToAtomSites(Group g, int model, String chainName, String chainId)
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.g
- the groupmodel
- the model number for the output AtomSiteschainName
- the chain identifier (author id) for the output AtomSiteschainId
- the internal chain identifier (asym id) for the output AtomSitespublic static List<AtomSite> convertChainToAtomSites(Chain c, int model, String chainName, String chainId)
AtomSite
objectsc
- the chainmodel
- the model number for the output AtomSiteschainName
- the chain identifier (author id) for the output AtomSiteschainId
- the internal chain identifier (asym id) for the output AtomSitespublic static List<AtomSite> convertStructureToAtomSites(Structure s)
AtomSite
objectss
- Copyright © 2000–2019 BioJava. All rights reserved.