Package org.biojava.bio.chromatogram
Class ChromatogramTools
java.lang.Object
org.biojava.bio.chromatogram.ChromatogramTools
Utility class for dealing with
Chromatograms.- Since:
- 1.3
- Author:
- Rhett Sutphin (UI CBCB), Matthew Pocock
-
Method Summary
Modifier and TypeMethodDescriptionstatic final SymbolListgetDNASequence(Chromatogram chromat) Get the called DNA sequence from a chromatogram.static final intgetIntFromSymbolList(SymbolList list, int which) Retrieves, unwraps, and returns anintfrom a SymbolList containingIntegerAlphabet.IntegerSymbols.static final intgetTraceOffset(Chromatogram chromat, int which) Get a specific value from the trace offset sequence in the given chromatogram and extract itsintvalue.static final int[]getTraceOffsetArray(Chromatogram chromat) Converts the peak offsets list of the given chromatogram into a newintarray.static final SymbolListgetTraceOffsets(Chromatogram chromat) Get the peak offsets for the called bases of a chromatogram.
-
Method Details
-
getDNASequence
Get the called DNA sequence from a chromatogram. A synonym forchromat.getBaseCalls().symbolListForLabel(Chromatogram.DNA).- Parameters:
chromat- the Chromatogram to process- Returns:
- a SymbolList containing the DNA
-
getTraceOffsets
Get the peak offsets for the called bases of a chromatogram. A synonym forchromat.getBaseCalls().symbolListForLabel(Chromatogram.OFFSETS).- Parameters:
chromat- the Chromatogram to process- Returns:
- a SymbolList of offsets
-
getTraceOffsetArray
Converts the peak offsets list of the given chromatogram into a newintarray.The array is, of course, allocated and initialized at each call, so using this method like this:
for (int i = m ; i < n ; i++) doSomething(getTraceOffsetArray(c)[i]);is not recommended.- Parameters:
chromat- the Chromatogram to process- Returns:
- an array of integers representing peak offsets
-
getTraceOffset
Get a specific value from the trace offset sequence in the given chromatogram and extract itsintvalue.- Parameters:
chromat- the chromatogram to examinewhich- which symbol in the trace offset sequence to get. 1-based index.- Returns:
- the offset for that peak
-
getIntFromSymbolList
Retrieves, unwraps, and returns anintfrom a SymbolList containingIntegerAlphabet.IntegerSymbols.- Parameters:
list- the target listwhich- which symbol to unwrap and return. 1-based index.- Returns:
- the integer represented by the symbol at that position
-