Neweyes

A

System

for

Comparing

Biological

Sequences

Using

the

Running

Karp-Rabin

Greedy

String-Tiling

Michael

J.

Wise

Department

of

Computer

Science

University

of

Sydney

Australia

michaelw@cs.su.oz.au

FAX

Abstract

A

system

for

aligning

nucleotide

or

amino

acid

biosequences

is

described

The

system

called

Neweyes

employs

a

novel

string

matching

algorithm

Running

Karp-Rabin

Greedy

String

Tiling

-LRB-

RKR-GST

-RRB-

which

involves

tiling

one

string

with

matching

substrings

of

a

second

string

In

practice

RKR-GST

has

a

computational

complexity

that

appears

close

to

linear

With

RKR-GST

Neweyes

is

able

to

detect

transposed

substrings

Neweyes

also

supports

a

form

of

matching-bygroup

that

gives

the

effect

of

different

amino

acid

mutation

matrices

Neweyes

can

be

used

in

a

macro

mode

-LRB-

searching

a

database

for

a

list

of

biosequences

that

are

similar

to

a

given

biosequence

-RRB-

or

in

a

micro

mode

where

two

biosequences

are

compared

and

more

detailed

output

formats

are

available

Submitted

to

Software

Practice

and

Experience

Neweyes

A

System

for

Comparing

Biological

Sequences

Using

the

Running

Karp-Rabin

Greedy

String-Tiling

Algorithm

Abstract

A

system

for

aligning

nucleotide

or

amino

acid

biosequences

is

described

The

system

called

Neweyes

employs

a

novel

string

matching

algorithm

Running

Karp-Rabin

Greedy

String

Tiling

-LRB-

RKR-GST

-RRB-

which

involves

tiling

one

string

with

matching

substrings

of

a

second

string

In

practice

RKR-GST

has

a

computational

complexity

that

appears

close

to

linear

With

RKR-GST

Neweyes

is

able

to

detect

transposed

substrings

Neweyes

also

supports

a

form

of

matching-bygroup

that

gives

the

effect

of

different

amino

acid

mutation

matrices

Neweyes

can

be

used

in

a

macro

mode

-LRB-

searching

a

database

for

a

list

of

biosequences

that

are

similar

to

a

given

biosequence

-RRB-

or

in

a

micro

mode

where

two

biosequences

are

compared

and

more

detailed

output

formats

are

available

Introduction

What

will

be

described

in

this

paper

is

a

system

called

for

aligning

nucleotide

or

amino

acid

biosequences

Stated

in

computer

science

terms

and

in

its

simplest

form

the

problem

faced

by

any

alignment

program

is

given

two

strings

to

determine

the

degree

of

similarity

between

the

strings

The

result

may

then

expressed

as

either

a

percentage

match

value

the

length

of

the

common

portions

or

as

a

printout

showing

the

common

portions

Neweyes

employs

a

novel

string

matching

algorithm

Running

Karp-Rabin

Greedy

String

Tiling

-LRB-

RKR-GST

-RRB-

which

will

be

outlined

below

-LRB-

For

a

complete

description

the

reader

should

consult

-LSB-

-RSB-

-RRB-

Before

looking

at

the

facilities

provided

by

Neweyes

and

more

specifically

at

the

RKR-GST

algorithm

it

is

worth

canvassing

the

systems

currently

in

use

The

first

system

to

address

the

biosequence

alignment

problem

was

due

to

Needleman

and

Wunsch

-LSB-

-RSB-

and

uses

dynamic

programming

A

similar

approached

evolved

in

the

computer

science

literature

where

the

problem

came

to

be

known

as

the

longest

common

-LRB-

LCS

-RRB-

problem

The

Needleman

Wunsch

system

was

in

fact

one

of

the

earliest

solutions

to

these

similar

problems

Summarising

the

LCS

problem

if

S

is

a

string

a

subsequence

of

string

S

is

formed

by

taking

elements

in

order

from

S

where

zero

or

more

elements

are

ignored

before

another

is

taken

-LRB-

By

contrast

substrings

allow

no

gaps

-RRB-

The

LCS

of

two

strings

S

and

T

is

the

sequence

of

elements

common

to

the

two

strings

such

that

no

longer

sequence

is

available

-LRB-

though

there

may

be

multiple

sequences

with

the

same

maximal

length

-RRB-

There

are

many

discussions

of

LCS

in

the

literature

-LRB-

e.g.

recent

ones

by

Cormen

Leiserson

Rivest

-LSB-

-RSB-

and

Gonnet

Baeza-Yates

-LSB-

-RSB-

-RRB-

What

is

interesting

about

the

Needleman

Wunsch

approach

is

they

add

the

concept

of

gap

penalties

-LRB-

which

means

however

that

the

resulting

sequence

may

have

fewer

gaps

that

the

LCS

but

may

also

cover

fewer

than

the

maximum

number

of

elements

It

is

also

worth

noting

that

the

Needleman

Wunsch

algorithm

only

had

positive

values

-LRB-

based

on

the

number

of

base

changes

in

each

codon

-RRB-

so

a

global

alignment

is

produced

-LRB-

i.e.

involving

the

entirety

of

both

input

strings

-RRB-

A

form

the

the

Needleman

Wunsch

algorithm

that

has

become

popular

is

due

to

Smith

and

Waterman

-LSB-

-RSB-

and

involves

finding

what

have

come

to

be

known

as

local

alignments

That

is

by

allowing

gap

penalties

to

increase

as

a

function

of

gap

or

insertion

alignment

scores

may

be

reduced

to

zero

This

effect

is

strengthened

by

the

authors

decision

to

also

use

negative

values

for

non-matches

What

is

produced

is

a

sequence

that

need

not

be

bounded

by

the

ends

of

the

input

strings

Once

again

only

a

single

-LRB-

local

-RRB-

sequence

is

produced

The

computational

cost

of

algorithms

based

