embpat.c


Function embPatSeqCreateRegExp

Create a regular expression for a string and substitute the chars for Nucleotides or proteins as needed.

Synopsis

Prototype
AjPStr embPatSeqCreateRegExp (
      const AjPStr thys,
      AjBool protein
);

TypeNameRead/WriteDescription
const AjPStrthysInputstring to create reg expr from.
AjBoolproteinInputis it a protein.
AjPStr RETURNthe new regular expression.

Input
thys:(Input)string to create reg expr from.
protein:(Input)is it a protein.
Returns
AjPStr:the new regular expression.

Description

Create a regular expression for a string and substitute the chars for Nucleotides or proteins as needed.

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 embPatSeqCreateRegExpC

Create a regular expression for a string and substitute the chars for Nucleotides or proteins as needed.

Synopsis

Prototype
AjPStr embPatSeqCreateRegExpC (
      const char* ptr,
      AjBool protein
);

TypeNameRead/WriteDescription
const char*ptrInputtext to create reg expr from.
AjBoolproteinInputis it a protein.
AjPStr RETURNthe new regular expression.

Input
ptr:(Input)text to create reg expr from.
protein:(Input)is it a protein.
Returns
AjPStr:the new regular expression.

Description

Create a regular expression for a string and substitute the chars for Nucleotides or proteins as needed.

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 embPatSeqMatchFind

Find all the regular expression matches of reg in the string string.

Synopsis

Prototype
EmbPPatMatch embPatSeqMatchFind (
      const AjPSeq seq,
      const AjPStr reg
);

TypeNameRead/WriteDescription
const AjPSeqseqInputSequence to be searched.
const AjPStrregInputregular expression string.
EmbPPatMatch RETURNResults of the pattern matching.

Input
seq:(Input)Sequence to be searched.
reg:(Input)regular expression string.
Returns
EmbPPatMatch:Results of the pattern matching.

Description

Find all the regular expression matches of reg in the string string.

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 embPatSeqMatchFindC

Find all the regular expression matches of reg in the string string.

Synopsis

Prototype
EmbPPatMatch embPatSeqMatchFindC (
      const AjPSeq seq,
      const char* reg
);

TypeNameRead/WriteDescription
const AjPSeqseqInputSequence to be searched.
const char*regInputregular expression text.
EmbPPatMatch RETURNResults of the pattern matching.

Input
seq:(Input)Sequence to be searched.
reg:(Input)regular expression text.
Returns
EmbPPatMatch:Results of the pattern matching.

Description

Find all the regular expression matches of reg in the string string.

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 embPatMatchFind

Find all the regular expression matches of reg in the string string.

Synopsis

Prototype
EmbPPatMatch embPatMatchFind (
      const AjPStr regexp,
      const AjPStr strng,
      AjBool left,
      AjBool right
);

TypeNameRead/WriteDescription
const AjPStrregexpInputRegular expression string.
const AjPStrstrngInputString to be searched.
AjBoolleftInputhas to match the start
AjBoolrightInputhas to match the end
EmbPPatMatch RETURNResults of the pattern matching.

Input
regexp:(Input)Regular expression string.
strng:(Input)String to be searched.
left:(Input)has to match the start
right:(Input)has to match the end
Returns
EmbPPatMatch:Results of the pattern matching.

Description

Find all the regular expression matches of reg in the string string.

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 embPatMatchFindC

Find all the regular expression matches of reg in the string string.

Synopsis

Prototype
EmbPPatMatch embPatMatchFindC (
      const AjPStr regexp,
      const char* sptr,
      AjBool left,
      AjBool right
);

TypeNameRead/WriteDescription
const AjPStrregexpInputRegular expression string.
const char*sptrInputString to be searched.
AjBoolleftInputhas to match the start
AjBoolrightInputhas to match the end
EmbPPatMatch RETURNResults of the pattern matching.

Input
regexp:(Input)Regular expression string.
sptr:(Input)String to be searched.
left:(Input)has to match the start
right:(Input)has to match the end
Returns
EmbPPatMatch:Results of the pattern matching.

Description

Find all the regular expression matches of reg in the string string.

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 embPatMatchGetLen

Returns the length from the pattern match structure for index'th item.

Synopsis

Prototype
ajuint embPatMatchGetLen (
      const EmbPPatMatch data,
      ajuint indexnum
);

TypeNameRead/WriteDescription
const EmbPPatMatchdataInputresults of match.
ajuintindexnumInputindex to structure.
ajuint RETURNreturns -1 if not available.

Input
data:(Input)results of match.
indexnum:(Input)index to structure.
Returns
ajuint:returns -1 if not available.

Description

Returns the length from the pattern match structure for index'th item.

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 embPatMatchGetEnd

Returns the End point for the pattern match structure for index'th item.

Synopsis

Prototype
ajuint embPatMatchGetEnd (
      const EmbPPatMatch data,
      ajuint indexnum
);

TypeNameRead/WriteDescription
const EmbPPatMatchdataInputresults of match.
ajuintindexnumInputindex to structure.
ajuint RETURNreturns -1 if not available.

Input
data:(Input)results of match.
indexnum:(Input)index to structure.
Returns
ajuint:returns -1 if not available.

Description

Returns the End point for the pattern match structure for index'th item.

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 embPatMatchGetNumber

Returns the number of pattern matches in the structure.

Synopsis

Prototype
ajuint embPatMatchGetNumber (
      const EmbPPatMatch data
);

