Class GenbankWriterHelper
- java.lang.Object
-
- org.biojava.nbio.core.sequence.io.GenbankWriterHelper
-
public class GenbankWriterHelper extends Object
The class that should be used to write out genbank file of a sequence collection- Author:
- mckeee1
-
-
Field Summary
Fields Modifier and Type Field Description static StringCIRCULAR_DNAstatic StringLINEAR_DNA
-
Constructor Summary
Constructors Constructor Description GenbankWriterHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidwriteNucleotideSequence(File file, Collection<DNASequence> dnaSequences)Write a collection of NucleotideSequences to a filestatic voidwriteNucleotideSequence(OutputStream outputStream, Collection<DNASequence> dnaSequences)Write a collection of NucleotideSequences to a filestatic voidwriteNucleotideSequence(OutputStream outputStream, Collection<DNASequence> dnaSequences, String seqType)Write a collection of NucleotideSequences to a filestatic voidwriteNucleotideSequenceOriginal(OutputStream outputStream, Collection<DNASequence> dnaSequences)Write a collection of NucleotideSequences to a file using the NucleotideSequences original header as the LOCUS line rather than generating itstatic voidwriteProteinSequence(File file, Collection<ProteinSequence> proteinSequences)Write collection of protein sequences to a filestatic voidwriteProteinSequence(OutputStream outputStream, Collection<ProteinSequence> proteinSequences)Write collection of protein sequences to a streamstatic voidwriteSequence(File file, Sequence<?> sequence)Write a sequence to a filestatic voidwriteSequence(OutputStream outputStream, Sequence<?> sequence)Write a sequence to OutputStreamstatic voidwriteSequences(OutputStream outputStream, Collection<Sequence<?>> sequences)Method which will write your given Sequences to the specifiedOutputStream.
-
-
-
Field Detail
-
LINEAR_DNA
public static final String LINEAR_DNA
- See Also:
- Constant Field Values
-
CIRCULAR_DNA
public static final String CIRCULAR_DNA
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
GenbankWriterHelper
public GenbankWriterHelper()
-
-
Method Detail
-
writeProteinSequence
public static void writeProteinSequence(File file, Collection<ProteinSequence> proteinSequences) throws Exception
Write collection of protein sequences to a file- Parameters:
file-proteinSequences-- Throws:
Exception
-
writeProteinSequence
public static void writeProteinSequence(OutputStream outputStream, Collection<ProteinSequence> proteinSequences) throws Exception
Write collection of protein sequences to a stream- Parameters:
outputStream-proteinSequences-- Throws:
Exception
-
writeNucleotideSequence
public static void writeNucleotideSequence(File file, Collection<DNASequence> dnaSequences) throws Exception
Write a collection of NucleotideSequences to a file- Parameters:
file-dnaSequences-- Throws:
Exception
-
writeNucleotideSequence
public static void writeNucleotideSequence(OutputStream outputStream, Collection<DNASequence> dnaSequences) throws Exception
Write a collection of NucleotideSequences to a file- Parameters:
outputStream-dnaSequences-- Throws:
Exception
-
writeNucleotideSequence
public static void writeNucleotideSequence(OutputStream outputStream, Collection<DNASequence> dnaSequences, String seqType) throws Exception
Write a collection of NucleotideSequences to a file- Parameters:
outputStream-dnaSequences-seqType-- Throws:
Exception
-
writeNucleotideSequenceOriginal
public static void writeNucleotideSequenceOriginal(OutputStream outputStream, Collection<DNASequence> dnaSequences) throws Exception
Write a collection of NucleotideSequences to a file using the NucleotideSequences original header as the LOCUS line rather than generating it- Parameters:
outputStream-dnaSequences-- Throws:
Exception
-
writeSequence
public static void writeSequence(File file, Sequence<?> sequence) throws Exception
Write a sequence to a file- Parameters:
file-sequence-- Throws:
Exception
-
writeSequence
public static void writeSequence(OutputStream outputStream, Sequence<?> sequence) throws Exception
Write a sequence to OutputStream- Parameters:
outputStream-sequence-- Throws:
Exception
-
writeSequences
public static void writeSequences(OutputStream outputStream, Collection<Sequence<?>> sequences) throws Exception
Method which will write your given Sequences to the specifiedOutputStream. This is a very generic method which writes just the AccessionID of the Sequence as the FASTA header.- Parameters:
outputStream- Stream to write to; can be System.outsequences- The sequences to write out- Throws:
Exception- Thrown normally thanks to IO problems
-
-