on

dynamic

programming

can

be

shown

to

be

O

-LRB-

n

-RRB-

With

the

different

perspective

that

the

system

offers

the

name

is

meant

to

suggest

looking

at

the

world

through

new

eyes

However

the

name

is

in

fact

an

acronym

taken

from

a

line

of

the

Tom

Lehrer

song

Lobachevsky

-LRB-

Let

-RRB-

Noone

Else

's

Work

Evade

Your

EyeS

reflecting

the

underlying

algorithm

's

ancestry

in

the

detection

of

suspected

plagiarism

-LSB-

-RSB-

This

use

of

sequence

should

not

be

confused

with

the

biologist

's

use

of

the

term

sequence

which

is

a

string

or

sequence

of

nucleotides

or

amino

acids

I

shall

refer

to

the

latter

alternatives

as

biosequences

The

gap

penalties

are

these

days

separated

into

a

gap

creation

penalty

and

a

gap

extension

penalty

-LSB-

-RSB-

-LSB-

-RSB-

Furthermore

the

choice

of

suitable

gap

creation

and

gap

extension

penalties

appears

problematic

but

have

substantial

bearing

on

the

results

returned

by

the

algorithms

Another

system

that

has

achieved

prominence

is

FASTA/FASTP

-LRB-

-LSB-

-RSB-

-LSB-

-RSB-

-LSB-

-RSB-

-RRB-

The

main

reason

for

this

prominence

is

that

FASTA

and

its

companion

programs

are

computationally

far

cheaper

than

the

earlier

systems

involving

dynamic

programming

but

are

able

to

retain

reasonable

accuracy

Where

FASTA

achieves

much

of

this

improvement

is

in

its

use

of

multiple

phases

in

the

construction

of

an

alignment

Most

of

the

improvement

in

speed

is

achieved

in

the

first

phase

where

overlapping

substrings

from

one

of

the

biosequences

are

encoded

in

two

one

dimensional

arrays

using

algorithms

due

to

Dumas

and

Ninio

-LSB-

-RSB-

The

substrings

are

of

a

fixed

size

specified

by

an

input

parameter

k

and

are

called

k-tuples

the

value

of

k

is

typically

or

for

amino

acids

and

or

for

nucleotides

The

first

array

of

size

ak

a

either

for

nucleotides

or

for

amino

acids

marks

the

first

instance

of

any

particular

k-tuple

the

second

array

with

size

equal

to

the

input

biosequence

that

is

being

encoded

links

the

successive

occurrences

of

the

various

k-tuples

-LRB-

each

cell

points

to

the

next

occurrence

of

that

k-tuple

-RRB-

By

tracing

through

the

second

biosequence

all

matching

k-tuples

can

be

found

The

matching

k-tuples

are

arranged

in

groups

called

diagonals

where

all

the

k-tuples

on

a

given

diagonal

are

the

same

distance

from

a

notional

perfect

match

-LSB-

-RSB-

Local

regions

with

a

high

density

of

ktuples

are

then

identified

-LSB-

-RSB-

In

the

second

phase

the

ten

regions

with

the

highest

score

are

reevaluated

using

the

PAM

matrix

and

for

each

of

these

regions

the

subregion

is

found

with

the

best

score

and

reported

as

the

score

-LRB-

The

regions

are

still

without

gaps

-RRB-

In

the

third

phase

regions

that

are

adjacent

are

joined

depending

on

their

respective

scores

and

joining

penalty

The

new

score

is

reported

is

the

initn

score

In

the

final

phase

a

Needleman

Wunsch

alignment

is

performed

on

those

pairs

of

sequences

that

had

the

highest

initn

scores

In

summary

FASTA

achieves

its

greater

speed

due

to

its

use

of

a

fast

but

fairly

insensitive

first

phase

which

reduces

the

amount

of

work

required

in

the

more

expensive

third

and

fourth

phases

joining

of

regions

is

expensive

but

is

limited

to

the

best

and

Needleman

Wunsch

alignments

are

expensive

but

are

now

limited

to

those

pairs

of

biosequences

with

the

best

initn

scores

However

this

strength

is

also

a

source

of

some

weakness

As

noted

by

several

authors

e.g.

States

and

Boguski

-LSB-

-RSB-

chosing

a

larger

value

for

k

e.g.

in

the

case

of

amino

acids

may

mean

that

matches

are

missed

due

to

the

requirement

for

an

exact

matching

over

the

entire

ktuple

That

is

k-tuples

of

amino

acids

that

mutationally

equivalent

will

be

by-passed

in

the

first

phase

as

they

are

not

exactly

equivalent

and

therefore

not

be

available

for

the

second

and

subsequent

phases

The

third

system

to

have

become

very

popular

in

recent

times

is

BLAST

-LSB-

-RSB-

While

the

Needleman

Wunsch/Smith

Waterman

systems

are

able

to

deal

with

biosequences

containing

gaps

and

FASTA

introduces

something

similar

to

gaps

in

the

process

of

joining

adjacent

regions

BLAST

deals

exclusively

with

ungapped

biosequences

However

what

is

lost

by

disregarding

gapped

sequences

is

compensated

for

by

the

very

fast

execution

times

due

to

the

construction

of

a

finite

state

machine

to

recognise

all

substrings

of

some

fixed

size

-LRB-

called

w-mers

-RRB-

of

the

query

biosequence

that

score

above

a

given

threshold

value

-LRB-

Given

the

presence

of

mutations

the

authors

estimate

that

each

residue

in

the

query

biosequence

will

typically

contribute

w-mers

to

the

finite

state

machine

-RRB-

Hits

generated

by

the

scan

are

then

extended

until

the

score

for

the

extended

match

falls

below

better

scoring

shorter

matches

Running

Karp-Rabin

Greedy

String

Tiling

Exact

Matching

In

this

section

the

algorithm

underlying

Neweyes

will

be

described

To

keep

matters

reasonably

