embnmer.c
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.
Synopsis
Prototype
ajulong embNmerNuc2int (
const char* seq,
ajint wordsize,
ajint offset,
AjBool* otherflag
);
Type | Name | Read/Write | Description |
const char* | seq | Input | the sequence to use |
ajint | wordsize | Input | the size of word of sequence to convert to int |
ajint | offset | Input | the offset into the sequence of the start of
the word |
AjBool* | otherflag | Output | set true if the sequence contains
anything except A,G,C or T |
ajulong | | RETURN | the encoded word |
Input
seq: | (Input) | the sequence to use |
wordsize: | (Input) | the size of word of sequence to convert to int |
offset: | (Input) | the offset into the sequence of the start of
the word |
Output
otherflag: | (Output) | set true if the sequence contains
anything except A,G,C or T |
Returns
Description
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.
Usage
See source code
Example
In preparation
Errors
See source code
Dependencies
See source code
See Also
See other functions in this section
Availability
In release 6.4.0
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'.
Synopsis
Prototype
ajint embNmerInt2nuc (
AjPStr* seq,
ajint wordsize,
ajulong value
);
Type | Name | Read/Write | Description |
AjPStr* | seq | Output | the returned sequence |
ajint | wordsize | Input | the size of word to produce |
ajulong | value | Input | the number to decode |
ajint | | RETURN | not used |
Input
wordsize: | (Input) | the size of word to produce |
value: | (Input) | the number to decode |
Output
seq: | (Output) | the returned sequence |
Returns
Description
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'.
Usage
See source code
Example
In preparation
Errors
See source code
Dependencies
See source code
See Also
See other functions in this section
Availability
In release 6.4.0
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.
Synopsis
Prototype
ajulong embNmerProt2int (
const char* seq,
ajint wordsize,
ajint offset,
AjBool* otherflag,
AjBool ignorebz
);
Type | Name | Read/Write | Description |
const char* | seq | Input | the sequence to use |
ajint | wordsize | Input | the size of word of sequence to convert to int |
ajint | offset | Input | the offset into the sequence of the start of
the word |
AjBool* | otherflag | Output | set true if the sequence contains
anything other than valid amino acid codes |
AjBool | ignorebz | Input | true if B and Z are to be treated as
non-valid residues |
ajulong | | RETURN | the encoded word |
Input
seq: | (Input) | the sequence to use |
wordsize: | (Input) | the size of word of sequence to convert to int |
offset: | (Input) | the offset into the sequence of the start of
the word |
ignorebz: | (Input) | true if B and Z are to be treated as
non-valid residues |
Output
otherflag: | (Output) | set true if the sequence contains
anything other than valid amino acid codes |
Returns
Description
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.
Usage
See source code
Example
In preparation
Errors
See source code
Dependencies
See source code
See Also
See other functions in this section
Availability
In release 6.4.0
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'.
Synopsis
Prototype
ajint embNmerInt2prot (
AjPStr* seq,
ajint wordsize,
ajulong value,
AjBool ignorebz
);
Type | Name | Read/Write | Description |
AjPStr* | seq | Output | the returned sequence |
ajint | wordsize | Input | the size of word to produce |
ajulong | value | Input | the number to decode |
AjBool | ignorebz | Input | true if B and Z are to be treated
as non-valid residues |
ajint | | RETURN | not used |
Input
wordsize: | (Input) | the size of word to produce |
value: | (Input) | the number to decode |
ignorebz: | (Input) | true if B and Z are to be treated
as non-valid residues |
Output
seq: | (Output) | the returned sequence |
Returns
Description
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'.
Usage
See source code
Example
In preparation
Errors
See source code
Dependencies
See source code
See Also
See other functions in this section
Availability
In release 6.4.0
Calculates the maximum number required to encode a sequence of size 'word'.
Synopsis
Prototype
AjBool embNmerGetNoElements (
ajulong* no_elements,
ajint word,
AjBool seqisnuc,
AjBool ignorebz
);
Type | Name | Read/Write | Description |
ajulong* | no_elements | Output | the returned number |
ajint | word | Input | the size of word to produce |
AjBool | seqisnuc | Input | True is the sequence is nucleic,
False if protein |
AjBool | ignorebz | Input | true if B and Z are to be treated as
non-valid residues |
AjBool | | RETURN | True if the word is small enough to be encoded
in an ajulong |
Input
word: | (Input) | the size of word to produce |
seqisnuc: | (Input) | True is the sequence is nucleic,
False if protein |
ignorebz: | (Input) | true if B and Z are to be treated as
non-valid residues |
Output
no_elements: | (Output) | the returned number |
Returns
AjBool: | True if the word is small enough to be encoded
in an ajulong |
Description
Calculates the maximum number required to encode a sequence of size 'word'.
Usage
See source code
Example
In preparation
Errors
See source code
Dependencies
See source code
See Also
See other functions in this section
Availability
In release 6.4.0