org.biojava.bio.structure.io.mmcif
Class SimpleMMcifParser

java.lang.Object
  extended by org.biojava.bio.structure.io.mmcif.SimpleMMcifParser
All Implemented Interfaces:
MMcifParser

public class SimpleMMcifParser
extends Object
implements MMcifParser

A simple mmCif file parser

Since:
1.7 Usage:
                String file = "path/to/mmcif/file";
                StructureIOFile pdbreader = new MMCIFFileReader();
                try {
                        Structure s = pdbreader.getStructure(file);
                        System.out.println(s);

                        // you can convert it to a PDB file...
                        System.out.println(s.toPDB());
                } catch (IOException e) {
                        e.printStackTrace();
                }
 
For more documentation see http://biojava.org/wiki/BioJava:CookBook#Protein_Structure.
Author:
Andreas Prlic

Field Summary
static String FIELD_LINE
           
static Logger logger
           
static String LOOP_END
           
static String LOOP_START
           
static String STRING_LIMIT
           
 
Constructor Summary
SimpleMMcifParser()
           
 
Method Summary
 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(String[] args)
           
 void parse(BufferedReader buf)
          Start the actual parsing.
 void parse(InputStream inStream)
          Start the actual parsing.
 void removeMMcifConsumer(MMcifConsumer consumer)
          remove a single consumer from the parser
 void triggerDocumentEnd()
           
 void triggerDocumentStart()
           
 void triggerGeneric(String category, List<String> loopFields, List<String> lineData)
           
 void triggerNewChemComp(ChemComp cc)
           
 void triggerNewChemCompDescriptor(ChemCompDescriptor ccd)
           
 void triggerNewEntity(Entity entity)
           
 void triggerNewEntityPolySeq(EntityPolySeq epolseq)
           
 void triggerNewPdbxEntityNonPoly(PdbxEntityNonPoly pen)
           
 void triggerNewRefine(Refine r)
           
 void triggerNewStructAsym(StructAsym sasym)
           
 void triggerNewStructKeywords(StructKeywords kw)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOOP_END

public static final String LOOP_END
See Also:
Constant Field Values

LOOP_START

public static final String LOOP_START
See Also:
Constant Field Values

FIELD_LINE

public static final String FIELD_LINE
See Also:
Constant Field Values

STRING_LIMIT

public static final String STRING_LIMIT
See Also:
Constant Field Values

logger

public static Logger logger
Constructor Detail

SimpleMMcifParser

public SimpleMMcifParser()
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 interface MMcifParser
Parameters:
consumer - a consumer object.

clearConsumers

public void clearConsumers()
Description copied from interface: MMcifParser
Remove all consumers from the parser.

Specified by:
clearConsumers in interface MMcifParser

removeMMcifConsumer

public void removeMMcifConsumer(MMcifConsumer consumer)
Description copied from interface: MMcifParser
remove a single consumer from the parser

Specified by:
removeMMcifConsumer in interface MMcifParser

main

public static void main(String[] args)

parse

public void parse(InputStream inStream)
           throws 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 interface MMcifParser
Parameters:
inStream - InputStream to parse from.
Throws:
IOException

parse

public void parse(BufferedReader buf)
           throws 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 interface MMcifParser
Parameters:
buf - a BufferedReader.
Throws:
IOException

triggerGeneric

public void triggerGeneric(String category,
                           List<String> loopFields,
                           List<String> lineData)

triggerNewEntity

public void triggerNewEntity(Entity entity)

triggerNewEntityPolySeq

public void triggerNewEntityPolySeq(EntityPolySeq epolseq)

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)