simple

I

shall

just

describe

the

algorithm

for

exact

matching

-LRB-

e.g.

as

would

be

used

when

comparing

DNA

biosequences

-RRB-

The

extension

of

the

algorithm

to

proteins

will

be

described

in

the

next

section

Unfortunately

in

order

to

make

more

precise

what

I

intend

with

this

algorithm

I

must

begin

with

some

definitions

In

this

I

shall

retain

from

the

literature

on

strings

the

terms

pattern-string

-LRB-

here

labelled

as

P

-RRB-

and

text-string

-LRB-

labelled

as

T

-RRB-

but

in

the

present

context

the

only

difference

is

that

pattern

string

is

the

shorter

of

the

two

Definition

A

maximal-match

is

where

a

substring

P

p

of

the

pattern

string

starting

at

p

matches

element

by

element

a

substring

T

t

of

the

text

string

starting

at

t

The

match

is

assumed

to

be

as

long

as

possible

i.e

until

a

non-match

or

end-of-string

are

encountered

or

until

one

of

the

elements

is

found

to

be

marked

-LRB-

Marking

will

be

discussed

presently

-RRB-

Maximal-matches

are

temporary

and

possibly

not

unique

associations

i.e.

a

substring

involved

in

one

maximal-match

may

form

part

of

several

other

maximal-matches

Definition

A

tile

is

a

permanent

and

unique

-LRB-

one-to-one

-RRB-

association

of

a

substring

from

P

with

a

matching

substring

from

T

In

the

process

of

forming

a

tile

from

a

maximal-match

tokens

of

the

two

substrings

are

marked

and

thereby

become

unavailable

for

further

matches

With

the

definitions

of

tiles

and

maximal-matches

in

place

it

is

worth

noting

that

in

many

situations

isolated

short

maximal-matches

can

be

ignored

For

example

it

is

unlikely

that

a

maximal-match

of

length

or

would

be

significant

when

comparing

amino

acid

biosequences

For

DNA

biosequences

maximal-matches

involving

less

than

bases

can

be

ignored

The

following

definition

is

therefore

made

Definition

A

minimum-match-length

is

defined

such

that

maximal-matches

-LRB-

and

hence

tiles

-RRB-

below

this

length

are

ignored

The

minimum-match-length

can

be

but

in

general

will

be

an

integer

greater

than

Ideally

what

is

being

sought

by

the

new

algorithm

is

a

maximal

tiling

of

P

and

T

i.e.

a

coverage

of

nonoverlapping

substrings

of

T

with

non-overlapping

substrings

of

P

which

maximises

the

number

of

tokens

-LRB-

amino

acids

or

bases

-RRB-

that

have

been

covered

by

tiles

Unfortunately

an

algorithm

which

produces

a

maximal

tiling

and

computes

in

polynomial

time

is

an

open

problem

Part

of

the

difficulty

lies

in

the

possibility

that

several

small

tiles

could

collectively

cover

more

tokens

than

a

smaller

number

of

larger

tiles

To

motivate

the

transition

to

a

computationally

more

reasonable

measure

of

similarity

it

is

worth

observing

that

longer

tiles

are

preferable

to

shorter

ones

because

long

tiles

are

more

likely

to

reflect

significant

similar

regions

in

the

source

biosequences

rather

than

chance

similarities

Notice

also

that

this

model

encompasses

substrings

not

subsequences

so

debates

arising

from

the

choice

of

suitable

gap

penalties

does

not

arise

but

observe

that

the

effect

of

gap

penalties

in

the

other

algorithms

particularly

when

large

values

are

chosen

is

to

coerce

sequences

into

strings

With

this

in

mind

the

following

greedy

algorithm

is

proposed

The

algorithm

involves

multiple

passes

each

pass

having

two

phases

In

the

first

phase

called

scanpattern

all

maximal-matches

of

a

certain

size

or

greater

are

collected

This

size

is

called

the

search

length

In

the

second

phase

called

markstrings

maximal-matches

are

taken

one

at

a

time

starting

with

the

longest

and

tested

to

see

whether

they

have

been

occluded

by

a

sibling

tile

-LRB-

i.e.

part

of

the

maximal-match

is

already

marked

-RRB-

If

not

a

tile

is

created

by

marking

the

two

substrings

When

all

the

maximal-matches

have

been

dealt

with

a

new

smaller

search

length

is

chosen

The

top-level

algorithm

is

search-length

s

initial-search-length

Currently

stop

false

Repeat

Lmax

scanpattern

-LRB-

s

-RRB-

Lmax

is

the

size

of

the

largest

maximal-matches

found

in

this

iteration

if

Lmax

s

then

s

Lmax

Very

long

string

do

n't

mark

tiles

but

try

again

with

larger

s

else

markstrings

-LRB-

s

-RRB-

Create

tiles

from

matches

takes

from

list

of

queues

if

s

then

s

s

div

else

if

s

then

s

else

stop

true

until

stop

So

far

what

has

been

described

relates

solely

to

Greedy

String-Tiling

It

is

in

the

algorithm

for

scanpattern

that

Running

Karp-Rabin

matching

is

used

to

find

all

the

maximal

matches

above

a

certain

size

The

basis

of

the

well-known

Karp-Rabin

string

matching

algorithm

-LSB-

-RSB-

is

that

if

a

hash-value

exists

for

a

string

of

length

s

starting

at

t

the

hash-value

for

a

string

of

length

s

starting

at

t

can

be

calculated

using

a

simple

recurrence

relation

In

particular

if

the

length

of

the

pattern

string

is

P

the

hash-value

of

every

substring

of

length

P

from

the

text

string

is

compared

with

the

hash-value

of

the

pattern

string

If

two

hashvalues

are

identical

the

pattern

and

text

substrings

are

compared

element-by-element

-LRB-

The

version

of

the

recurrence

relation

used

in

this

work

is

due

to

Gonnet

and