TypeNameRead/WriteDescription
const EmbPPatMatchdataInputresults of match.
ajuint RETURNreturns -1 if not available.

Input
data:(Input)results of match.
Returns
ajuint:returns -1 if not available.

Description

Returns the number of pattern matches in the structure.

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 embPatMatchGetStart

Returns the start position from the pattern match structure for index'th item.

Synopsis

Prototype
ajuint embPatMatchGetStart (
      const EmbPPatMatch data,
      ajuint indexnum
);

TypeNameRead/WriteDescription
const EmbPPatMatchdataInputresults of match.
ajuintindexnumInputindex to structure.
ajuint RETURNreturns -1 if not available.

Input
data:(Input)results of match.
indexnum:(Input)index to structure.
Returns
ajuint:returns -1 if not available.

Description

Returns the start position from the pattern match structure for index'th item.

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 embPatMatchDel

Free all the memory from the pattern match search.

Synopsis

Prototype
void embPatMatchDel (
      EmbPPatMatch* pthis
);

TypeNameRead/WriteDescription
EmbPPatMatch*pthisDeleteresults to be freed.
void RETURN

Output
pthis:(Delete)results to be freed.
Returns
void:No return value

Description

Free all the memory from the pattern match search.

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 embPatPrositeToRegExp

Convert a prosite pattern to a regular expression

Start and end are indicated by boolean options, as the pattern may have been processed for the other pattern matching methods

Synopsis

Prototype
AjPStr embPatPrositeToRegExp (
      const AjPStr s
);

TypeNameRead/WriteDescription
const AjPStrsInputprosite pattern
AjPStr RETURNregular expression

Input
s:(Input)prosite pattern
Returns
AjPStr:regular expression

Description

Convert a prosite pattern to a regular expression

Start and end are indicated by boolean options, as the pattern may have been processed for the other pattern matching methods

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 embPatPrositeToRegExpEnds

Convert a prosite pattern to a regular expression string.

start and end say whether the ends should match in case this is a processed pattern, but there is still a check for angle brackets.

Synopsis

Prototype
AjPStr embPatPrositeToRegExpEnds (
      const AjPStr s,
      AjBool start,
      AjBool end
);

TypeNameRead/WriteDescription
const AjPStrsInputprosite pattern
AjBoolstartInputmust match start
AjBoolendInputmust match end
AjPStr RETURNregular expression

Input
s:(Input)prosite pattern
start:(Input)must match start
end:(Input)must match end
Returns
AjPStr:regular expression

Description

Convert a prosite pattern to a regular expression string.

start and end say whether the ends should match in case this is a processed pattern, but there is still a check for angle brackets.

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 embPatRestrictNew

Create a new restriction object

Synopsis

Prototype
EmbPPatRestrict embPatRestrictNew (
      void
);

TypeNameRead/WriteDescription
EmbPPatRestrict RETURNthe allocated object

Returns
EmbPPatRestrict:the allocated object

Description

Create a new restriction 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 embPatRestrictDel

Delete a restriction object

Synopsis

Prototype
void embPatRestrictDel (
      EmbPPatRestrict* thys
);

TypeNameRead/WriteDescription
EmbPPatRestrict*thysDeleterestriction object
void RETURN

Output
thys:(Delete)restriction object
Returns
void:No return value

Description

Delete a restriction 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 embPatRestrictReadEntry

Read next restriction enzyme from re file

Synopsis

Prototype
AjBool embPatRestrictReadEntry (
      EmbPPatRestrict re,
      AjPFile inf
);

TypeNameRead/WriteDescription
EmbPPatRestrictreOutputrestriction object to fill
AjPFileinfModifyinput file pointer
AjBool RETURNTrue if read successful

Output
re:(Output)restriction object to fill
Input & Output
inf:(Modify)input file pointer
Returns
AjBool:True if read successful

Description

Read next restriction enzyme from re file

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 embPatRestrictScan

Scan a sequence with a restriction object

Synopsis

Prototype
ajuint embPatRestrictScan (
      const EmbPPatRestrict enz,
      const AjPStr substr,
      const AjPStr binstr,
      const AjPStr revstr,
      const AjPStr binrev,
      ajuint len,
      AjBool ambiguity,
      AjBool plasmid,
      ajuint min,
      ajuint max,
      ajuint begin,
      AjPList l
);

TypeNameRead/WriteDescription
const EmbPPatRestrictenzInputEnyme information
const AjPStrsubstrInputSequence as ASCII
const AjPStrbinstrInputSequence as binary IUB
const AjPStrrevstrInputSequence as ASCII reversed
const AjPStrbinrevInputSequence as binary IUB reversed
ajuintlenInputLength of sequence
AjBoolambiguityInputAllow ambiguity (binary search)
AjBoolplasmidInputAllow circular DNA
ajuintminInputMinimum # of matches allowed
ajuintmaxInputMaximum # of matches
ajuintbeginInputSequence offset
AjPListlModifyList to push hits to
ajuint RETURNNumber of matches

Input
enz:(Input)Enyme information
substr:(Input)Sequence as ASCII
binstr:(Input)Sequence as binary IUB
revstr:(Input)Sequence as ASCII reversed
binrev:(Input)Sequence as binary IUB reversed
len:(Input)Length of sequence
ambiguity:(Input)Allow ambiguity (binary search)
plasmid:(Input)Allow circular DNA
min:(Input)Minimum # of matches allowed
max:(Input)Maximum # of matches
begin:(Input)Sequence offset
Input & Output
l:(Modify)List to push hits to
Returns
ajuint:Number of matches

