Class RichSequenceFormat.BasicFormat

    • Method Detail

      • canRead

        public boolean canRead​(File file)
                        throws IOException
        Check to see if a given file is in our format. Some formats may be able to determine this by filename, whilst others may have to open the file and read it to see what format it is in.
        Specified by:
        canRead in interface RichSequenceFormat
        Parameters:
        file - the File to check.
        Returns:
        true if the file is readable by this format, false if not.
        Throws:
        IOException - in case the file is inaccessible.
      • guessSymbolTokenization

        public SymbolTokenization guessSymbolTokenization​(File file)
                                                   throws IOException
        On the assumption that the file is readable by this format (not checked), attempt to guess which symbol tokenization we should use to read it. For formats that only accept one tokenization, just return it without checking the file. For formats that accept multiple tokenizations, its up to you how you do it.
        Specified by:
        guessSymbolTokenization in interface RichSequenceFormat
        Parameters:
        file - the File object to guess the format of.
        Returns:
        a SymbolTokenization to read the file with.
        Throws:
        IOException - if the file is unrecognisable or inaccessible.
      • setLineWidth

        public void setLineWidth​(int width)
        Set the line width. When writing, the lines of sequence will never be longer than the line width. Defaults to 80.
        Specified by:
        setLineWidth in interface RichSequenceFormat
        Parameters:
        width - the new line width
      • getElideSymbols

        public boolean getElideSymbols()
        Is the format going to emit events when sequence data is read?
        Specified by:
        getElideSymbols in interface RichSequenceFormat
        Returns:
        true if it is not otherwise false (false is default) .
      • setElideSymbols

        public void setElideSymbols​(boolean elideSymbols)
        Use this method to toggle reading of sequence data.
        Specified by:
        setElideSymbols in interface RichSequenceFormat
        Parameters:
        elideSymbols - set to true if you don't want the sequence data.
      • setElideFeatures

        public void setElideFeatures​(boolean elideFeatures)
        Use this method to toggle reading of feature data.
        Specified by:
        setElideFeatures in interface RichSequenceFormat
        Parameters:
        elideFeatures - set to true if you don't want the feature data.
      • setElideReferences

        public void setElideReferences​(boolean elideReferences)
        Use this method to toggle reading of bibliographic reference data.
        Specified by:
        setElideReferences in interface RichSequenceFormat
        Parameters:
        elideReferences - set to true if you don't want the bibliographic reference data.
      • getElideComments

        public boolean getElideComments()
        Is the format going to emit events when comments data or remarks from bibliographic references are read?
        Specified by:
        getElideComments in interface RichSequenceFormat
        Returns:
        true if it is not otherwise false (false is default).
      • setElideComments

        public void setElideComments​(boolean elideComments)
        Use this method to toggle reading of comments data. Will also ignore remarks lines in bibliographic references.
        Specified by:
        setElideComments in interface RichSequenceFormat
        Parameters:
        elideComments - set to true if you don't want the comments data.