Baeza-Yates

-LSB-

-RSB-

-RRB-

Running

Karp-Rabin

matching

extends

Karp-Rabin

matching

in

the

following

ways

Instead

of

having

a

single

hash-value

for

the

entire

pattern

string

a

hash-value

is

created

for

each

-LRB-

unmarked

-RRB-

substring

of

length

s

of

the

pattern

string

i.e.

for

the

substrings

P

p

P

p

s

p

in

the

range

P

s

Hash-values

are

similarly

created

for

each

-LRB-

unmarked

-RRB-

substring

of

the

length

s

of

the

text

string

Each

of

the

hash-values

for

the

pattern

string

is

then

compared

with

the

hash-values

for

text

string

and

for

those

pairs

of

pattern

and

text

hash-values

found

to

be

equal

there

are

possible

matches

between

the

corresponding

pattern

and

text

substrings

A

hash-table

of

the

text-string

Karp-Rabin

hash-values

is

used

to

reduce

the

otherwise

O

-LRB-

n

-RRB-

cost

of

this

comparison

That

is

rather

than

having

to

scan

the

entire

text

string

for

the

matching

hash-value

corresponding

to

a

particular

pattern

substring

the

pattern

Karp-Rabin

hash-value

is

itself

hashed

and

a

hash-table

search

returns

the

starting

positions

of

all

text

substrings

-LRB-

of

length

s

-RRB-

with

the

same

Karp-Rabin

hash-value

Note

that

after

a

successful

match

of

both

the

Karp-Rabin

hash-values

and

the

actual

substrings

the

element-by-element

matching

continues

until

two

elements

fail

to

match

or

until

a

marked

element

or

end-of-string

are

found

In

this

way

the

matches

are

converted

to

maximal-matches

-LRB-

In

other

words

length

s

is

the

minimum

match-length

being

sought

during

one

iteration

-RRB-

The

algorithm

for

scanpattern

-LRB-

s

-RRB-

s

the

current

search-length

is

starting

at

the

first

unmarked

token

of

T

for

each

unmarked

T

t

do

if

distance

to

next

tile

s

then

advance

t

to

first

unmarked

token

after

next

tile

Just

for

efficiency

else

create

the

KR

hash-value

for

substring

T

t

T

t

s

and

add

to

hashtable

Starting

at

the

first

unmarked

token

of

P

for

each

unmarked

P

p

do

if

distance

to

next

tile

s

then

advance

p

to

first

unmarked

token

after

next

tile

else

create

the

KR

hash-value

for

substring

P

p

P

p

s

check

hashtable

for

hash

of

KR

hash-value

for

each

hash-table

entry

with

equal

hashed

KR

hash-value

do

k

s

while

P

p

k

T

t

k

AND

unmarked

-LRB-

P

p

k

-RRB-

AND

unmarked

-LRB-

T

t

k

-RRB-

do

k

k

Extend

match

until

non-match

or

element

marked

if

k

s

then

return

-LRB-

k

-RRB-

abandon

scan

will

be

restarted

with

s

k

else

record

new

maximal-match

return

-LRB-

length

of

longest

maximal-match

-RRB-

The

structure

used

to

record

the

maximal

matches

is

a

doubly-linked-list

of

queues

where

each

queue

records

maximal-matches

of

the

same

length

and

the

list

of

queues

is

ordered

by

decreasing

length

A

pointer

is

also

kept

to

the

queue

onto

which

the

most

recent

maximal-match

was

appended

because

there

is

a

high

probability

that

the

next

maximal-match

will

be

similar

in

length

to

the

last

and

therefore

will

be

appended

to

the

same

queue

or

one

that

is

close

by

markstrings

also

has

the

parameter

s

the

search-length

starting

with

the

top

queue

while

there

is

a

non-empty

queue

do

if

the

current

queue

is

empty

then

drop

to

next

queue

corresponding

to

smaller

maximal-matches

else

remove

match

-LRB-

p

t

L

-RRB-

from

queue

Assume

the

length

of

maximal-matches

in

the

current

queue

is

L

if

match

not

occluded

then

if

for

all

j

s

P

p

j

T

t

j

then

IE

match

is

not

hash

artefact

for

j

to

L

do

-LRB-

P

p

j

-RRB-

-LRB-

T

t

j

-RRB-

L

else

if

L

L

occluded

s

then

IE

the

unmarked

part

remaining

of

the

maximal-match

replace

unmarked

portion

on

list

of

queues

Note

that

the

test

of

whether

maximal-match

is

really

a

match

has

been

deferred

from

scanpattern

where

it

normally

would

reside

to

markstrings

-LRB-

remember

that

all

putative

matches

found

due

to

hashing

must

be

tested

element-by-element

because

equivalence

of

hash-values

does

not

guarantee

that

the

corresponding

strings

are

equal

-RRB-

However

it

has

been

observed

that

KR-hashing

appears

to

fail

so

rarely

that

deferring

the

component-wise

test

to

markstrings

turns

out

to

be

far

more

efficient

-LRB-

See

discussion

in

-LSB-

-RSB-

-RRB-

The

question

arises

as

to

what

is

an

appropriate

value

for

the

parameter

s

passed

to

scanpattern

and

markstrings

More

precisely

what

is

to

be

its

initial

value

and

how

is

that

value

to

be

decremented

While

one

might

consider

half

the

length

of

P

as

an

appropriate

starting

value

for

s

it

turns

out

in

practice

that

a

much

smaller

value

will

suffice

There

are

two

reasons

for

this

Firstly

very

long

maximal-matches

are

rare

so

in

general

a

large

initial

value

for

s

would

generate

a

number

empty

sweeps

by

scanpattern

until

a

match

is

finally

found

Secondly

if

a

long

maximal-match

is

found

-LRB-

long

maximal-match

defined

to

be

where

k

the

maximalmatch

length

is

s

-RRB-

the

creation

of

a

tile

from