Description

Scan a sequence with a restriction 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 embPatKMPInit

Initialise a Knuth-Morris-Pratt pattern.

Synopsis

Prototype
void embPatKMPInit (
      const AjPStr pat,
      ajuint len,
      ajint* next
);

TypeNameRead/WriteDescription
const AjPStrpatInputpattern
ajuintlenInputlength of pattern
ajint*nextOutputoffset table
void RETURN

Input
pat:(Input)pattern
len:(Input)length of pattern
Output
next:(Output)offset table
Returns
void:No return value

Description

Initialise a Knuth-Morris-Pratt 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 embPatKMPSearch

Perform a Knuth-Morris-Pratt search

Synopsis

Prototype
ajuint embPatKMPSearch (
      const AjPStr str,
      const AjPStr pat,
      ajuint slen,
      ajuint plen,
      const ajint* next,
      ajuint start
);

TypeNameRead/WriteDescription
const AjPStrstrInputstring to search
const AjPStrpatInputpattern to use
ajuintslenInputlength of string
ajuintplenInputlength of pattern
const ajint*nextInputarray from embPatKMPInit (can be -1)
ajuintstartInputposition within str to start search
ajuint RETURNIndex of match in str or -1 if not found

Input
str:(Input)string to search
pat:(Input)pattern to use
slen:(Input)length of string
plen:(Input)length of pattern
next:(Input)array from embPatKMPInit (can be -1)
start:(Input)position within str to start search
Returns
ajuint:Index of match in str or -1 if not found

Description

Perform a Knuth-Morris-Pratt search

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 embPatBMHInit

Initialise a Boyer-Moore-Horspool pattern.

Synopsis

Prototype
void embPatBMHInit (
      const AjPStr pat,
      ajuint len,
      ajint* skip
);

TypeNameRead/WriteDescription
const AjPStrpatInputpattern
ajuintlenInputpattern length
ajint*skipOutputoffset table (can be -1)
void RETURN

Input
pat:(Input)pattern
len:(Input)pattern length
Output
skip:(Output)offset table (can be -1)
Returns
void:No return value

Description

Initialise a Boyer-Moore-Horspool 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 embPatBMHSearch

Perform a Boyer-Moore-Horspool search

Synopsis

Prototype
ajuint embPatBMHSearch (
      const AjPStr str,
      const AjPStr pat,
      ajuint slen,
      ajuint plen,
      const ajint* skip,
      ajuint start,
      AjBool left,
      AjBool right,
      AjPList l,
      const AjPStr name,
      ajuint begin
);

TypeNameRead/WriteDescription
const AjPStrstrInputstring to search
const AjPStrpatInputpattern to use
ajuintslenInputlength of string
ajuintplenInputlength of pattern
const ajint*skipInputarray from embPatBMHInit (can be -1)
ajuintstartInputposition within str to start search
AjBoolleftInputhas to match the start
AjBoolrightInputhas to match the end
AjPListlModifylist to push to
const AjPStrnameInputname of entry
ajuintbeginInputoffset in orig sequence
ajuint RETURNnumber of hits

Input
str:(Input)string to search
pat:(Input)pattern to use
slen:(Input)length of string
plen:(Input)length of pattern
skip:(Input)array from embPatBMHInit (can be -1)
start:(Input)position within str to start search
left:(Input)has to match the start
right:(Input)has to match the end
name:(Input)name of entry
begin:(Input)offset in orig sequence
Input & Output
l:(Modify)list to push to
Returns
ajuint:number of hits

Description

Perform a Boyer-Moore-Horspool search

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 embPatBYPInit

Initialise a Baeza-Yates,Perleberg pattern.

Synopsis

Prototype
void embPatBYPInit (
      const AjPStr pat,
      ajuint len,
      EmbPPatBYPNode offset,
      ajint* buf
);

TypeNameRead/WriteDescription
const AjPStrpatInputpattern
ajuintlenInputpattern length
EmbPPatBYPNodeoffsetOutputcharacter index
ajint*bufOutputmismatch count
void RETURN

Input
pat:(Input)pattern
len:(Input)pattern length
Output
offset:(Output)character index
buf:(Output)mismatch count
Returns
void:No return value

Description

Initialise a Baeza-Yates,Perleberg 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 embPatPushHit

Put a matching string search hit on the heap as an EmbPMatMatch structure

Synopsis

Prototype
void embPatPushHit (
      AjPList l,
      const AjPStr name,
      ajuint pos,
      ajuint plen,
      ajuint begin,
      ajuint mm
);

TypeNameRead/WriteDescription
AjPListlModifylist to push to
const AjPStrnameInputstring name
ajuintposInputSequence match position
ajuintplenInputpattern length
ajuintbeginInputSequence offset
ajuintmmInputnumber of mismatches
void RETURN

Input
name:(Input)string name
pos:(Input)Sequence match position
plen:(Input)pattern length
begin:(Input)Sequence offset
mm:(Input)number of mismatches
Input & Output
l:(Modify)list to push to
Returns
void:No return value

Description

Put a matching string search hit on the heap as an EmbPMatMatch structure

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 embPatBYPSearch

Perform a Baeza-Yates,Perleberg search.

Synopsis

Prototype
ajuint embPatBYPSearch (
      const AjPStr str,
      const AjPStr name,
      ajuint begin,
      ajuint slen,
      ajuint plen,
      ajuint mm,
      EmbPPatBYPNode offset,
      ajint* buf,
      AjPList l,
      AjBool amino,
      AjBool carboxyl,
      const AjPStr pat
);

