Package org.biojava.bio.seq.io.agave
Class AgaveWriter
- java.lang.Object
-
- org.biojava.bio.seq.io.agave.AgaveWriter
-
public class AgaveWriter extends Object
Writes 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 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 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, 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 String INDENT
use a two space indent- See Also:
- Constant Field Values
-
mOut
protected 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, PrintStream os) throws 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:
IOException
-
writeHeader
protected void writeHeader()
Write <sciobj>
-
writeFooter
protected void writeFooter()
Write </sciobj>
-
write
protected void write(Sequence seq) throws IOException
Writing Sequence.- Parameters:
seq- is simple sequence or simple assembly- Throws:
IOException
-
writeContig
protected void writeContig(Annotatable seq) throws IOException
- Throws:
IOException
-
writeAssembly
protected void writeAssembly(Annotatable seq) throws IOException
- Throws:
IOException
-
writeBioSequence
protected void writeBioSequence(Annotatable seq) throws IOException
- Throws:
IOException
-
writeSequenceMap
protected void writeSequenceMap(Annotatable seq) throws IOException
group sequence_map by getSource()- Throws:
IOException
-
writeClassification
protected void writeClassification(Annotatable seq) throws IOException
- Throws:
IOException
-
writeSequenceMap2
protected void writeSequenceMap2(Annotatable f) throws IOException
Write SequenceMap XML- Throws:
IOException
-
writeAnnotations
protected void writeAnnotations(FeatureHolder f) throws IOException
- Throws:
IOException
-
writeGene
protected void writeGene(Annotatable f) throws IOException
- Throws:
IOException
-
writeTranscript
protected void writeTranscript(Annotatable f) throws IOException
- Throws:
IOException
-
writeSeqFeature
protected void writeSeqFeature(Annotatable f) throws IOException
Write SeqFeature XML- Throws:
IOException
-
writeCompResult
protected void writeCompResult(Annotatable f) throws IOException
- Throws:
IOException
-
-