001/*
002 *                    BioJava development code
003 *
004 * This code may be freely distributed and modified under the
005 * terms of the GNU Lesser General Public Licence.  This should
006 * be distributed with the code.  If you do not have a copy,
007 * see:
008 *
009 *      http://www.gnu.org/copyleft/lesser.html
010 *
011 * Copyright for this code is held jointly by the individual
012 * authors.  These should be listed in @author doc comments.
013 *
014 * For more information on the BioJava project and its aims,
015 * or to join the biojava-l mailing list, visit the home page
016 * at:
017 *
018 *      http://www.biojava.org/
019 *
020 * Created on DATE
021 *
022 */
023package org.biojava.nbio.core.sequence;
024
025
026/**
027 * A static class that provides optimization hints for memory or performance handling of sequence data.
028 * If you are working with genomic sequence data and the use case is sub sequence then the sequence proxy loader
029 * implementation may do file reads for each sub-sequence request instead of loading everything into memory.
030 * If a large collection of protein sequences is being loaded from a fasta file but only a few sequences will be selected
031 * then the file loader could create a sequence proxy loader that retains the offset in the file for each sequence
032 * and it is loaded when the sequence data is requested. This way you could load a pointer to all sequences but delay
033 * loading until the user actually needs the data. The sequence loader could also have an internal sequence management
034 * algorithm that goes through and returns sequence data freeing up memory where a future request for sequence data will
035 * then be reloaded.
036 *
037 * @author Scooter Willis
038 */
039public class SequenceOptimizationHints {
040
041        /**
042         * @return the sequenceUsage
043         */
044        public static SequenceUsage getSequenceUsage() {
045                return sequenceUsage;
046        }
047
048        /**
049         * @param aSequenceUsage the sequenceUsage to set
050         */
051        public static void setSequenceUsage(SequenceUsage aSequenceUsage) {
052                sequenceUsage = aSequenceUsage;
053        }
054
055        /**
056         * @return the sequenceColection
057         */
058        public static SequenceCollection getSequenceCollection() {
059                return sequenceCollection;
060        }
061
062        /**
063         * @param aSequenceColection the sequenceColection to set
064         */
065        public static void setSequenceCollection(SequenceCollection aSequenceColection) {
066                sequenceCollection = aSequenceColection;
067        }
068
069        public enum SequenceUsage {
070
071                FULL_SEQUENCE_DATA, SUB_SEQUENCE_DATA, MINIMAL_SEQUENCE_DATA;
072        }
073
074        public enum SequenceCollection {
075
076                ALL_SEQUENCES, VARIABLE_SEQUENCES, MINIMINAL_SEQUENCES;
077        }
078
079        static private SequenceUsage sequenceUsage = SequenceUsage.FULL_SEQUENCE_DATA;
080        static private SequenceCollection sequenceCollection = SequenceCollection.ALL_SEQUENCES;
081
082
083
084
085
086}