Class SimpleChromatogram

  • All Implemented Interfaces:
    Chromatogram

    public class SimpleChromatogram
    extends AbstractChromatogram
    A basic chromatogram implementation which provides public mutators for setting the various attributes of the chromatogram.

    In general, new chromatogram implementations should be derived from AbstractChromatogram, not this class, as it is generally undesirable to allow the internal structures of a Chromatogram to be manipulated externally. This class could still be useful, however, for programatically generated "chromatograms".

    Since:
    1.3
    Author:
    Rhett Sutphin (UI CBCB), Matthew Pocock
    • Constructor Detail

      • SimpleChromatogram

        public SimpleChromatogram()
        Creates a new instance of SimpleChromatogram.
    • Method Detail

      • setSymbolLists

        public void setSymbolLists​(SymbolList dna,
                                   SymbolList offsets)
                            throws IllegalAlphabetException,
                                   java.lang.IllegalArgumentException
        Set the DNA and OFFSETS symbol lists for the basecall alignment. Beware: this method does no consistency checks to be sure that all the offsets are valid indices into the trace arrays.
        Parameters:
        dna - a symbol list in the DNA alphabet that contains the base calls for this chromatogram
        offsets - a symbol list in an integer or sub-integer alphabet that contains the locations in the chromatogram for the bases called in dna
        Throws:
        IllegalAlphabetException - when the alphabets aren't as specified
        java.lang.IllegalArgumentException - when the lists aren't the same length
      • setTraceValues

        public void setTraceValues​(AtomicSymbol nuc,
                                   int[] trace,
                                   int maxVal)
                            throws java.lang.IllegalArgumentException,
                                   IllegalSymbolException
        Sets the trace array for one of the DNA nucleotides. The provided array will not be copied, so any modifications to it will be reflected in calls to AbstractChromatogram.getTrace(org.biojava.bio.symbol.AtomicSymbol).

        If you need to set a new set of traces whose length is different from the old set, you must call clearTraceValues() first, or you will provoke an IllegalArgumentException.

        Parameters:
        nuc - the nucleotide for which to set the trace
        trace - the sampled intensities along the trace
        maxVal - the maximum value on the trace, or Integer.MIN_VALUE to force this method to calculate it
        Throws:
        java.lang.IllegalArgumentException - when trace.length is different from any of the existing (non-null) traces
        IllegalSymbolException - when nuc is not a concrete DNA nucleotide
      • clearTraceValues

        public void clearTraceValues()
        Sets all the traces to null.