TypeNameRead/WriteDescription
const AjPStrstrInputsearch string
const AjPStrnameInputsearch string
ajuintbeginInputsequence offset
ajuintslenInputstring length
ajuintplenInputpattern length
ajuintmmInputallowed mismatches (Hamming distance)
EmbPPatBYPNodeoffsetModifycharacter index
ajint*bufModifymismatch count array
AjPListlModifylist to push hits to
AjBoolaminoInputif true, match at amino terminal end
AjBoolcarboxylInputif true, match at carboxyl terminal end
const AjPStrpatInputoriginal pattern
ajuint RETURNnumber of matches

Input
str:(Input)search string
name:(Input)search string
begin:(Input)sequence offset
slen:(Input)string length
plen:(Input)pattern length
mm:(Input)allowed mismatches (Hamming distance)
amino:(Input)if true, match at amino terminal end
carboxyl:(Input)if true, match at carboxyl terminal end
pat:(Input)original pattern
Input & Output
offset:(Modify)character index
buf:(Modify)mismatch count array
l:(Modify)list to push hits to
Returns
ajuint:number of matches

Description

Perform a Baeza-Yates,Perleberg search.

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 embPatClassify

Classify patterns according to type. The pattern is set up upper case, has start and end processing turned into boolean flags. Sets other boolean flags for properties of the pattern so that a suitable processing method can be selected.

Synopsis

Prototype
AjBool embPatClassify (
      const AjPStr pat,
      AjPStr* cleanpat,
      AjBool* amino,
      AjBool* carboxyl,
      AjBool* fclass,
      AjBool* ajcompl,
      AjBool* dontcare,
      AjBool* range,
      AjBool protein
);

TypeNameRead/WriteDescription
const AjPStrpatInputoriginal pattern
AjPStr*cleanpatOutputcleaned pattern
AjBool*aminoOutputset if must match start of sequence
AjBool*carboxylOutputset if must match end of sequence
AjBool*fclassOutputset if class e.g. [ABC]
AjBool*ajcomplOutputset if complement e.g.
AjBool*dontcareOutputset if X (protein) or N (DNA)
AjBool*rangeOutputset if range specified e.g. (3,10)
AjBoolproteinInputtrue if protein false if DNA
AjBool RETURNajTrue on success

Input
pat:(Input)original pattern
protein:(Input)true if protein false if DNA
Output
cleanpat:(Output)cleaned pattern
amino:(Output)set if must match start of sequence
carboxyl:(Output)set if must match end of sequence
fclass:(Output)set if class e.g. [ABC]
ajcompl:(Output)set if complement e.g.
dontcare:(Output)set if X (protein) or N (DNA)
range:(Output)set if range specified e.g. (3,10)
Returns
AjBool:ajTrue on success

Description

Classify patterns according to type. The pattern is set up upper case, has start and end processing turned into boolean flags. Sets other boolean flags for properties of the pattern so that a suitable processing method can be selected.

Usage

ajcompl: ABC

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 embPatSOInit

Initialise a Shift-Or pattern.

Synopsis

Prototype
void embPatSOInit (
      const AjPStr pat,
      ajuint* table,
      ajuint* limit
);

TypeNameRead/WriteDescription
const AjPStrpatInputpattern
ajuint*tableOutputSO table
ajuint*limitOutputmatch limit
void RETURN

Input
pat:(Input)pattern
Output
table:(Output)SO table
limit:(Output)match limit
Returns
void:No return value

Description

Initialise a Shift-Or 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 embPatSOSearch

Perform a Shift-OR search.

Synopsis

Prototype
ajuint embPatSOSearch (
      const AjPStr str,
      const AjPStr name,
      ajint first,
      ajuint begin,
      ajuint plen,
      const ajuint* table,
      ajuint limit,
      AjPList l,
      AjBool amino,
      AjBool carboxyl
);

TypeNameRead/WriteDescription
const AjPStrstrInputsearch string
const AjPStrnameInputsearch string
ajintfirstInputfirst character of pattern (as an integer)
ajuintbeginInputsequence offset
ajuintplenInputpattern length
const ajuint*tableInputSO table
ajuintlimitInputSO limit
AjPListlModifylist to push hits to
AjBoolaminoInputmust match start
AjBoolcarboxylInputmust match end
ajuint RETURNnumber of matches

Input
str:(Input)search string
name:(Input)search string
first:(Input)first character of pattern (as an integer)
begin:(Input)sequence offset
plen:(Input)pattern length
table:(Input)SO table
limit:(Input)SO limit
amino:(Input)must match start
carboxyl:(Input)must match end
Input & Output
l:(Modify)list to push hits to
Returns
ajuint:number of matches

Description

Perform a Shift-OR search.

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 embPatBYGCInit

Initialise a Baeza-Yates Gonnet class pattern.

Synopsis

Prototype
void embPatBYGCInit (
      const AjPStr pat,
      ajuint* m,
      ajuint* table,
      ajuint* limit
);

TypeNameRead/WriteDescription
const AjPStrpatInputpattern
ajuint*mOutputreal pattern length
ajuint*tableOutputSO table
ajuint*limitOutputmatch limit
void RETURN

Input
pat:(Input)pattern
Output
m:(Output)real pattern length
table:(Output)SO table
limit:(Output)match limit
Returns
void:No return value

Description

Initialise a Baeza-Yates Gonnet class 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 embPatBYGSearch

