Package org.biojava.bio.seq.io.agave
Class AgaveWriter
- java.lang.Object
-
- org.biojava.bio.seq.io.agave.AgaveWriter
-
public class AgaveWriter extends java.lang.ObjectWrites Sequence into AGAVE XML document. The AGAVE format is defined in agave.dtd which can be downloaded from http://www.agavexml.org.- Author:
- Hanning Ni, Brian King
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classAgaveWriter.IndentImplements indenting for elements.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringINDENTuse a two space indentprotected AGAVEAnnotFiltermAnnotFilterThe AnnotationMap to use for getting AGAVE XML attributes from a Sequence Annotation.protected org.biojava.bio.seq.io.agave.PCDATAFilterWritermFilterwrites PCDATA replacing XML characters with escape entitiesprotected AgaveWriter.IndentmIndentindentprotected java.io.PrintWritermOutWrite to XML documentprotected booleanmWriteDocTypewrite DOCTYPE if true
-
Constructor Summary
Constructors Constructor Description AgaveWriter()Default constructor uses generic annotation to attribute mapping.AgaveWriter(AGAVEAnnotFilter filter)Construct with data source specific annotation to attribute mapping.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidsetWriteDocType(boolean writeDocType)Set flag that determines if XML DOCTYPE is written or not.protected voidwrite(Sequence seq)Writing Sequence.protected voidwriteAnnotations(FeatureHolder f)protected voidwriteAssembly(Annotatable seq)protected voidwriteBioSequence(Annotatable seq)protected voidwriteClassification(Annotatable seq)protected voidwriteCompResult(Annotatable f)protected voidwriteContig(Annotatable seq)protected voidwriteFooter()Write </sciobj>protected voidwriteGene(Annotatable f)protected voidwriteHeader()Write <sciobj>protected voidwriteSeqFeature(Annotatable f)Write SeqFeature XMLvoidwriteSequence(Sequence seq, java.io.PrintStream os)Write sequence into AGAVE XML format.protected voidwriteSequenceMap(Annotatable seq)group sequence_map by getSource()protected voidwriteSequenceMap2(Annotatable f)Write SequenceMap XMLprotected voidwriteTranscript(Annotatable f)
-
-
-
Field Detail
-
INDENT
public static final java.lang.String INDENT
use a two space indent- See Also:
- Constant Field Values
-
mOut
protected java.io.PrintWriter mOut
Write to XML document
-
mIndent
protected AgaveWriter.Indent mIndent
indent
-
mFilter
protected org.biojava.bio.seq.io.agave.PCDATAFilterWriter mFilter
writes PCDATA replacing XML characters with escape entities
-
mAnnotFilter
protected AGAVEAnnotFilter mAnnotFilter
The AnnotationMap to use for getting AGAVE XML attributes from a Sequence Annotation.
-
mWriteDocType
protected boolean mWriteDocType
write DOCTYPE if true
-
-
Constructor Detail
-
AgaveWriter
public AgaveWriter()
Default constructor uses generic annotation to attribute mapping.
-
AgaveWriter
public AgaveWriter(AGAVEAnnotFilter filter)
Construct with data source specific annotation to attribute mapping.
-
-
Method Detail
-
setWriteDocType
public void setWriteDocType(boolean writeDocType)
Set flag that determines if XML DOCTYPE is written or not. Default is true.
-
writeSequence
public void writeSequence(Sequence seq, java.io.PrintStream os) throws java.io.IOException
Write sequence into AGAVE XML format.- Parameters:
seq- maybe the or simple sequenceif annotation of seq has chromosome information , generate
tag if seq is SimpleAssembly, generate tag otherwise, generate tag currently each top-level sequence is wrapped into seperated sciobj xml file - Throws:
java.io.IOException
-
writeHeader
protected void writeHeader()
Write <sciobj>
-
writeFooter
protected void writeFooter()
Write </sciobj>
-
write
protected void write(Sequence seq) throws java.io.IOException
Writing Sequence.- Parameters:
seq- is simple sequence or simple assembly- Throws:
java.io.IOException
-
writeContig
protected void writeContig(Annotatable seq) throws java.io.IOException
- Throws:
java.io.IOException
-
writeAssembly
protected void writeAssembly(Annotatable seq) throws java.io.IOException
- Throws:
java.io.IOException
-
writeBioSequence
protected void writeBioSequence(Annotatable seq) throws java.io.IOException
- Throws:
java.io.IOException
-
writeSequenceMap
protected void writeSequenceMap(Annotatable seq) throws java.io.IOException
group sequence_map by getSource()- Throws:
java.io.IOException
-
writeClassification
protected void writeClassification(Annotatable seq) throws java.io.IOException
- Throws:
java.io.IOException
-
writeSequenceMap2
protected void writeSequenceMap2(Annotatable f) throws java.io.IOException
Write SequenceMap XML- Throws:
java.io.IOException
-
writeAnnotations
protected void writeAnnotations(FeatureHolder f) throws java.io.IOException
- Throws:
java.io.IOException
-
writeGene
protected void writeGene(Annotatable f) throws java.io.IOException
- Throws:
java.io.IOException
-
writeTranscript
protected void writeTranscript(Annotatable f) throws java.io.IOException
- Throws:
java.io.IOException
-
writeSeqFeature
protected void writeSeqFeature(Annotatable f) throws java.io.IOException
Write SeqFeature XML- Throws:
java.io.IOException
-
writeCompResult
protected void writeCompResult(Annotatable f) throws java.io.IOException
- Throws:
java.io.IOException
-
-