const NUCLEIC_IUPAC	= alphabet(nt"ACTGBDHKMNRSVWXY-.",false)

const AMINO_IUPAC	= alphabet(aa"ABCDEFGHIJKLMNOPQRSTUVWXYZ*-.",false)

const AMINO_20_UPPERCASE= alphabet(aa"ACDEFGHIKLMNPQRSTVWY",true)

const DNA_COMPLEMENT = zeros(Nucleotide,256)
      DNA_COMPLEMENT[Int('.')] = '.'
      DNA_COMPLEMENT[Int('-')] = '-'
      DNA_COMPLEMENT[Int('A')] = 'T'
      DNA_COMPLEMENT[Int('B')] = 'V'
      DNA_COMPLEMENT[Int('C')] = 'G'
      DNA_COMPLEMENT[Int('D')] = 'H'
      DNA_COMPLEMENT[Int('G')] = 'C'
      DNA_COMPLEMENT[Int('H')] = 'D'
      DNA_COMPLEMENT[Int('K')] = 'M'
      DNA_COMPLEMENT[Int('M')] = 'K'
      DNA_COMPLEMENT[Int('T')] = 'A'
      DNA_COMPLEMENT[Int('V')] = 'B'
      DNA_COMPLEMENT[Int('S')] = 'S'
      DNA_COMPLEMENT[Int('W')] = 'W'
      DNA_COMPLEMENT[Int('R')] = 'Y'
      DNA_COMPLEMENT[Int('Y')] = 'R'
      DNA_COMPLEMENT[Int('N')] = 'N'
      DNA_COMPLEMENT[Int('X')] = 'X'
      DNA_COMPLEMENT[Int('a')] = 't'
      DNA_COMPLEMENT[Int('b')] = 'v'
      DNA_COMPLEMENT[Int('c')] = 'g'
      DNA_COMPLEMENT[Int('d')] = 'h'
      DNA_COMPLEMENT[Int('g')] = 'c'
      DNA_COMPLEMENT[Int('h')] = 'd'
      DNA_COMPLEMENT[Int('k')] = 'm'
      DNA_COMPLEMENT[Int('m')] = 'k'
      DNA_COMPLEMENT[Int('t')] = 'a'
      DNA_COMPLEMENT[Int('v')] = 'b'
      DNA_COMPLEMENT[Int('s')] = 's'
      DNA_COMPLEMENT[Int('w')] = 'w'
      DNA_COMPLEMENT[Int('r')] = 'y'
      DNA_COMPLEMENT[Int('y')] = 'r'
      DNA_COMPLEMENT[Int('x')] = 'x'
      DNA_COMPLEMENT[Int('n')] = 'n'

const RNA_COMPLEMENT = zeros(Nucleotide,256)
      RNA_COMPLEMENT[Int('.')] = '.'
      RNA_COMPLEMENT[Int('-')] = '-'
      RNA_COMPLEMENT[Int('A')] = 'U'
      RNA_COMPLEMENT[Int('B')] = 'V'
      RNA_COMPLEMENT[Int('C')] = 'G'
      RNA_COMPLEMENT[Int('D')] = 'H'
      RNA_COMPLEMENT[Int('G')] = 'C'
      RNA_COMPLEMENT[Int('H')] = 'D'
      RNA_COMPLEMENT[Int('K')] = 'M'
      RNA_COMPLEMENT[Int('M')] = 'K'
      RNA_COMPLEMENT[Int('U')] = 'A'
      RNA_COMPLEMENT[Int('V')] = 'B'
      RNA_COMPLEMENT[Int('S')] = 'S'
      RNA_COMPLEMENT[Int('W')] = 'W'
      RNA_COMPLEMENT[Int('R')] = 'Y'
      RNA_COMPLEMENT[Int('Y')] = 'R'
      RNA_COMPLEMENT[Int('N')] = 'N'
      RNA_COMPLEMENT[Int('X')] = 'X'
      RNA_COMPLEMENT[Int('a')] = 'u'
      RNA_COMPLEMENT[Int('b')] = 'v'
      RNA_COMPLEMENT[Int('c')] = 'g'
      RNA_COMPLEMENT[Int('d')] = 'h'
      RNA_COMPLEMENT[Int('g')] = 'c'
      RNA_COMPLEMENT[Int('h')] = 'd'
      RNA_COMPLEMENT[Int('k')] = 'm'
      RNA_COMPLEMENT[Int('m')] = 'k'
      RNA_COMPLEMENT[Int('u')] = 'a'
      RNA_COMPLEMENT[Int('v')] = 'b'
      RNA_COMPLEMENT[Int('s')] = 's'
      RNA_COMPLEMENT[Int('w')] = 'w'
      RNA_COMPLEMENT[Int('r')] = 'y'
      RNA_COMPLEMENT[Int('y')] = 'r'
      RNA_COMPLEMENT[Int('x')] = 'x'
      RNA_COMPLEMENT[Int('n')] = 'n'

