jebl.evolution.sequences
Class Utils
java.lang.Object
jebl.evolution.sequences.Utils
public class Utils
- extends Object
- Author:
- Andrew Rambaut, Alexei Drummond
Constructor Summary |
Utils()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Utils
public Utils()
translate
public static AminoAcidState[] translate(State[] states,
GeneticCode geneticCode)
reverseComplement
public static String reverseComplement(String nucleotideSequence)
reverseComplementWithGaps
public static String reverseComplementWithGaps(String nucleotideSequence)
translate
public static String translate(String nucleotideSequence,
GeneticCode geneticCode)
stripGaps
public static State[] stripGaps(State[] sequence)
reverse
public static State[] reverse(State[] sequence)
complement
public static NucleotideState[] complement(NucleotideState[] sequence)
reverseComplement
public static NucleotideState[] reverseComplement(NucleotideState[] sequence)
getStateIndices
public static byte[] getStateIndices(State[] sequence)
getGaplessLocation
public static int getGaplessLocation(Sequence sequence,
int gappedLocation)
- Gets the site location index for this sequence excluding
any gaps. The location is indexed from 0.
- Parameters:
sequence
- the sequencegappedLocation
- the location including gaps
- Returns:
- the location without gaps.
getGappedLocation
public static int getGappedLocation(Sequence sequence,
int gaplessLocation)
- Gets the site location index for this sequence that corresponds
to a location given excluding all gaps. The first non-gapped site
in the sequence has a gaplessLocation of 0.
- Parameters:
sequence
- the sequencegaplessLocation
-
- Returns:
- the site location including gaps
guessSequenceType
public static SequenceType guessSequenceType(CharSequence seq)
- Guess type of sequence from contents
- Parameters:
seq
- the sequence
- Returns:
- type of sequence, null if sequence contains illegal characters.