this

string

will

absorb

a

significant

number

of

the

pattern

and

text

tokens

It

is

therefore

worthwhile

stopping

the

current

scan

and

restarting

with

the

larger

initial

value

of

s

k

for

this

special

case

This

implies

that

the

initial

search-length

can

be

set

to

a

small

constant

value

-LRB-

it

is

currently

-RRB-

rather

than

being

dependent

on

the

string

lengths

Finally

in

-LSB-

-RSB-

it

is

argued

that

although

the

worst-case

complexity

is

O

-LRB-

n

-RRB-

n

the

sum

of

the

lengths

of

the

input

strings

the

circumstances

where

that

arises

are

entirely

pathological

and

using

curve-fitting

a

complexity

of

O

-LRB-

n

-RRB-

is

shown

experimentally

i.e.

close

to

linear

To

see

what

the

experimentally

derived

complexity

would

be

in

this

domain

pairs

of

proteins

where

compared

with

combined

string

lengths

ranging

from

to

amino

acids

With

the

minimum-match-length

set

to

the

experimentally

derived

complexity

was

O

-LRB-

n

-RRB-

i.e.

still

close

to

linear

Matching

Amino

Acids

by

Group

The

algorithm

described

in

the

previous

section

performs

exact

matching

in

the

first

instance

by

comparing

a

hash-value

of

some

number

of

tokens

and

only

subsequently

by

comparing

the

actual

tokens

The

tokens

in

this

instance

are

integer

values

representing

say

nucleotides

What

has

been

observered

many

years

ago

in

the

case

of

amino

acids

is

that

over

evolutionary

time

certain

of

them

mutate

into

certain

other

amino

acids

This

propensity

is

usually

displayed

in

the

form

of

a

matrix

the

best

known

being

the

PAM

of

Dayhoff

et

al.

-LSB-

-RSB-

It

is

this

matrix

that

is

used

for

example

in

the

Smith

Waterman

algorithm

Looking

beyond

the

matrix

representation

however

what

is

being

expressed

is

the

notion

that

certain

amino

acids

are

substitutable

though

perhaps

in

different

contexts

e.g.

as

illustrated

by

the

matrices

due

to

L

thy

et

al.

-LSB-

-RSB-

which

reflect

various

features

of

secondary

structure

and

hydrophilicity

What

is

proposed

is

that

instead

of

using

the

matrices

directly

groups

of

substitutable

amino

acids

be

formed

and

it

is

the

groups

that

will

participate

in

the

matching

In

particular

a

set

of

imperfect

equivalence

classes

are

formed

-LRB-

or

alternatively

equivalence

classes

with

deleted

edges

-RRB-

That

is

each

member

of

an

imperfect

equivalence

class

or

simply

group

is

assumed

to

be

substitutable

for

any

other

member

of

the

group

except

where

that

mutation

has

been

explicitly

disallowed

-LRB-

Every

amino

acid

is

assumed

to

belong

to

one

group

even

if

that

group

contains

only

itself

meaning

that

only

mutations

of

that

amino

acid

to

itself

are

allowed

-RRB-

For

example

the

groups

drawn

from

the

PAM

matrix

found

in

-LSB-

-RSB-

are

A

G

P

S

T

D

E

H

N

Q

I

L

M

V

F

Y

K

R

CW

where

the

mutations

that

are

explicitly

excluded

are

G

T

and

G

P.

-LRB-

The

order

of

amino

acids

within

groups

and

between

the

various

groups

is

irrelevant

-RRB-

Assume

that

the

information

contained

in

the

matrices

is

recast

as

a

list

of

amino

acid

pairs

followed

by

a

number

say

an

integer

representing

the

log-odds

of

mutation

occurring

between

the

two

amino

acids

-LRB-

discussed

in

-LSB-

-RSB-

-RRB-

Assume

also

that

the

list

is

ordered

by

decreasing

log-odds

value

and

that

there

is

defined

a

function

LogOdds

that

given

a

pair

of

amino

acids

returns

the

log-odds

mutation

value

Finally

assume

that

a

parameter

passed

to

the

algorithm

threshold

represents

a

value

above

which

the

corresponding

mutation

may

occur

With

these

assumptions

the

algorithm

that

is

used

to

generate

the

the

amino

acid

groups

together

with

the

list

of

excluded

mutations

is

groups

-LCB-

-LCB-

A

-RCB-

-LCB-

C

-RCB-

-LCB-

D

-RCB-

-LCB-

E

-RCB-

-LCB-

F

-RCB-

-LCB-

G

-RCB-

-LCB-

H

-RCB-

-LCB-

I

-RCB-

-LCB-

K

-RCB-

-LCB-

L

-RCB-

-LCB-

M

-RCB-

-LCB-

N

-RCB-

-LCB-

P

-RCB-

-LCB-

Q

-RCB-

-LCB-

R

-RCB-

-LCB-

S

-RCB-

-LCB-

T

-RCB-

-LCB-

V

-RCB-

-LCB-

Y

-RCB-

-RCB-

-LCB-

-RCB-

for

each

-LRB-

-RRB-

do

if

LogOdds

-LRB-

-RRB-

threshold

then

if

then

already

part

of

group

Number

of

above

threshold

edges

added

to

graph

by

addition

of

new

edge

Number

of

edges

at

or

below

threshold

-LCB-

-RCB-

Set

of

excluded

edges

due

to

addition

of

new

edge

the

group

that

contains

the

group

that

contains

for

each

member

i

of

do

for

each

member

j

of

do

if

LogOdds

-LRB-

i

j

-RRB-

threshold

then

else

-LCB-

-LRB-

i

j

-RRB-

-RCB-

if

then

create

new

joint

group

after

removing

components

groups

groups

groups

groups

-LCB-

-RCB-

In

the

example

of

the

groups

formed

from

the

PAM

matrix

the

threshold

was

set

to

The

way

the

groups

are

used

is