const AMINO_3LETTERS_TO_1 = Dict{ASCIIString,AminoAcid}(
		  "ALA"	=>	aminoacid('A'),
		  "ASX"	=>	aminoacid('B'),
		  "CYS"	=>	aminoacid('C'),
 		  "ASP"	=>  aminoacid('D'),
		  "GLU"	=>	aminoacid('E'),
		  "PHE"	=>	aminoacid('F'),
		  "GLY"	=>	aminoacid('G'),
		  "HYS"	=>	aminoacid('H'),
		  "ILE"	=>	aminoacid('I'),
		  "XLE"	=>	aminoacid('J'),
		  "LYS"	=>	aminoacid('K'),
		  "LEU"	=>	aminoacid('L'),
		  "MET"	=>	aminoacid('M'),
		  "ASN"	=>	aminoacid('N'),
		  "PYL"	=>	aminoacid('O'),
		  "PRO"	=>	aminoacid('P'),
		  "GLN"	=>	aminoacid('Q'),
		  "ARG"	=>	aminoacid('R'),
		  "SER"	=>	aminoacid('S'),
		  "THR"	=>	aminoacid('T'),
		  "SEC"	=>	aminoacid('U'),
		  "VAL"	=>	aminoacid('V'),
		  "TPR"	=>	aminoacid('W'),
		  "XXX"	=>	aminoacid('X'),
		  "TYR"	=>	aminoacid('Y'),
		  "GLX"	=>	aminoacid('Z') )

const AMINO_1LETTER_TO_3 = Dict{AminoAcid,ASCIIString}(
		  aminoacid('A')	=>	"ALA",
		  aminoacid('B')	=>	"ASX",
		  aminoacid('C')	=>	"CYS",
		  aminoacid('D')	=>	"ASP",
		  aminoacid('E')	=>	"GLU",
		  aminoacid('F')	=>	"PHE",
		  aminoacid('G')	=>	"GLY",
		  aminoacid('H')	=>	"HYS",
		  aminoacid('I')	=>	"ILE",
		  aminoacid('J')	=>	"XLE",
		  aminoacid('K')	=>	"LYS",
		  aminoacid('L')	=>	"LEU",
		  aminoacid('M')	=>	"MET",
		  aminoacid('N')	=>	"ASN",
		  aminoacid('O')	=>	"PYL",
		  aminoacid('P')	=>	"PRO",
		  aminoacid('Q')	=>	"GLN",
		  aminoacid('R')	=>	"ARG",
		  aminoacid('S')	=>	"SER",
		  aminoacid('T')	=>	"THR",
		  aminoacid('U')	=>	"SEC",
		  aminoacid('V')	=>	"VAL",
		  aminoacid('W')	=>	"TPR",
		  aminoacid('X')	=>	"XXX",
		  aminoacid('Y')	=>	"TYR",
		  aminoacid('Z')	=>	"GLX" )

const NUCLEIC_IUPAC_AMBIGUOUS_DICT = Dict{Nucleotide,Array{Nucleotide,1}}(
			nucleotide('.')	=>	nt".-",
			nucleotide('-')	=>	nt".-",
			nucleotide('A')	=>	nt"A",
			nucleotide('C')	=>	nt"C",
			nucleotide('G')	=>	nt"G",
			nucleotide('T')	=>	nt"TU",
			nucleotide('U')	=>	nt"TU",
			nucleotide('R')	=>	nt"GA",
			nucleotide('Y')	=>	nt"TCU",
			nucleotide('M')	=>	nt"AC",
			nucleotide('K')	=>	nt"GTU",
			nucleotide('S')	=>	nt"GC",
			nucleotide('W')	=>	nt"ATU",
			nucleotide('H')	=>	nt"ACTU",
			nucleotide('B')	=>	nt"GCTU",
			nucleotide('V')	=>	nt"ACG",
			nucleotide('D')	=>	nt"AGTU",
			nucleotide('N')	=>	nt"ACTUG")

