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 chainId,
String internalChainId)
Converts an Atom object to an
AtomSite object. |
static AtomSite |
convertAtomToAtomSite(Atom a,
int model,
String chainId,
String internalChainId,
int atomId)
Converts an Atom object to an
AtomSite object. |
static List<AtomSite> |
convertChainToAtomSites(Chain c,
int model,
String authorId,
String asymId)
Converts a Chain into a List of
AtomSite objects |
static Cell |
convertCrystalCellToCell(CrystalCell c)
Converts a CrystalCell object to a
Cell object. |
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 chainId, String internalChainId)
AtomSite
object.a
- model
- chainId
- internalChainId
- public static AtomSite convertAtomToAtomSite(Atom a, int model, String chainId, String internalChainId, int atomId)
AtomSite
object.a
- model
- chainId
- internalChainId
- atomId
- the atom id to be written to AtomSitepublic static List<AtomSite> convertChainToAtomSites(Chain c, int model, String authorId, String asymId)
AtomSite
objectsc
- model
- authorId
- asymId
- public static List<AtomSite> convertStructureToAtomSites(Structure s)
AtomSite
objectss
- Copyright © 2000–2018 BioJava. All rights reserved.