that

as

each

amino

acid

is

being

read

in

rather

than

being

converted

to

an

integer

value

it

is

given

the

index

of

the

group

to

which

it

belongs

Then

in

markstrings

when

the

component-wise

tests

is

being

undertaken

a

boolean

valued

matrix

is

used

so

that

if

a

mutation

is

allowed

the

cell

is

given

a

TRUE

value

otherwise

the

cell

is

marked

FALSE

-LRB-

If

exact

matching

is

being

done

only

the

diagonal

elements

will

be

labelled

TRUE

-RRB-

To

get

some

indication

of

the

impact

that

matching-by-groups

has

on

system

performance

the

set

of

protein

comparisons

mentioned

earlier

were

run

again

but

his

time

using

a

set

of

groups

and

excluded

mutations

resulting

from

the

application

of

the

formgroups

algorithm

to

the

Beta

matrix

from

-LSB-

-RSB-

The

resulting

groups

are

A

G

T

S

Q

K

R

N

E

D

W

F

Y

H

L

I

V

M

CP

from

which

the

following

mutations

are

explicitly

disallowed

G

N

G

K

A

D

A

E

A

R

A

K

A

Q

When

curve-fitting

is

performed

the

experimentally

derived

complexity

rises

to

O

-LRB-

n

-RRB-

which

is

still

close

to

linear

so

the

effect

on

performance

does

not

appear

to

be

excessive

Facilities

Provided

by

Neweyes

Neweyes

has

been

designed

to

work

in

two

different

but

related

ways

In

the

first

a

macro

capacity

a

file

containing

a

single

biosequence

-LRB-

in

EMBL

format

-RRB-

can

be

compared

to

a

file

containing

multiple

biosequences

The

user

then

selects

which

of

a

number

of

statistics

will

be

used

to

sort

the

list

possible

matches

that

result

from

the

comparison

of

the

query

sequence

with

the

database

The

statistics

that

are

currently

available

are

A

percentage

match

value

which

is

the

number

of

bases

or

amino

acids

covered

by

tiles

divided

by

the

length

of

the

smaller

biosequence

-LRB-

expressed

as

a

percentage

-RRB-

Then

total

number

of

tokens

from

one

biosequence

marked

-LRB-

i.e.

covered

by

tiles

-RRB-

The

length

of

the

longest

tile

The

length

of

the

average

tile

-LRB-

for

a

single

biosequence

-RRB-

Assuming

the

database

file

contains

a

number

of

different

sequences

-LRB-

including

unrelated

ones

-RRB-

a

mean

and

standard

deviation

are

also

returned

for

the

selected

statistic

The

second

mode

of

operation

is

in

a

micro

capacity

where

a

single

pair

of

biosequences

are

being

compared

In

this

case

more

complex

output

formats

are

possible

including

a

dot-plot

-LRB-

for

which

tiling

is

switched

off

and

just

the

maximal-matches

are

recorded

-RRB-

Alternatively

one

can

obtain

a

listing

displaying

the

pattern

string

overlaid

with

the

matching

portions

of

the

text

string

-LRB-

or

vice

versa

-RRB-

A

number

of

facilities

are

available

across

both

modes

of

operation

They

include

Selection

of

exact

matching

or

matching-by-group

Where

matching-by-group

is

being

employed

it

is

possible

to

specify

an

ascii

file

listing

the

groups

-LRB-

one

per

line

-RRB-

and

a

second

file

listing

the

pairs

of

mutations

that

are

to

be

explicitly

disallowed

Where

the

user

wishes

to

examine

possible

repeats

of

parts

of

the

pattern

biosequence

occurring

in

the

text

biosequence

it

is

possible

to

suppress

marking

of

the

pattern

string

-LRB-

so

several

text

substrings

may

form

tiles

with

the

same

pattern

substring

-RRB-

When

a

new

match

is

to

be

retrieved

from

the

topmost

queue

in

the

list

of

queues

-LRB-

in

markstrings

-RRB-

the

queue

is

first

examined

to

see

whether

a

match

exists

that

is

close

to

a

tile

that

has

already

been

laid

i.e.

within

search-length

tokens

of

an

existing

tile

on

one

string

and

within

token

on

the

second

string

If

no

such

maximal-match

exists

the

first

on

the

current

queue

is

chosen

This

has

the

effect

of

extending

ascending

sequences

of

tiles

Discussion

At

first

appearances

Running

Karp-Rabin

Greedy

String

Tiling

-LRB-

RKR-GST

-RRB-

algorithm

has

similarities

with

the

algorithms

underlying

both

FASTA

and

BLAST

In

fact

there

are

significant

differences

which

probably

outweigh

the

similarities

Like

both

FASTA

and

BLAST

the

RKR-GST

algorithm

employs

a

search

for

substrings

of

some

fixed

length

and

like

BLAST

having

found

a

match

the

match

is

then

extended

However

in

the

case

of

RKR-GST

searchlength

-LRB-

i.e.

k-tuple

or

w-mer

size

-RRB-

varies

and

can

increase

if

it

appears

that

very

long

strings

exist

-LRB-

This

derives

from

the

fact

that

the

former

systems

use

direct

encode

of

tuples

or

a

finite-state-machine

i.e.

are

essentially

table

driven

and

therefore

expensive

to

recode

for

a

different

tuple

size

while

RKR-GST

being

based

on

KarpRabin

matching

is

easily

changed

-RRB-

Furthermore

unlike

both

the

earlier

systems

there

is

no

penalty

for

increasing

the

search-length

-LRB-

compared

to

the

exponential

increase

in

memory

required

to

store

the

tables

driving

FASTA

and

BLAST

-RRB-

Relatedly

the

static

storage

reqired

by

RKR-GST

grows

in

line

with

length

of

the

input

strings

and

while

the

amount

of

dynamic

storage

is

dependent

on

the

number

of

maximal-matches

in

practice

it

also

grows

