Package org.biojava3.core.sequence.io
Class FastaWriterHelper
java.lang.Object
org.biojava3.core.sequence.io.FastaWriterHelper
The class that should be used to write out fasta file of a sequence collection
- Author:
- Scooter Willis
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidwriteGeneSequence(File file, Collection<GeneSequence> geneSequences, boolean showExonUppercase) Write a collection of GeneSequences to a file where if the gene is negative strand it will flip and complement the sequencestatic voidwriteGeneSequence(OutputStream outputStream, Collection<GeneSequence> geneSequences, boolean showExonUppercase) Write a collection of GeneSequences to a file where if the gene is negative strand it will flip and complement the sequencestatic 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 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.
-
Constructor Details
-
FastaWriterHelper
public FastaWriterHelper()
-
-
Method Details
-
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
-
writeGeneSequence
public static void writeGeneSequence(File file, Collection<GeneSequence> geneSequences, boolean showExonUppercase) throws Exception Write a collection of GeneSequences to a file where if the gene is negative strand it will flip and complement the sequence- Parameters:
file-geneSequences-- Throws:
Exception
-
writeGeneSequence
public static void writeGeneSequence(OutputStream outputStream, Collection<GeneSequence> geneSequences, boolean showExonUppercase) throws Exception Write a collection of GeneSequences to a file where if the gene is negative strand it will flip and complement the sequence- Parameters:
outputStream-dnaSequences-- 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
-
writeSequence
Write a sequence to a file- Parameters:
file-sequence-- Throws:
Exception
-
writeSequence
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
-