Class SequenceFileProxyLoader<C extends Compound>

  • Type Parameters:
    C -
    All Implemented Interfaces:
    Iterable<C>, Accessioned, ProxySequenceReader<C>, Sequence<C>, SequenceReader<C>

    public class SequenceFileProxyLoader<C extends Compound>
    extends Object
    implements ProxySequenceReader<C>
    This class represents the storage container of a sequence stored in a fasta file where the initial parsing of the file we store the offset and length of the sequence. When a call is made to any method that needs sequence data then the file will be opened and the sequence loaded. This class could be improved by using the hints or a some algorithm that indicates the sequence data once loaded should stay loaded. Could keep track of the last time sequence data was loaded and then after X amount of time clear the contents to free up memory.
    Author:
    Scooter Willis
    • Constructor Detail

      • SequenceFileProxyLoader

        public SequenceFileProxyLoader​(File file,
                                       SequenceParserInterface sequenceParser,
                                       long sequenceStartIndex,
                                       int sequenceLength,
                                       CompoundSet<C> compoundSet)
                                throws IOException,
                                       CompoundNotFoundException
        Parameters:
        file - The file where the sequence will be found
        sequenceParser - The parser to use to load the sequence
        sequenceStartIndex - The file offset to the start of the sequence
        sequenceLength - The length of the sequence
        compoundSet -
        Throws:
        IOException - if problems occur while reading the file
        CompoundNotFoundException - if a compound in the sequence can't be found in the given compoundSet