in

line

with

the

lengths

of

the

input

strings

The

use

of

multiple

passes

each

covering

a

range

of

maximal-match

sizes

also

helps

to

reduce

the

number

of

maximal-matches

that

need

to

be

stored

In

terms

of

what

is

produced

when

a

tiling

is

done

-LRB-

as

opposed

to

returning

all

possible

matches

-RRB-

the

output

resembles

multiple

BLAST

alignments

Two

examples

are

presented

The

first

example

illustrates

an

alignment

between

two

sequences

that

are

clearly

related

-LRB-

Transforming

Protein

AC

-RRB-

and

-LRB-

Transforming

Protein

Homologue

AC

-RRB-

When

these

are

aligned

using

group

matching

with

the

groups

derived

from

L

thy

et

al.

's

beta

matrix

and

a

minimum-match-length

of

the

statics

of

the

tiling

are

-LRB-

-RRB-

-LRB-

-RRB-

Number

of

marked

tokens

-LRB-

-RRB-

in

tiles

Longest

tile

Average

tile

Appendix

is

a

dotplot

showing

the

alignment

and

Appendix

is

a

listing

of

the

text-string

with

superimposed

on

it

where

there

is

a

match

Appendix

is

a

dotplot

of

the

same

alignment

but

this

time

using

groups

derived

from

L

thy

et

al.

's

alpha

matrix

Notice

that

it

tells

essentially

the

same

story

with

the

main

difference

being

the

emergence

of

two

long

tiles

near

the

ends

of

the

biosequences

The

statistics

for

this

match

are

-LRB-

-RRB-

-LRB-

-RRB-

Number

of

marked

tokens

-LRB-

-RRB-

in

tiles

Longest

tile

Average

tile

As

a

second

example

this

time

illustrating

a

weak

match

Appendix

contains

the

alignment

of

-LRB-

Cytochrome

C

AC

-RRB-

against

-LRB-

Papain

Precursor

AC

-RRB-

First

the

basic

statistics

of

the

matching-by-group

tiling

with

groups

derived

from

L

thy

et

al.

's

alpha

matrix

and

minimum-matchlength

set

to

are

-LRB-

-RRB-

-LRB-

-RRB-

Number

of

marked

tokens

-LRB-

-RRB-

in

tiles

Longest

tile

Average

tile

Appendix

contains

a

listing

of

the

text-string

-LRB-

-RRB-

with

the

matching

pieces

of

superimposed

Appendix

a

dotplot

of

that

tiling

while

Appendix

is

a

dotplot

of

all

the

matches

of

length

or

greater

-LRB-

for

greater

clarity

However

the

groups

used

for

matching

are

the

same

-RRB-

Note

that

in

both

examples

smoothing

as

been

use

to

improve

the

contiguity

of

the

tilings

Note

that

the

percentage

match

value

is

not

a

good

indicator

of

a

weak

match

while

a

low

value

does

indicate

a

weak

match

a

high

value

may

be

the

result

of

a

large

number

of

very

short

matches

This

is

what

has

occurred

in

the

comparison

of

and

as

is

evidenced

by

the

far

smaller

average

tile

length

of

versus

for

and

Note

that

in

all

the

above

tilings

the

smooth

option

has

been

used

As

the

system

currently

stands

the

pairwise

comparison

facilities

described

above

have

been

implemented

and

when

run

on

a

MIPS

with

a

clock-frequency

of

and

Mbytes

memory

a

rate

of

speed

of

around

residues/second

is

achieved

-LRB-

On

our

DEC

Alpha

the

speed

is

around

residues/second

-RRB-

However

comparisons

between

a

number

of

biosequences

is

currently

being

handled

by

a

shell-script

so

the

next

step

will

be

to

bring

the

file

comparisons

within

the

main

software

system

and

to

improve

the

overall

speed

of

execution

Once

this

has

been

achieved

-LRB-

it

should

be

completed

by

May

-RRB-

it

will

then

be

possible

to

compare

the

performance

of

the

Neweyes

with

that

of

the

other

systems

as

a

vehicle

for

database

searching

The

one

facility

that

Neweyes

has

that

the

other

systems

lack

is

the

ability

to

detect

transposed

substrings

so

it

will

be

interesting

to

investigate

the

prevalence

of

transposed

substrings

in

the

databases

Bibliography

-LSB-

-RSB-

Altschul

Stephen

F.

Warren

Gish

Webb

Miller

Eugene

W.

Myers

and

David

J.

Lipman

Basic

Local

Alignment

Search

Tool

Journal

of

Molecular

Biology

-LRB-

-RRB-

pp.

-LRB-

-RRB-

-LSB-

-RSB-

Cormen

Thomas

H.

Charles

E.

Leiserson

and

Ronald

L.

Rivest

Introduction

to

Algorithms

MIT

Press

-LRB-

-RRB-

-LSB-

-RSB-

Dayhoff

M.

O.

R.

M.

Schwartz

and

B.

C.

Orcutt

A

Model

of

Evolutionary

Change

in

Proteins

Atlas

of

Protein

Sequence

and

Structure

ed

M.

O.

Dayhoff

pp.

National

Biomedical

Research

Foundation

Washington

-LRB-

-RRB-

-LSB-

-RSB-

Dumas

Jean-Pierre

and

Jacques

Ninio

Efficient

Algorithms

for

Folding

and

Comparing

Nucleic

Acid

Sequences

Nucleic

Acids

Research

-LRB-

-RRB-

pp.

-LRB-

-RRB-

-LSB-

-RSB-

Gonnet

G.

H.

and

R.

A.

Baeza-Yates

An

Analysis

of

the

Karp-Rabin

String

Matching

Algorithm

Information

Processing

Letters

pp.

-LRB-

-RRB-

-LSB-

-RSB-

Gonnet

G.

H.

and

R.

Baeza-Yates

Handbook

of

Algorithms

and

Data

Structures

