embword.c


Function embWordLength

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
);

TypeNameRead/WriteDescription
ajintwordlenInputWord length
void RETURN

Input
wordlen:(Input)Word length
Returns
void:No return value

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

Function embWordClear

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
);

TypeNameRead/WriteDescription
void RETURN

Returns
void:No return value

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

Function embWordPrintTable

Print the words found with their frequencies.

Synopsis

Prototype
void embWordPrintTable (
      const AjPTable table
);

TypeNameRead/WriteDescription
const AjPTabletableInputtable to be printed
void RETURN

Input
table:(Input)table to be printed
Returns
void:No return value

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

Function embWordPrintTableFI

Print the words found with their frequencies.

Synopsis

Prototype
void embWordPrintTableFI (
      const AjPTable table,
      ajint mincount,
      AjPFile outf
);

TypeNameRead/WriteDescription
const AjPTabletableInputtable to be printed
ajintmincountInputMinimum frequency to report
AjPFileoutfModifyOutput file.
void RETURN

Input
table:(Input)table to be printed
mincount:(Input)Minimum frequency to report
Input & Output
outf:(Modify)Output file.
Returns
void:No return value

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

Function embWordPrintTableF

Print the words found with their frequencies.

Synopsis

Prototype
void embWordPrintTableF (
      const AjPTable table,
      AjPFile outf
);

TypeNameRead/WriteDescription
const AjPTabletableInputtable to be printed
AjPFileoutfModifyOutput file.
void RETURN

Input
table:(Input)table to be printed
Input & Output
outf:(Modify)Output file.
Returns
void:No return value

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

Function embWordFreeTable

delete the word table and free the memory.

Synopsis

Prototype
void embWordFreeTable (
      AjPTable* table
);

TypeNameRead/WriteDescription
AjPTable*tableDeletetable to be deleted
void RETURN

Output
table:(Delete)table to be deleted
Returns
void:No return value

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

Function embWordMatchListDelete

delete the word table.

Synopsis

Prototype
void embWordMatchListDelete (
      AjPList* plist
);

TypeNameRead/WriteDescription
AjPList*plistModifylist to be deleted.
void RETURN

Input & Output
plist:(Modify)list to be deleted.
Returns
void:No return value

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

Function embWordMatchListPrint

print the word table.

Synopsis

Prototype
void embWordMatchListPrint (
      AjPFile file,
      const AjPList list
);

TypeNameRead/WriteDescription
AjPFilefileModifyOutput file
const AjPListlistInputlist to be printed.
void RETURN

Input
list:(Input)list to be printed.
Input & Output
file:(Modify)Output file
Returns
void:No return value

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

Function embWordMatchListConvToFeat

convert the word table to feature tables.

Synopsis

Prototype
void embWordMatchListConvToFeat (
      const AjPList list,
      AjPFeattable* tab1,
      AjPFeattable* tab2,
      const AjPSeq seq1,
      const AjPSeq seq2
);

TypeNameRead/WriteDescription
const AjPListlistInputlist to be printed.
AjPFeattable*tab1Modifyfeature table for sequence 1
AjPFeattable*tab2Modifyfeature table for sequence 2
const AjPSeqseq1Inputsequence
const AjPSeqseq2Inputsecond 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
void:No return value

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

Function embWordGetTable

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
);

TypeNameRead/WriteDescription
AjPTable*tableModifytable to be created or updated.
const AjPSeqseqInputSequence to be "worded"
AjBool RETURNajTrue 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

Function embWordBuildMatchTable

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
);

TypeNameRead/WriteDescription
const AjPTableseq1MatchTableInputMatch table
const AjPSeqseq2InputSecond sequence
ajintorderitInput1 to sort results at end, else 0.
AjPList RETURNList of matches.

Input
seq1MatchTable:(Input)Match table
seq2:(Input)Second sequence
orderit:(Input)1 to sort results at end, else 0.
Returns
AjPList:List of matches.

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

Function embWordMatchNew

Creates and initialises a word match object

Synopsis

Prototype
EmbPWordMatch embWordMatchNew (
      const AjPSeq seq,
      ajuint seq1start,
      ajuint seq2start,
      ajint length
);

TypeNameRead/WriteDescription
const AjPSeqseqInputQuery sequence, match has been found
ajuintseq1startInputStart position in target sequence
ajuintseq2startInputStart position in query sequence
ajintlengthInputlength of the word match
EmbPWordMatch RETURNNew 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

Function embWordMatchMin

Given a list of matches, reduce it to the minimal set of best non-overlapping matches.

Synopsis

Prototype
void embWordMatchMin (
      AjPList matchlist
);

TypeNameRead/WriteDescription
AjPListmatchlistModifylist of matches to reduce to non-overlapping set
void RETURN

Input & Output
matchlist:(Modify)list of matches to reduce to non-overlapping set
Returns
void:No return value

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

Function embWordMatchFirstMax

Given list of matches returns the first match with maximum similarity/score.

Synopsis

Prototype
EmbPWordMatch embWordMatchFirstMax (
      const AjPList matchlist
);

TypeNameRead/WriteDescription
const AjPListmatchlistInputlist of matches
EmbPWordMatch RETURNmaximum 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

Function embWordRabinKarpInit

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
);

TypeNameRead/WriteDescription
const AjPTabletableInputTable of patterns
EmbPWordRK**ewordsModifyExtended word objects to be used in Rabin-Karp search
ajuintwordlenInputLength of words/patterns, kmer size
const AjPSeqsetseqsetInputSequence set, input patterns were derived from
ajuint RETURNnumber 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
ajuint:number of words

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

Function embWordRabinKarpSearch

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
);

TypeNameRead/WriteDescription
const AjPStrsseqInputSequence to be scanned for multiple patterns
const AjPSeqsetseqsetInputSequence-set, where search patterns coming from
EmbPWordRK const*patternsInputPatterns to be searched
ajuintplenInputLength of patterns
ajuintnpatternsInputNumber of patterns
AjPList*matchlistModifyList of matches for each sequence in the sequence set
ajuint*lastlocationModifyPosition of the search for each sequence in the sequence set
AjBoolcheckmodeInputIf true, not writing features or alignments but running to produce match statistics only
ajuint RETURNtotal 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

Function embWordMatchIter

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
);

TypeNameRead/WriteDescription
AjIListiterModifyList iterator
ajint*start1OutputStart in first sequence
ajint*start2OutputStart in second sequence
ajint*lenOutputLength of match
const AjPSeq*seqOutputPointer to sequence
AjBool RETURNajFalse 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

Function embWordUnused

Unused functions. Here to keep compiler warnings away

Synopsis

Prototype
void embWordUnused (
      void
);

TypeNameRead/WriteDescription
void RETURN

Returns
void:No return value

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

Function embWordExit

Cleanup word matching indexing internals on exit

Synopsis

Prototype
void embWordExit (
      void
);

TypeNameRead/WriteDescription
void RETURN

Returns
void:No return value

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