Perform a Baeza-Yates Gonnet search.

Synopsis

Prototype
ajuint embPatBYGSearch (
      const AjPStr str,
      const AjPStr name,
      ajuint begin,
      ajuint plen,
      const ajuint* table,
      ajuint limit,
      AjPList l,
      AjBool amino,
      AjBool carboxyl
);

TypeNameRead/WriteDescription
const AjPStrstrInputsearch string
const AjPStrnameInputsearch string
ajuintbeginInputsequence offset
ajuintplenInputpattern length
const ajuint*tableInputSO table
ajuintlimitInputSO limit
AjPListlModifylist to push hits to
AjBoolaminoInputmust match start
AjBoolcarboxylInputmust match end
ajuint RETURNnumber of matches

Input
str:(Input)search string
name:(Input)search string
begin:(Input)sequence offset
plen:(Input)pattern length
table:(Input)SO table
limit:(Input)SO limit
amino:(Input)must match start
carboxyl:(Input)must match end
Input & Output
l:(Modify)list to push hits to
Returns
ajuint:number of matches

Description

Perform a Baeza-Yates Gonnet search.

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 embPatTUInit

Initialise a Tarhio-Ukkonen search

Synopsis

Prototype
void embPatTUInit (
      const AjPStr pat,
      ajuint** skipm,
      ajuint m,
      ajuint k
);

TypeNameRead/WriteDescription
const AjPStrpatInputpattern
ajuint**skipmOutputmismatch skip array
ajuintmInputreal pattern length
ajuintkInputallowed mismatches
void RETURN

Input
pat:(Input)pattern
m:(Input)real pattern length
k:(Input)allowed mismatches
Output
skipm:(Output)mismatch skip array
Returns
void:No return value

Description

Initialise a Tarhio-Ukkonen search

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 embPatTUSearch

Perform a Tarhio-Ukkonen search

Synopsis

Prototype
ajuint embPatTUSearch (
      const AjPStr pat,
      const AjPStr text,
      ajuint slen,
      ajuint* const* skipm,
      ajuint m,
      ajuint k,
      ajuint begin,
      AjPList l,
      AjBool amino,
      AjBool carboxyl,
      const AjPStr name
);

TypeNameRead/WriteDescription
const AjPStrpatInputpattern
const AjPStrtextInputtext to search (incl ajcompl/class)
ajuintslenInputlength of text
ajuint* const*skipmInputmismatch skip array
ajuintmInputreal pattern length
ajuintkInputallowed mismatches
ajuintbeginInputtext offset
AjPListlModifylist to push to
AjBoolaminoInputtrue if text start
AjBoolcarboxylInputtrue if text end
const AjPStrnameInputname of text
ajuint RETURNnumber of hits

Input
pat:(Input)pattern
text:(Input)text to search (incl ajcompl/class)
slen:(Input)length of text
skipm:(Input)mismatch skip array
m:(Input)real pattern length
k:(Input)allowed mismatches
begin:(Input)text offset
amino:(Input)true if text start
carboxyl:(Input)true if text end
name:(Input)name of text
Input & Output
l:(Modify)list to push to
Returns
ajuint:number of hits

Description

Perform a Tarhio-Ukkonen search

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 embPatTUBInit

Initialise a Tarhio-Ukkonen-Bleasby search

Synopsis

Prototype
void embPatTUBInit (
      const AjPStr pat,
      ajuint** skipm,
      ajuint m,
      ajuint k,
      ajuint plen
);

TypeNameRead/WriteDescription
const AjPStrpatInputpattern
ajuint**skipmOutputmismatch skip array
ajuintmInputreal pattern length
ajuintkInputallowed mismatches
ajuintplenInputfull pattern length (incl ajcompl & class)
void RETURN

Input
pat:(Input)pattern
m:(Input)real pattern length
k:(Input)allowed mismatches
plen:(Input)full pattern length (incl ajcompl & class)
Output
skipm:(Output)mismatch skip array
Returns
void:No return value

Description

Initialise a Tarhio-Ukkonen-Bleasby search

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 embPatTUBSearch

Perform a Tarhio-Ukkonen-Bleasby search

Synopsis

Prototype
ajuint embPatTUBSearch (
      const AjPStr pat,
      const AjPStr text,
      ajuint slen,
      ajuint* const* skipm,
      ajuint m,
      ajuint k,
      ajuint begin,
      AjPList l,
      AjBool amino,
      AjBool carboxyl,
      const AjPStr name,
      ajuint plen
);

TypeNameRead/WriteDescription
const AjPStrpatInputpattern
const AjPStrtextInputtext to search (incl ajcompl/class)
ajuintslenInputlength of text
ajuint* const*skipmInputmismatch skip array
ajuintmInputreal pattern length
ajuintkInputallowed mismatches
ajuintbeginInputtext offset
AjPListlModifylist to push to
AjBoolaminoInputtrue if text start
AjBoolcarboxylInputtrue if text end
const AjPStrnameInputname of text
ajuintplenInputtotal pattern length
ajuint RETURNnumber of hits

Input
pat:(Input)pattern
text:(Input)text to search (incl ajcompl/class)
slen:(Input)length of text
skipm:(Input)mismatch skip array
m:(Input)real pattern length
k:(Input)allowed mismatches
begin:(Input)text offset
amino:(Input)true if text start
carboxyl:(Input)true if text end
name:(Input)name of text
plen:(Input)total pattern length
Input & Output
l:(Modify)list to push to
Returns
ajuint:number of hits

