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
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.