-LRB-

Second

Edition

-RRB-

Addison-Wesley

-LRB-

-RRB-

-LSB-

-RSB-

Karp

Richard

M.

and

Michael

O.

Rabin

Efficient

Randomized

Pattern-Matching

Algorithms

IBM

Journal

of

Research

and

Development

-LRB-

-RRB-

pp.

-LRB-

March

-RRB-

-LSB-

-RSB-

Kruskal

Joseph

B.

An

Overview

of

Sequence

Comparison

Time

Warps

String

Edits

and

Macromolecules

The

Theory

and

Practice

of

Sequence

Comparison

ed

David

Sankoff

and

Joseph

B.

Kruskal

pp

Addison

Wesley

-LRB-

-RRB-

-LRB-

Chapter

-RRB-

-LSB-

-RSB-

Lipman

David

J.

and

William

R.

Pearson

Rapid

and

Sensitive

Protein

Similarity

Searches

Science

pp.

-LRB-

March

-RRB-

-LSB-

-RSB-

Lu

thy

Roland

Andrew

D.

McLachlan

and

David

Eisenberg

Secondary

Structure-Based

Profiles

Use

of

Structure

Conserving

Scoring

Tables

in

Searching

Protein

Sequence

Databases

for

Structural

Similarities

Proteins

Structure

Function

and

Genetics

pp

-LRB-

-RRB-

-LSB-

-RSB-

Needleman

Saul

B.

and

Christian

D.

Wunsch

A

General

Method

Applicable

to

the

Search

for

Similarities

in

the

Amino

Acid

Sequence

of

Two

Proteins

Journal

of

Molecular

Biology

pp

-LRB-

-RRB-

-LSB-

-RSB-

Pearson

William

R.

and

David

J.

Lipman

Improved

Tools

for

Biological

Sequence

Comparison

Proceedings

of

the

National

Academy

of

Science

U.S.A.

pp.

-LRB-

-RRB-

-LSB-

-RSB-

Pearson

William

R.

Rapid

and

Sensitive

Sequence

Comparison

with

FASTP

and

FASTA

Molecular

Evolution

Computer

Analysis

of

Protein

and

Nucleic

Acid

Sequences

ed

Russell

F.

Doolittle

pp.

Academic

Press

-LRB-

-RRB-

-LRB-

Methods

in

Enzymology

Vol

-RRB-

-LSB-

-RSB-

Schwartz

R.

M.

and

M.

O.

Dayhoff

Matrices

for

Detecting

Distant

Relationships

Atlas

of

Protein

Sequence

and

Structure

ed

M.

O.

Dayhoff

pp.

National

Biomedical

Research

Foundation

Washington

-LRB-

-RRB-

-LSB-

-RSB-

Smith

T.

F.

and

M.

S.

Waterman

Identification

of

Common

Molecular

Subsequences

Journal

of

Molecular

Biology

pp

-LRB-

-RRB-

-LSB-

-RSB-

States

David

J.

and

Mark

S.

Boguski

Similarity

and

Homology

Sequence

Analysis

Primer

ed

Michael

Gribskov

and

John

Devereux

pp.

W.

H.

Freeman

-LRB-

-RRB-

-LSB-

-RSB-

Wilbur

W.

J.

and

David

J.

Lipman

Rapid

Similarity

Searches

of

Nucleic

Acid

and

Protein

Data

Banks

Proceedings

of

the

National

Academy

of

Science

U.S.A.

pp.

-LRB-

February

-RRB-

-LSB-

-RSB-

Wise

Michael

J

Running

Karp?Rabin

Matching

and

Greedy

String

Tiling

Basser

Department

of

Computer

Science

Technical

Report

-LRB-

March

-RRB-

-LRB-

Submitted

to

Software

Practice

and

Experience

-RRB-

Appendix

Plot

of

-LRB-

Y-axis

-RRB-

against

-LRB-

X-axis

-RRB-

Matching

by

amino-acid

group

beta

used

48 96 150 190

Appendix

Listing

of

Text

string

-LRB-

with

-RRB-

Matching

by

amino-acid

group

beta

used

MQGNKST

F

VS

DILDTAGQEEYSAMREDQYMRTGEGFL

L

LSYY

Y

VGNK

LDLENERQV

DGLRLAKQLNA

ETSAKQAINVD

LVRDDGGKYN

QLD

LTSSATA

KNNGSYVLD

HNGETTKR

TDEKNYVNQNNNNEGNTKYSSNGNGNRSDISRGNQNNALNSRSK

KNSSANARKE

SSGGC

C

Appendix

Plot

of

-LRB-

Y-axis

-RRB-

against

-LRB-

X-axis

-RRB-

Matching

by

amino-acid

group

alpha

used

48 96 150 190

Appendix

Plot

of

-LRB-

Y-axis

-RRB-

against

-LRB-

X-axis

-RRB-

Matching

by

amino-acid

group

alpha

used

Appendix

Listing

of

Text

string

-LRB-

with

-RRB-

Matching

by

amino-acid

group

alpha

used

MAMI

LLFVAICLFVYMGLSFGDFSIVGYSQNDLT

SWMLKHNKIYK

FEIFKDN

KNNSYWLGLN

FKEKYTGSIAGNYTTTE

LSYEEV

NIPEYVDWRQKGAVTPVK

AVVTIEGIIKIRTGNLNE

YSEQELLDCDRRSYGCNGGYPWSALQLVAQYGIHYRNTYPYEGVQRYCRSREKGPY

RQVQP

LYSIANQPVSVV

DFQLYRGGIF

KVDHAVAAVGYG

PNYILIKNSWGTGW

I

NSYGVCGLYTSSFYPVKN

Appendix

Plot

of

-LRB-

Y-axis

-RRB-

against

-LRB-

X-axis

-RRB-

Matching

by

amino-acid

group

alpha

used

O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O

efficient sequence search
structure matrices
transposed subsequences