next up previous contents
Next: Searching for Genes Up: The Pairwise Comparison of Previous: The DrawSimPam Function

The GetOffset Function

So far we have described how to match sequences in the database. When we want to match sequences which are not in the database, we must first translate the strings to database offsets. This is done with the function GetOffset. The GetOffset function requires that DB be currently assigned to a sequence database. We apply this function to strings s1 and s2 before placing them in the Match structure.

> CreateOrigDayMatrix():                          # compute the Dayhoff matrices.
> DB := ReadDb('Sample/SH2'):     # assign to DB.  
> s1 := 'MSRYEKMFARLNERNQGAFVPFVTVCDPNAEQSYKIMETLVESGADALELGIPFSDP':
> s2 := 'MLLLSVNPPLFIPFIVAGDPSPEVTVDLALALEEAGADLLELGVPYSDP':
> m3 := Match(GetOffset(s1), GetOffset(s2));
m3 := Match(283090972,283090904)
> print(LocalAlignBestPam(m3, DMS));
lengths=39,39 simil=164.1, PAM_dist=85.2921, offsets=283090990,283090914,
  identity=48.7%, similarity=20.5%
FVPFVTVCDPNAEQSYKIMETLVESGADALELGIPFSDP
|!||!...||:.|.!..:. .|.|:|||.||||!|!|||
FIPFIVAGDPSPEVTVDLALALEEAGADLLELGVPYSDP






The vast majority of the time, users may completely ignore offsets of a sequence. However, there are some situations (in particular, in the all against all matchings) where one may wish to determine which of the two sequences in a Match structure are native to the sequence database and which is the foreigner.

One must take care using the GetOffset function. Depending on available space, Darwin may insert the foreign sequence either before or after the location of DB[string]. If it is placed before DB[string], this may result in negative offsets.





Gaston Gonnet
1998-09-15