const AMINO_IUPAC_EXTENDED_DICT = Dict{AminoAcid,Array{AminoAcid,1}}(
		  aminoacid('-')	=>	aminoacid(['-'; '.']),
		  aminoacid('.')	=>	aminoacid(['-'; '.']),
		  aminoacid('*')	=>	aminoacid(['*']),
		  aminoacid('A')	=>	aminoacid(['A']),
		  aminoacid('B')	=>	aminoacid(['N'; 'D']),
		  aminoacid('C')	=>	aminoacid(['C']),
		  aminoacid('D')	=>	aminoacid(['D']),
		  aminoacid('E')	=>	aminoacid(['E']),
		  aminoacid('F')	=>	aminoacid(['F']),
		  aminoacid('G')	=>	aminoacid(['G']),
		  aminoacid('H')	=>	aminoacid(['H']),
		  aminoacid('I')	=>	aminoacid(['I']),
		  aminoacid('J')	=>	aminoacid(['I'; 'L']),
		  aminoacid('K')	=>	aminoacid(['K']),
		  aminoacid('L')	=>	aminoacid(['L']),
		  aminoacid('M')	=>	aminoacid(['M']),
		  aminoacid('N')	=>	aminoacid(['N']),
		  aminoacid('O')	=>	aminoacid(['O']),
		  aminoacid('P')	=>	aminoacid(['P']),
		  aminoacid('Q')	=>	aminoacid(['Q']),
		  aminoacid('R')	=>	aminoacid(['R']),
		  aminoacid('S')	=>	aminoacid(['S']),
		  aminoacid('T')	=>	aminoacid(['T']),
		  aminoacid('U')	=>	aminoacid(['U']),
		  aminoacid('V')	=>	aminoacid(['V']),
		  aminoacid('W')	=>	aminoacid(['W']),
		  aminoacid('X')	=>	aminoacid(['A'; 'C'; 'D'; 'E'; 'F'; 'G'; 'H'; 'I'; 'K';'L'; 'M'; 'N'; 'P'; 'Q'; 'R'; 'S'; 'T'; 'V'; 'W'; 'Y']),
		  aminoacid('Y')	=>	aminoacid(['Y']),
		  aminoacid('Z')	=>	aminoacid(['Q'; 'E']))


## For Use in Regex ##
const _AMBIGUOUS_NUCLEIC_IUPAC = Dict{Nucleotide,Array{UInt8,1}}(
			nucleotide('T')	=>	UInt8['T';'U'],
			nucleotide('U')	=>	UInt8['T';'U'],
			nucleotide('R')	=>	UInt8['R';'G';'A'],
			nucleotide('Y')	=>	UInt8['Y';'T';'C';'U'],
			nucleotide('M')	=>	UInt8['M';'A';'C'],
			nucleotide('K')	=>	UInt8['K';'G';'T';'U'],
			nucleotide('S')	=>	UInt8['S';'G';'C'],
			nucleotide('W')	=>	UInt8['W';'A';'T';'U'],
			nucleotide('H')	=>	UInt8['W';'M';'Y';'H';'A';'C';'T';'U'],
			nucleotide('B')	=>	UInt8['S';'K';'B';'G';'C';'T';'U'],
			nucleotide('V')	=>	UInt8['S';'M';'R';'V';'A';'C';'G'],
			nucleotide('D')	=>	UInt8['W';'K';'R';'D';'A';'G';'T';'U'],
			nucleotide('N')	=>	UInt8['X';'W';'S';'K';'M';'Y';'R';'N';'A';'C';'T';'U';'G'],
			nucleotide('X')	=>	UInt8['X';'W';'S';'K';'M';'Y';'R';'N';'A';'C';'T';'U';'G'])

## For Use in Regex ##
const _AMBIGUOUS_AMINO_IUPAC = Dict{AminoAcid,Array{UInt8,1}}(
		  aminoacid('B')	=>	UInt8['B'; 'N'; 'D'],
		  aminoacid('X')	=>	UInt8['X'; 'B'; 'Z'; 'A'; 'C'; 'D'; 'E'; 'F'; 'G'; 'H'; 'I'; 'K';'L'; 'M'; 'N'; 'P'; 'Q'; 'R'; 'S'; 'T'; 'V'; 'W'; 'Y'; 'J' ],
		  aminoacid('Z')	=>	UInt8['Z'; 'Q'; 'E'],
		  aminoacid('J')	=>	UInt8['J'; 'L'; 'I'])
