embword.c
Sets the word length for all functions. Must be called first.
Creates the word length list if not yet done.
Pushes the latest word length value on the list.
Synopsis
Prototype
void embWordLength (
ajint wordlen
);
Type | Name | Read/Write | Description |
ajint | wordlen | Input | Word length |
void | | RETURN | |
Input
wordlen: | (Input) | Word length |
Returns
Description
Sets the word length for all functions. Must be called first.
Creates the word length list if not yet done.
Pushes the latest word length value on the list.
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
Clears the word length for all functions. To be called when all is done.
Pops the last word length from the list and frees it.
If there is nothing else on the list, it frees the list.
Synopsis
Prototype
void embWordClear (
void
);
Type | Name | Read/Write | Description |
void | | RETURN | |
Returns
Description
Clears the word length for all functions. To be called when all is done.
Pops the last word length from the list and frees it.
If there is nothing else on the list, it frees the list.
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
Print the words found with their frequencies.
Synopsis
Prototype
void embWordPrintTable (
const AjPTable table
);
Type | Name | Read/Write | Description |
const AjPTable | table | Input | table to be printed |
void | | RETURN | |
Input
table: | (Input) | table to be printed |
Returns
Description
Print the words found with their frequencies.
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
Print the words found with their frequencies.
Synopsis
Prototype
void embWordPrintTableFI (
const AjPTable table,
ajint mincount,
AjPFile outf
);
Type | Name | Read/Write | Description |
const AjPTable | table | Input | table to be printed |
ajint | mincount | Input | Minimum frequency to report |
AjPFile | outf | Modify | Output file. |
void | | RETURN | |
Input
table: | (Input) | table to be printed |
mincount: | (Input) | Minimum frequency to report |
Input & Output
outf: | (Modify) | Output file. |
Returns
Description
Print the words found with their frequencies.
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
Print the words found with their frequencies.
Synopsis
Prototype
void embWordPrintTableF (
const AjPTable table,
AjPFile outf
);
Type | Name | Read/Write | Description |
const AjPTable | table | Input | table to be printed |
AjPFile | outf | Modify | Output file. |
void | | RETURN | |
Input
table: | (Input) | table to be printed |
Input & Output
outf: | (Modify) | Output file. |
Returns
Description
Print the words found with their frequencies.
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
delete the word table and free the memory.
Synopsis
Prototype
void embWordFreeTable (
AjPTable* table
);
Type | Name | Read/Write | Description |
AjPTable* | table | Delete | table to be deleted |
void | | RETURN | |
Output
table: | (Delete) | table to be deleted |
Returns
Description
delete the word table and free the memory.
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
delete the word table.
Synopsis
Prototype
void embWordMatchListDelete (
AjPList* plist
);
Type | Name | Read/Write | Description |
AjPList* | plist | Modify | list to be deleted. |
void | | RETURN | |
Input & Output
plist: | (Modify) | list to be deleted. |
Returns
Description
delete the word table.
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
print the word table.
Synopsis
Prototype
void embWordMatchListPrint (
AjPFile file,
const AjPList list
);
Type | Name | Read/Write | Description |
AjPFile | file | Modify | Output file |
const AjPList | list | Input | list to be printed. |
void | | RETURN | |
Input
list: | (Input) | list to be printed. |
Input & Output
Returns
Description
print the word table.
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
convert the word table to feature tables.
Synopsis
Prototype
void embWordMatchListConvToFeat (
const AjPList list,
AjPFeattable* tab1,
AjPFeattable* tab2,
const AjPSeq seq1,
const AjPSeq seq2
);
Type | Name | Read/Write | Description |
const AjPList | list | Input | list to be printed. |
AjPFeattable* | tab1 | Modify | feature table for sequence 1 |
AjPFeattable* | tab2 | Modify | feature table for sequence 2 |
const AjPSeq | seq1 | Input | sequence |
const AjPSeq | seq2 | Input | second sequence |
void | | RETURN | |
Input
list: | (Input) | list to be printed. |
seq1: | (Input) | sequence |
seq2: | (Input) | second sequence |
Input & Output
tab1: | (Modify) | feature table for sequence 1 |
tab2: | (Modify) | feature table for sequence 2 |
Returns
Description
convert the word table to feature tables.
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
Builds a table of all words in a sequence.
The word length must be defined by a call to embWordLength.
Synopsis
Prototype
AjBool embWordGetTable (
AjPTable* table,
const AjPSeq seq
);
Type | Name | Read/Write | Description |
AjPTable* | table | Modify | table to be created or updated. |
const AjPSeq | seq | Input | Sequence to be "worded" |
AjBool | | RETURN | ajTrue if successful |
Input
seq: | (Input) | Sequence to be "worded" |
Input & Output
table: | (Modify) | table to be created or updated. |
Returns
AjBool: | ajTrue if successful |
Description
Builds a table of all words in a sequence.
The word length must be defined by a call to embWordLength.
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
Create a linked list of all the matches and order them by the
second sequence.
We need three lists:
(a) all hits, added in positional order
(b) ongoing hits, where we have not reached the end yet
which is a list of items in "all hits" being updated
(c) new hits, found in the word table from the other sequence.
Synopsis
Prototype
AjPList embWordBuildMatchTable (
const AjPTable seq1MatchTable,
const AjPSeq seq2,
ajint orderit
);
Type | Name | Read/Write | Description |
const AjPTable | seq1MatchTable | Input | Match table |
const AjPSeq | seq2 | Input | Second sequence |
ajint | orderit | Input | 1 to sort results at end, else 0. |
AjPList | | RETURN | List of matches. |
Input
seq1MatchTable: | (Input) | Match table |
seq2: | (Input) | Second sequence |
orderit: | (Input) | 1 to sort results at end, else 0. |
Returns
Description
Create a linked list of all the matches and order them by the
second sequence.
We need three lists:
(a) all hits, added in positional order
(b) ongoing hits, where we have not reached the end yet
which is a list of items in "all hits" being updated
(c) new hits, found in the word table from the other sequence.
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
Creates and initialises a word match object
Synopsis
Prototype
EmbPWordMatch embWordMatchNew (
const AjPSeq seq,
ajuint seq1start,
ajuint seq2start,
ajint length
);
Type | Name | Read/Write | Description |
const AjPSeq | seq | Input | Query sequence, match has been found |
ajuint | seq1start | Input | Start position in target sequence |
ajuint | seq2start | Input | Start position in query sequence |
ajint | length | Input | length of the word match |
EmbPWordMatch | | RETURN | New word match object. |
Input
seq: | (Input) | Query sequence, match has been found |
seq1start: | (Input) | Start position in target sequence |
seq2start: | (Input) | Start position in query sequence |
length: | (Input) | length of the word match |
Returns
EmbPWordMatch: | New word match object. |
Description
Creates and initialises a word match object
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
Given a list of matches, reduce it to the minimal set of best
non-overlapping matches.
Synopsis
Prototype
void embWordMatchMin (
AjPList matchlist
);
Type | Name | Read/Write | Description |
AjPList | matchlist | Modify | list of matches to reduce to
non-overlapping set |
void | | RETURN | |
Input & Output
matchlist: | (Modify) | list of matches to reduce to
non-overlapping set |
Returns
Description
Given a list of matches, reduce it to the minimal set of best
non-overlapping matches.
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
Given list of matches returns the first match with maximum similarity/score.
Synopsis
Prototype
EmbPWordMatch embWordMatchFirstMax (
const AjPList matchlist
);
Type | Name | Read/Write | Description |
const AjPList | matchlist | Input | list of matches |
EmbPWordMatch | | RETURN | maximum match |
Input
matchlist: | (Input) | list of matches |
Returns
EmbPWordMatch: | maximum match |
Description
Given list of matches returns the first match with maximum similarity/score.
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
Scans word/pattern table and repackages the words in EmbPWordRK
objects to improve access efficiency by Rabin-Karp search.
Computes hash values for each word/pattern.
Synopsis
Prototype
ajuint embWordRabinKarpInit (
const AjPTable table,
EmbPWordRK** ewords,
ajuint wordlen,
const AjPSeqset seqset
);
Type | Name | Read/Write | Description |
const AjPTable | table | Input | Table of patterns |
EmbPWordRK** | ewords | Modify | Extended word objects to be used
in Rabin-Karp search |
ajuint | wordlen | Input | Length of words/patterns, kmer size |
const AjPSeqset | seqset | Input | Sequence set, input patterns
were derived from |
ajuint | | RETURN | number of words |
Input
table: | (Input) | Table of patterns |
wordlen: | (Input) | Length of words/patterns, kmer size |
seqset: | (Input) | Sequence set, input patterns
were derived from |
Input & Output
ewords: | (Modify) | Extended word objects to be used
in Rabin-Karp search |
Returns
Description
Scans word/pattern table and repackages the words in EmbPWordRK
objects to improve access efficiency by Rabin-Karp search.
Computes hash values for each word/pattern.
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
Rabin Karp search for multiple patterns.
Synopsis
Prototype
ajuint embWordRabinKarpSearch (
const AjPStr sseq,
const AjPSeqset seqset,
EmbPWordRK const* patterns,
ajuint plen,
ajuint npatterns,
AjPList* matchlist,
ajuint* lastlocation,
AjBool checkmode
);
Type | Name | Read/Write | Description |
const AjPStr | sseq | Input | Sequence to be scanned for multiple patterns |
const AjPSeqset | seqset | Input | Sequence-set,
where search patterns coming from |
EmbPWordRK const* | patterns | Input | Patterns to be searched |
ajuint | plen | Input | Length of patterns |
ajuint | npatterns | Input | Number of patterns |
AjPList* | matchlist | Modify | List of matches for each sequence
in the sequence set |
ajuint* | lastlocation | Modify | Position of the search for each sequence
in the sequence set |
AjBool | checkmode | Input | If true, not writing features or alignments
but running to produce match statistics only |
ajuint | | RETURN | total number of matches |
Input
sseq: | (Input) | Sequence to be scanned for multiple patterns |
seqset: | (Input) | Sequence-set,
where search patterns coming from |
patterns: | (Input) | Patterns to be searched |
plen: | (Input) | Length of patterns |
npatterns: | (Input) | Number of patterns |
checkmode: | (Input) | If true, not writing features or alignments
but running to produce match statistics only |
Input & Output
matchlist: | (Modify) | List of matches for each sequence
in the sequence set |
lastlocation: | (Modify) | Position of the search for each sequence
in the sequence set |
Returns
ajuint: | total number of matches |
Description
Rabin Karp search for multiple patterns.
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
Return the start positions and length for the next match.
The caller iterates over the list, which is a standard AjPList
Synopsis
Prototype
AjBool embWordMatchIter (
AjIList iter,
ajint* start1,
ajint* start2,
ajint* len,
const AjPSeq* seq
);
Type | Name | Read/Write | Description |
AjIList | iter | Modify | List iterator |
ajint* | start1 | Output | Start in first sequence |
ajint* | start2 | Output | Start in second sequence |
ajint* | len | Output | Length of match |
const AjPSeq* | seq | Output | Pointer to sequence |
AjBool | | RETURN | ajFalse if the iterator was exhausted |
Output
start1: | (Output) | Start in first sequence |
start2: | (Output) | Start in second sequence |
len: | (Output) | Length of match |
seq: | (Output) | Pointer to sequence |
Input & Output
iter: | (Modify) | List iterator |
Returns
AjBool: | ajFalse if the iterator was exhausted |
Description
Return the start positions and length for the next match.
The caller iterates over the list, which is a standard AjPList
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
Unused functions. Here to keep compiler warnings away
Synopsis
Prototype
void embWordUnused (
void
);
Type | Name | Read/Write | Description |
void | | RETURN | |
Returns
Description
Unused functions. Here to keep compiler warnings away
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
Cleanup word matching indexing internals on exit
Synopsis
Prototype
void embWordExit (
void
);
Type | Name | Read/Write | Description |
void | | RETURN | |
Returns
Description
Cleanup word matching indexing internals on exit
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