Need for Speed (postscript)

Ludovic Thébault ludovic.thebault at laposte.net
Sun Jul 15 23:37:35 EDT 2007


On Sun, 15 Jul 2007 20:58:32 +0100, Beynon, Rob wrote:

Hello, try to append the result to a file, it's a lot faster :

> global seqDB
> 
> ON mouseUp
> 
>     put the number of lines in field "massList" into peptides
> 
>     put "Processing " & peptides & " masses, please wait..." into 
> field "Output"
> 
>     put the long time into field "Start"
> 
>  --   put empty into outputData

ask file "Save as..."
put it into outputdata
open file outputData for write
close file outpudata -- it's to create an empty file if the fle already 
exists
open file outputdata for append

>     set the tabstops of field "Output" to 120, 390, 10,20
> 
>     put field "ppm" into ppm
> 
>     REPEAT for each line pepMass in field "massList"
> 
>         put "NEW SEARCH, MASS = " & pepMass & " at " & ppm & " ppm 
> error" & return after outputData
> 
>         put  pepMass * ppm/1000000 into massError
> 
>         REPEAT for each line peptide in seqDB
> 
>             put the third word of peptide into dbMass
> 
>   --          IF abs(pepMass-dbMass) <= massError THEN put peptide & 
> "K" & tab & dbMass-pepMass & return after outputData

IF abs(pepMass-dbMass) <= massError THEN write peptide & 
> "K" & tab & dbMass-pepMass & return to file outputData


>         END REPEAT
> 
>         put "====================" & return after outputData
> 
>     END REPEAT
read from file outputdata until eof
close file Outputdata
put it into fld "outputt"
>   --  put outputData into field "Output"
> 
>     put the long time into field "Stop"
> 
> END mouseUp


Ludovic
http://www.botanic06.com



More information about the use-livecode mailing list