Description

Perform a Tarhio-Ukkonen-Bleasby search

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 embPatBruteForce

Match pattern to a sequence

Synopsis

Prototype
ajuint embPatBruteForce (
      const AjPStr seq,
      const AjPStr pat,
      AjBool amino,
      AjBool carboxyl,
      AjPList l,
      ajuint begin,
      ajuint mm,
      const AjPStr name
);

TypeNameRead/WriteDescription
const AjPStrseqInputtext
const AjPStrpatInputpattern
AjBoolaminoInputtrue if must match start
AjBoolcarboxylInputtrue if must match end
AjPListlModifylist on which to push hits
ajuintbeginInputtext offset
ajuintmmInputallowed mismatches
const AjPStrnameInputtext entry name
ajuint RETURNnumber of hits

Input
seq:(Input)text
pat:(Input)pattern
amino:(Input)true if must match start
carboxyl:(Input)true if must match end
begin:(Input)text offset
mm:(Input)allowed mismatches
name:(Input)text entry name
Input & Output
l:(Modify)list on which to push hits
Returns
ajuint:number of hits

Description

Match pattern to a 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 embPatVariablePattern

Match variable pattern against constant text. Used for matching many patterns against one sequence.

Synopsis

Prototype
ajuint embPatVariablePattern (
      const AjPStr pattern,
      const AjPStr text,
      const AjPStr patname,
      AjPList l,
      ajuint mode,
      ajuint mismatch,
      ajuint begin
);

TypeNameRead/WriteDescription
const AjPStrpatternInputpattern to match
const AjPStrtextInputtext to scan
const AjPStrpatnameInputID or AC of pattern
AjPListlModifylist on which to push hits
ajuintmodeInput1 for protein, 0 for nucleic acid
ajuintmismatchInputallowed mismatches
ajuintbeginInputtext offset
ajuint RETURNnumber of hits

Input
pattern:(Input)pattern to match
text:(Input)text to scan
patname:(Input)ID or AC of pattern
mode:(Input)1 for protein, 0 for nucleic acid
mismatch:(Input)allowed mismatches
begin:(Input)text offset
Input & Output
l:(Modify)list on which to push hits
Returns
ajuint:number of hits

Description

Match variable pattern against constant text. Used for matching many patterns against one 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 embPatRestrictPreferred

Replace RE names by the name of the prototype for that RE

Synopsis

Prototype
void embPatRestrictPreferred (
      AjPList l,
      const AjPTable t
);

TypeNameRead/WriteDescription
AjPListlModifylist of EmbPMatMatch hits
const AjPTabletInputtable from embossre.equ file
void RETURN

Input
t:(Input)table from embossre.equ file
Input & Output
l:(Modify)list of EmbPMatMatch hits
Returns
void:No return value

Description

Replace RE names by the name of the prototype for that RE

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 embPatRestrictRestrict

Cut down the number of restriction enzyme hits from embPatRestrictScan Notably double reporting of symmetric palindromes and reporting of isoschizomers. Also provides an optional alphabetic sort.

If we don't allow isoschizomers, then names of all isoschizomers found will be added to the string 'iso' in the returned list of EmbPMatMatch structures. If 'isos' is AjTrue then they will be left alone.

Synopsis

Prototype
ajuint embPatRestrictRestrict (
      AjPList l,
      ajuint hits,
      AjBool isos,
      AjBool alpha
);

TypeNameRead/WriteDescription
AjPListlModifylist of hits from embPatRestrictScan
ajuinthitsInputnumber of hits from embPatRestrictScan
AjBoolisosInputAllow isoschizomers
AjBoolalphaInputSort alphabetically
ajuint RETURNadjusted number of hits

Input
hits:(Input)number of hits from embPatRestrictScan
isos:(Input)Allow isoschizomers
alpha:(Input)Sort alphabetically
Input & Output
l:(Modify)list of hits from embPatRestrictScan
Returns
ajuint:adjusted number of hits

Description

Cut down the number of restriction enzyme hits from embPatRestrictScan Notably double reporting of symmetric palindromes and reporting of isoschizomers. Also provides an optional alphabetic sort.

If we don't allow isoschizomers, then names of all isoschizomers found will be added to the string 'iso' in the returned list of EmbPMatMatch structures. If 'isos' is AjTrue then they will be left alone.

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 embPatRestrictStartCompare

Sort restriction site hits on the basis of start position

Synopsis

Prototype
ajint embPatRestrictStartCompare (
      const void* a,
      const void* b
);

TypeNameRead/WriteDescription
const void*aInputFirst EmbPMatMatch hit
const void*bInputSecond EmbPMatMatch hit
ajint RETURN0 if a and b are equal -ve if a is less than b, +ve if a is greater than b

Input
a:(Input)First EmbPMatMatch hit
b:(Input)Second EmbPMatMatch hit
Returns
ajint:0 if a and b are equal -ve if a is less than b, +ve if a is greater than b

Description

Sort restriction site hits on the basis of start position

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 embPatRestrictCutCompare

Sort restriction site hits on the basis of cut position

Synopsis

Prototype
ajint embPatRestrictCutCompare (
      const void* a,
      const void* b
);

TypeNameRead/WriteDescription
const void*aInputFirst EmbPMatMatch hit
const void*bInputSecond EmbPMatMatch hit
ajint RETURN0 if a and b are equal -ve if a is less than b, +ve if a is greater than b

