org.irisa.genouest.logol.utils.converter
Class FastaConverter

java.lang.Object
  extended by org.irisa.genouest.logol.utils.converter.FastaConverter

public class FastaConverter
extends java.lang.Object


Constructor Summary
FastaConverter()
           
 
Method Summary
 void convert2Fasta(java.lang.String inputFile, java.lang.String outputFile)
          Convert a Logol output XML file to fasta format
static void main(java.lang.String[] args)
          Fasta conversion from Logol result file
 void writeFasta(java.io.OutputStream os, org.biojava.bio.seq.SequenceIterator in, org.biojavax.Namespace ns, org.biojavax.bio.seq.io.FastaHeader header, int length)
          Writes Sequences from a SequenceIterator to an OutputStream in Fasta Format.
 void writeFasta(java.io.OutputStream os, org.biojava.bio.seq.Sequence seq, org.biojavax.Namespace ns)
          Writes a single Sequence to an OutputStream in Fasta format.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FastaConverter

public FastaConverter()
Method Detail

main

public static void main(java.lang.String[] args)
Fasta conversion from Logol result file

Parameters:
args - input and output file names

convert2Fasta

public void convert2Fasta(java.lang.String inputFile,
                          java.lang.String outputFile)
Convert a Logol output XML file to fasta format

Parameters:
inputFile - Logol output
outputFile - New fasta result file

writeFasta

public void writeFasta(java.io.OutputStream os,
                       org.biojava.bio.seq.SequenceIterator in,
                       org.biojavax.Namespace ns,
                       org.biojavax.bio.seq.io.FastaHeader header,
                       int length)
                throws java.io.IOException
Writes Sequences from a SequenceIterator to an OutputStream in Fasta Format. This makes for a useful format filter where a StreamReader can be sent to the RichStreamWriter after formatting.

Parameters:
os - The stream to write fasta formatted data to
in - The source of input RichSequences
ns - a Namespace to write the RichSequences to. Null implies that it should use the namespace specified in the individual sequence.
length - Size of the sequence line.
Throws:
java.io.IOException - if there is an IO problem

writeFasta

public void writeFasta(java.io.OutputStream os,
                       org.biojava.bio.seq.Sequence seq,
                       org.biojavax.Namespace ns)
                throws java.io.IOException
Writes a single Sequence to an OutputStream in Fasta format.

Parameters:
os - the OutputStream.
seq - the Sequence.
ns - a Namespace to write the sequences to. Null implies that it should use the namespace specified in the individual sequence.
Throws:
java.io.IOException - if there is an IO problem