Package org.biojava.bio.seq
Class NucleotideTools
java.lang.Object
org.biojava.bio.seq.NucleotideTools
Useful functionality for processing nucleotide sequences.
- Author:
- Matthew Pocock, Keith James (docs)
-
Method Summary
Modifier and TypeMethodDescriptionstatic AtomicSymbola()static Symbolb()static AtomicSymbolc()static Symbolcomplement(Symbol sym) Complement the symbol.static SymbolListcomplement(SymbolList list) Retrieve a complement view of list.static ReversibleTranslationTableGet a translation table for complementing Nucleotide symbols.static SymbolListcreateNucleotide(String nucleotide) Return a new Nucleotide SymbolList for nucleotide.static SequencecreateNucleotideSequence(String nucleotide, String name) Return a new Nucleotide Sequence for nucleotide.static Symbold()static SymbolforIndex(int index) Return the symbol for an index - compatible withindex.static SymbolforSymbol(char token) Retrieve the symbol for a symbol.static AtomicSymbolg()static FiniteAlphabetReturn the Nucleotide alphabet.static Symbolh()static intReturn an integer index for a symbol - compatible withforIndex.static Symbolk()static Symbolm()static Symboln()static charnucleotideToken(Symbol sym) Get a single-character token for a Nucleotide symbolstatic Symbolr()static SymbolListreverseComplement(SymbolList list) Retrieve a reverse-complement view of list.static Symbols()static AtomicSymbolt()static AtomicSymbolu()static Symbolv()static Symbolw()static Symboly()
-
Method Details
-
a
-
g
-
c
-
t
-
u
-
r
-
y
-
m
-
k
-
s
-
w
-
b
-
d
-
h
-
v
-
n
-
getNucleotide
Return the Nucleotide alphabet.- Returns:
- a flyweight version of the Nucleotide alphabet
-
createNucleotide
Return a new Nucleotide SymbolList for nucleotide.- Parameters:
nucleotide- a String to parse into Nucleotide- Returns:
- a SymbolList created form nucleotide
- Throws:
IllegalSymbolException- if nucleotide contains any non-Nucleotide characters
-
createNucleotideSequence
public static Sequence createNucleotideSequence(String nucleotide, String name) throws IllegalSymbolException Return a new Nucleotide Sequence for nucleotide.- Parameters:
nucleotide- a String to parse into Nucleotidename- a String to use as the name- Returns:
- a Sequence created form nucleotide
- Throws:
IllegalSymbolException- if nucleotide contains any non-Nucleotide characters
-
index
Return an integer index for a symbol - compatible withforIndex.The index for a symbol is stable accross virtual machines & invocations.
- Parameters:
sym- the Symbol to index- Returns:
- the index for that symbol
- Throws:
IllegalSymbolException- if sym is not a member of the Nucleotide alphabet
-
forIndex
Return the symbol for an index - compatible withindex.The index for a symbol is stable accross virtual machines & invocations.
- Parameters:
index- the index to look up- Returns:
- the symbol at that index
- Throws:
IndexOutOfBoundsException- if index is not between 0 and 3
-
complement
Complement the symbol.- Parameters:
sym- the symbol to complement- Returns:
- a Symbol that is the complement of sym
- Throws:
IllegalSymbolException- if sym is not a member of the Nucleotide alphabet
-
forSymbol
Retrieve the symbol for a symbol.- Parameters:
token- the char to look up- Returns:
- the symbol for that char
- Throws:
IllegalSymbolException- if the char does not belong to {a, g, c, t, u}
-
complement
Retrieve a complement view of list.- Parameters:
list- the SymbolList to complement- Returns:
- a SymbolList that is the complement
- Throws:
IllegalAlphabetException- if list is not a complementable alphabet
-
reverseComplement
Retrieve a reverse-complement view of list.- Parameters:
list- the SymbolList to complement- Returns:
- a SymbolList that is the complement
- Throws:
IllegalAlphabetException- if list is not a complementable alphabet
-
complementTable
Get a translation table for complementing Nucleotide symbols.- Since:
- 1.1
-
nucleotideToken
Get a single-character token for a Nucleotide symbol- Throws:
IllegalSymbolException- ifsymis not a member of the Nucleotide alphabet
-