Class SimpleMMcifParser
- java.lang.Object
-
- org.biojava.nbio.structure.io.mmcif.SimpleMMcifParser
-
- All Implemented Interfaces:
MMcifParser
public class SimpleMMcifParser extends java.lang.Object implements MMcifParser
A simple mmCif file parser Usage:String file = "path/to/mmcif/file"; StructureIOFile pdbreader = new MMCIFFileReader(); Structure s = pdbreader.getStructure(file); System.out.println(s); // you can convert it to a PDB file... System.out.println(s.toPDB());
For more documentation see http://biojava.org/wiki/BioJava:CookBook#Protein_Structure.- Since:
- 1.7
- Author:
- Andreas Prlic, Jose Duarte
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
COMMENT_CHAR
static java.lang.String
FIELD_LINE
static java.lang.String
LOOP_START
static java.lang.String
MMCIF_TOP_HEADER
The header appearing at the beginning of a mmCIF file.static java.lang.String
STRING_LIMIT
Quoting character ; (multi-line quoting)
-
Constructor Summary
Constructors Constructor Description SimpleMMcifParser()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addMMcifConsumer(MMcifConsumer consumer)
Add a MMcifConsumer that listens to even being triggered by the parser and processes the data into a backend provided by the Consumer.void
clearConsumers()
Remove all consumers from the parser.static void
main(java.lang.String[] args)
void
parse(java.io.BufferedReader buf)
Start the actual parsing.void
parse(java.io.InputStream inStream)
Start the actual parsing.void
removeMMcifConsumer(MMcifConsumer consumer)
remove a single consumer from the parservoid
triggerDocumentEnd()
void
triggerDocumentStart()
void
triggerGeneric(java.lang.String category, java.util.List<java.lang.String> loopFields, java.util.List<java.lang.String> lineData)
void
triggerNewAtomSites(AtomSites atomSites)
void
triggerNewChemComp(ChemComp cc)
void
triggerNewChemCompDescriptor(ChemCompDescriptor ccd)
void
triggerNewEntity(Entity entity)
void
triggerNewEntityPolySeq(EntityPolySeq epolseq)
void
triggerNewEntitySrcGen(EntitySrcGen entitySrcGen)
void
triggerNewEntitySrcNat(EntitySrcNat entitySrcNat)
void
triggerNewEntitySrcSyn(EntitySrcSyn entitySrcSyn)
void
triggerNewPdbxEntityNonPoly(PdbxEntityNonPoly pen)
void
triggerNewPdbxStructOper(PdbxStructOperList structOper)
void
triggerNewRefine(Refine r)
void
triggerNewStructAsym(StructAsym sasym)
void
triggerNewStructKeywords(StructKeywords kw)
void
triggerNewStructNcsOper(StructNcsOper sNcsOper)
-
-
-
Field Detail
-
MMCIF_TOP_HEADER
public static final java.lang.String MMCIF_TOP_HEADER
The header appearing at the beginning of a mmCIF file. A "block code" can be added to it of no more than 32 chars. See http://www.iucr.org/__data/assets/pdf_file/0019/22618/cifguide.pdf- See Also:
- Constant Field Values
-
COMMENT_CHAR
public static final java.lang.String COMMENT_CHAR
- See Also:
- Constant Field Values
-
LOOP_START
public static final java.lang.String LOOP_START
- See Also:
- Constant Field Values
-
FIELD_LINE
public static final java.lang.String FIELD_LINE
- See Also:
- Constant Field Values
-
STRING_LIMIT
public static final java.lang.String STRING_LIMIT
Quoting character ; (multi-line quoting)- See Also:
- Constant Field Values
-
-
Method Detail
-
addMMcifConsumer
public void addMMcifConsumer(MMcifConsumer consumer)
Description copied from interface:MMcifParser
Add a MMcifConsumer that listens to even being triggered by the parser and processes the data into a backend provided by the Consumer.- Specified by:
addMMcifConsumer
in interfaceMMcifParser
- Parameters:
consumer
- a consumer object.
-
clearConsumers
public void clearConsumers()
Description copied from interface:MMcifParser
Remove all consumers from the parser.- Specified by:
clearConsumers
in interfaceMMcifParser
-
removeMMcifConsumer
public void removeMMcifConsumer(MMcifConsumer consumer)
Description copied from interface:MMcifParser
remove a single consumer from the parser- Specified by:
removeMMcifConsumer
in interfaceMMcifParser
-
main
public static void main(java.lang.String[] args)
-
parse
public void parse(java.io.InputStream inStream) throws java.io.IOException
Description copied from interface:MMcifParser
Start the actual parsing. The parser will trigger events that are defined by the MMcifConsumer class.- Specified by:
parse
in interfaceMMcifParser
- Parameters:
inStream
- InputStream to parse from.- Throws:
java.io.IOException
-
parse
public void parse(java.io.BufferedReader buf) throws java.io.IOException
Description copied from interface:MMcifParser
Start the actual parsing. The parser will trigger events that are defined by the MMcifConsumer class.- Specified by:
parse
in interfaceMMcifParser
- Parameters:
buf
- a BufferedReader.- Throws:
java.io.IOException
-
triggerNewPdbxStructOper
public void triggerNewPdbxStructOper(PdbxStructOperList structOper)
-
triggerNewStructNcsOper
public void triggerNewStructNcsOper(StructNcsOper sNcsOper)
-
triggerNewAtomSites
public void triggerNewAtomSites(AtomSites atomSites)
-
triggerGeneric
public void triggerGeneric(java.lang.String category, java.util.List<java.lang.String> loopFields, java.util.List<java.lang.String> lineData)
-
triggerNewEntity
public void triggerNewEntity(Entity entity)
-
triggerNewEntityPolySeq
public void triggerNewEntityPolySeq(EntityPolySeq epolseq)
-
triggerNewEntitySrcGen
public void triggerNewEntitySrcGen(EntitySrcGen entitySrcGen)
-
triggerNewEntitySrcNat
public void triggerNewEntitySrcNat(EntitySrcNat entitySrcNat)
-
triggerNewEntitySrcSyn
public void triggerNewEntitySrcSyn(EntitySrcSyn entitySrcSyn)
-
triggerNewChemComp
public void triggerNewChemComp(ChemComp cc)
-
triggerNewStructAsym
public void triggerNewStructAsym(StructAsym sasym)
-
triggerNewPdbxEntityNonPoly
public void triggerNewPdbxEntityNonPoly(PdbxEntityNonPoly pen)
-
triggerNewStructKeywords
public void triggerNewStructKeywords(StructKeywords kw)
-
triggerNewRefine
public void triggerNewRefine(Refine r)
-
triggerDocumentStart
public void triggerDocumentStart()
-
triggerDocumentEnd
public void triggerDocumentEnd()
-
triggerNewChemCompDescriptor
public void triggerNewChemCompDescriptor(ChemCompDescriptor ccd)
-
-