Input
a:(Input)First EmbPMatMatch hit
b:(Input)Second EmbPMatMatch hit
Returns
ajint:0 if a and b are equal -ve if a is less than b, +ve if a is greater than b

Description

Sort restriction site hits on the basis of cut position

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 embPatRestrictNameCompare

Sort restriction site hits on the basis of enzyme name

Synopsis

Prototype
ajint embPatRestrictNameCompare (
      const void* a,
      const void* b
);

TypeNameRead/WriteDescription
const void*aInputFirst EmbPMatMatch hit
const void*bInputSecond EmbPMatMatch hit
ajint RETURN0 if a and b are equal -ve if a is less than b, +ve if a is greater than b

Input
a:(Input)First EmbPMatMatch hit
b:(Input)Second EmbPMatMatch hit
Returns
ajint:0 if a and b are equal -ve if a is less than b, +ve if a is greater than b

Description

Sort restriction site hits on the basis of enzyme name

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 embPatRestrictMatch

Main Restriction function. Scans sequence and rejects unwanted cutters

Synopsis

Prototype
ajuint embPatRestrictMatch (
      const AjPSeq seq,
      ajuint begin,
      ajuint end,
      AjPFile enzfile,
      AjPFile methfile,
      const AjPStr enzymes,
      ajuint sitelen,
      AjBool plasmid,
      AjBool ambiguity,
      ajuint min,
      ajuint max,
      AjBool blunt,
      AjBool sticky,
      AjBool commercial,
      AjBool methyl,
      AjPList l
);

TypeNameRead/WriteDescription
const AjPSeqseqInputsequence
ajuintbeginInputstart position in sequence
ajuintendInputend position in sequence
AjPFileenzfileModifyfile pointer to .enz file
AjPFilemethfileModifyfile pointer to methylation data file
const AjPStrenzymesInputcomma separated list of REs or NULL for all
ajuintsitelenInputminimum length of recognition site
AjBoolplasmidInputCircular DNA
AjBoolambiguityInputAllow ambiguities
ajuintminInputminimum number of true cuts
ajuintmaxInputmaximum number of true cuts
AjBoolbluntInputAllow blunt cutters
AjBoolstickyInputAllow sticky cutters
AjBoolcommercialInputAllow Only report REs with a supplier
AjBoolmethylInputMark methylated bases as 'N'
AjPListlModifylist for (EmbPMatMatch) hits
ajuint RETURNnumber of hits

Input
seq:(Input)sequence
begin:(Input)start position in sequence
end:(Input)end position in sequence
enzymes:(Input)comma separated list of REs or NULL for all
sitelen:(Input)minimum length of recognition site
plasmid:(Input)Circular DNA
ambiguity:(Input)Allow ambiguities
min:(Input)minimum number of true cuts
max:(Input)maximum number of true cuts
blunt:(Input)Allow blunt cutters
sticky:(Input)Allow sticky cutters
commercial:(Input)Allow Only report REs with a supplier
methyl:(Input)Mark methylated bases as 'N'
Input & Output
enzfile:(Modify)file pointer to .enz file
methfile:(Modify)file pointer to methylation data file
l:(Modify)list for (EmbPMatMatch) hits
Returns
ajuint:number of hits

Description

Main Restriction function. Scans sequence and rejects unwanted cutters

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 embPatGetType

Return the type of a pattern

Synopsis

Prototype
ajuint embPatGetType (
      const AjPStr pattern,
      AjPStr* cleanpat,
      ajuint mismatch,
      AjBool protein,
      ajuint* m,
      AjBool* left,
      AjBool* right
);

TypeNameRead/WriteDescription
const AjPStrpatternInputoriginal pattern
AjPStr*cleanpatOutputcleaned pattern
ajuintmismatchInputnumber of allowed mismatches
AjBoolproteinInputtrue if protein
ajuint*mOutputreal length of pattern
AjBool*leftOutputmust match left begin
AjBool*rightOutputmust match right
ajuint RETURNtype of pattern

Input
pattern:(Input)original pattern
mismatch:(Input)number of allowed mismatches
protein:(Input)true if protein
Output
cleanpat:(Output)cleaned pattern
m:(Output)real length of pattern
left:(Output)must match left begin
right:(Output)must match right
Returns
ajuint:type of pattern

Description

Return the type of a 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 embPatCompile

Compile a pattern classified by embPatGetType

Synopsis

Prototype
void embPatCompile (
      ajuint type,
      const AjPStr pattern,
      ajuint* plen,
      ajint** buf,
      EmbPPatBYPNode off,
      ajuint** sotable,
      ajuint* solimit,
      ajuint* m,
      AjPStr* regexp,
      ajuint*** skipm,
      ajuint mismatch
);

TypeNameRead/WriteDescription
ajuinttypeInputpattern type
const AjPStrpatternInputoriginal pattern
ajuint*plenOutputpattern length
ajint**bufOutputbuffer for BMH and BYP search (can be -1)
EmbPPatBYPNodeoffOutputoffset buffer for B-Y/P search
ajuint**sotableOutputbuffer for SHIFT-OR
ajuint*solimitOutputlimit for SHIFT-OR
ajuint*mOutputreal length of pattern (from embPatGetType)
AjPStr*regexpOutputPCRE regexp string
ajuint***skipmOutputskip buffer for Tarhio-Ukkonen
ajuintmismatchInputnumber of allowed mismatches
void RETURN

