Class SequenceWriter


  • public class SequenceWriter
    extends Object
    Tools for writing biosequences to files so they can be analyzed by external tools, and then read back into Gemma.
    Author:
    paul
    • Field Detail

      • SPACE_REPLACEMENT

        public static final String SPACE_REPLACEMENT
        Spaces in the sequence name will cause problems when converting back from some formats (e.g. PSL), so they are replaced.
        See Also:
        Constant Field Values
    • Constructor Detail

      • SequenceWriter

        public SequenceWriter()
    • Method Detail

      • writeSequencesToFile

        public static int writeSequencesToFile​(Collection<BioSequence> sequences,
                                               File outputFile)
                                        throws IOException
        Write a collection of sequences in FASTA format
        Parameters:
        sequences - sequences
        outputFile - file
        Returns:
        number of sequences written, excluding blanks and duplicates.
        Throws:
        IOException - io problems
      • getIdentifier

        public static String getIdentifier​(BioSequence b)
        Modify the identifier for the purposes of using in temporary Fasta files. WARNING There is a faint possibility that this could cause problems in identifying the sequences later.
        Parameters:
        b - b
        Returns:
        string