embnmer.c


Function embNmerNuc2int

Encodes a word of a nucleic sequence into a unsigned ajlong ajint number. For a 4-byte unsigned ajlong ajint this will work if the word size is less than 16, otherwise there aren't enough bits to hold the number.

Prototype

ajulong embNmerNuc2int (
      const char* seq,
      ajint wordsize,
      ajint offset,
      AjBool* otherflag
);

TypeNameRead/WriteDescription
const char*seqInputthe sequence to use
ajintwordsizeInputthe size of word of sequence to convert to int
ajintoffsetInputthe offset into the sequence of the start of the word
AjBool*otherflagOutputset true if the sequence contains anything except A,G,C or T
ajulong RETURNthe encoded word

From EMBOSS 1.0.0


Function embNmerInt2nuc

Decodes a unsigned long int number into a word of a nucleic sequence. The returned nucleic sequence is pre-pended to anything already in the string 'seq'.

Prototype

ajint embNmerInt2nuc (
      AjPStr* seq,
      ajint wordsize,
      ajulong value
);

TypeNameRead/WriteDescription
AjPStr*seqOutputthe returned sequence
ajintwordsizeInputthe size of word to produce
ajulongvalueInputthe number to decode
ajint RETURNnot used

From EMBOSS 1.0.0


Function embNmerProt2int

Encodes a word of a protein sequence into a unsigned ajlong ajint number. For a 4-byte unsigned ajlong ajint this will work if the word size is less than 8, otherwise there aren't enough bits to hold the number.

Prototype

ajulong embNmerProt2int (
      const char* seq,
      ajint wordsize,
      ajint offset,
      AjBool* otherflag,
      AjBool ignorebz
);

TypeNameRead/WriteDescription
const char*seqInputthe sequence to use
ajintwordsizeInputthe size of word of sequence to convert to int
ajintoffsetInputthe offset into the sequence of the start of the word
AjBool*otherflagOutputset true if the sequence contains anything other than valid amino acid codes
AjBoolignorebzInputtrue if B and Z are to be treated as non-valid residues
ajulong RETURNthe encoded word

From EMBOSS 1.0.0


Function embNmerInt2prot

Decodes a unsigned long int number into a word of a protein sequence. The returned protein sequence is pre-pended to anything already in the string 'seq'.

Prototype

ajint embNmerInt2prot (
      AjPStr* seq,
      ajint wordsize,
      ajulong value,
      AjBool ignorebz
);

TypeNameRead/WriteDescription
AjPStr*seqOutputthe returned sequence
ajintwordsizeInputthe size of word to produce
ajulongvalueInputthe number to decode
AjBoolignorebzInputtrue if B and Z are to be treated as non-valid residues
ajint RETURNnot used

From EMBOSS 1.0.0


Function embNmerGetNoElements

Calculates the maximum number required to encode a sequence of size 'word'.

Prototype

AjBool embNmerGetNoElements (
      ajulong* no_elements,
      ajint word,
      AjBool seqisnuc,
      AjBool ignorebz
);

TypeNameRead/WriteDescription
ajulong*no_elementsOutputthe returned number
ajintwordInputthe size of word to produce
AjBoolseqisnucInputTrue is the sequence is nucleic, False if protein
AjBoolignorebzInputtrue if B and Z are to be treated as non-valid residues
AjBool RETURNTrue if the word is small enough to be encoded in an ajulong

From EMBOSS 1.0.0