Input
type:(Input)pattern type
pattern:(Input)original pattern
mismatch:(Input)number of allowed mismatches
Output
plen:(Output)pattern length
buf:(Output)buffer for BMH and BYP search (can be -1)
off:(Output)offset buffer for B-Y/P search
sotable:(Output)buffer for SHIFT-OR
solimit:(Output)limit for SHIFT-OR
m:(Output)real length of pattern (from embPatGetType)
regexp:(Output)PCRE regexp string
skipm:(Output)skip buffer for Tarhio-Ukkonen
Returns
void:No return value

Description

Compile a pattern classified by embPatGetType

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 embPatFuzzSearch

Fuzzy search after embPatGetType and embPatCompile

Synopsis

Prototype
void embPatFuzzSearch (
      ajuint type,
      ajuint begin,
      const AjPStr pattern,
      const AjPStr name,
      const AjPStr text,
      AjPList l,
      ajuint plen,
      ajuint mismatch,
      AjBool left,
      AjBool right,
      ajint* buf,
      EmbPPatBYPNode off,
      const ajuint* sotable,
      ajuint solimit,
      const AjPStr regexp,
      ajuint* const* skipm,
      ajuint* hits,
      ajuint m,
      const void** tidy
);

TypeNameRead/WriteDescription
ajuinttypeInputpattern type
ajuintbeginInputtext displacement (1=start)
const AjPStrpatternInputprocessed pattern
const AjPStrnameInputname associated with text
const AjPStrtextInputtext
AjPListlModifylist to push hits onto
ajuintplenInputpattern length
ajuintmismatchInputnumber of allowed mismatches
AjBoolleftInputmust match left
AjBoolrightInputmust match right
ajint*bufModifybuffer for BMH search
EmbPPatBYPNodeoffModifyoffset buffer for B-Y/P search
const ajuint*sotableInputbuffer for SHIFT-OR
ajuintsolimitInputlimit for SHIFT-OR
const AjPStrregexpInputPCRE regexp string
ajuint* const*skipmInputskip buffer for Tarhio-Ukkonen-Bleasby
ajuint*hitsOutputnumber of hits
ajuintmInputreal pat length (from embPatGetType/embPatCompile)
const void**tidyOutputdata to free
void RETURN

Input
type:(Input)pattern type
begin:(Input)text displacement (1=start)
pattern:(Input)processed pattern
name:(Input)name associated with text
text:(Input)text
plen:(Input)pattern length
mismatch:(Input)number of allowed mismatches
left:(Input)must match left
right:(Input)must match right
sotable:(Input)buffer for SHIFT-OR
solimit:(Input)limit for SHIFT-OR
regexp:(Input)PCRE regexp string
skipm:(Input)skip buffer for Tarhio-Ukkonen-Bleasby
m:(Input)real pat length (from embPatGetType/embPatCompile)
Output
hits:(Output)number of hits
tidy:(Output)data to free
Input & Output
l:(Modify)list to push hits onto
buf:(Modify)buffer for BMH search
off:(Modify)offset buffer for B-Y/P search
Returns
void:No return value

Description

Fuzzy search after embPatGetType and embPatCompile

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 embPatCompileII

Compile a pattern classified by embPatGetType

Synopsis

Prototype
void embPatCompileII (
      AjPPatComp thys,
      ajuint mismatch
);

TypeNameRead/WriteDescription
AjPPatCompthysModifyProsite pattern stucture
ajuintmismatchInputnumber of allowed mismatches
void RETURN

Input
mismatch:(Input)number of allowed mismatches
Input & Output
thys:(Modify)Prosite pattern stucture
Returns
void:No return value

Description

Compile a pattern classified by embPatGetType

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 embPatFuzzSearchII

Fuzzy search after embPatGetType and embPatCompile

Synopsis

Prototype
void embPatFuzzSearchII (
      AjPPatComp thys,
      ajuint begin,
      const AjPStr name,
      const AjPStr text,
      AjPList l,
      ajuint mismatch,
      ajuint* hits,
      const void** tidy
);

TypeNameRead/WriteDescription
AjPPatCompthysModifyProsite pattern stucture
ajuintbeginInputSequence displacement (1=start)
const AjPStrnameInputName associated with sequence
const AjPStrtextInputSequence
AjPListlModifyList to push hits onto
ajuintmismatchInputnumber of allowed mismatches
ajuint*hitsOutputnumber of hits
const void**tidyOutputdata to free
void RETURN

Input
begin:(Input)Sequence displacement (1=start)
name:(Input)Name associated with sequence
text:(Input)Sequence
mismatch:(Input)number of allowed mismatches
Output
hits:(Output)number of hits
tidy:(Output)data to free
Input & Output
thys:(Modify)Prosite pattern stucture
l:(Modify)List to push hits onto
Returns
void:No return value

Description

Fuzzy search after embPatGetType and embPatCompile

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 embPatGetTypeII

Return the type of a pattern

Synopsis

Prototype
ajuint embPatGetTypeII (
      AjPPatComp thys,
      const AjPStr pattern,
      ajuint mismatch,
      AjBool protein
);

TypeNameRead/WriteDescription
AjPPatCompthysModifyProsite pattern stucture
const AjPStrpatternInputOriginal pattern
ajuintmismatchInputNumber of allowed mismatches
AjBoolproteinInputTrue if protein
ajuint RETURNtype of pattern

Input
pattern:(Input)Original pattern
mismatch:(Input)Number of allowed mismatches
protein:(Input)True if protein
Input & Output
thys:(Modify)Prosite pattern stucture
Returns
ajuint:type of pattern

Description

Return the type of a 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