The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum
 Origin Forum
 custom analysis system for enzyme kinetic data

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
kornster Posted - 05/03/2006 : 1:25:56 PM
Origin Version (Select Help-->About Origin): 6.1
Operating System: win xp

Hi! Im thinking of making some kind of custom app to automate kinetic data analysis thats annoyingly boring to do on a continual basis. I have a single wavelength spectrophotometer that continuously records data from my experiments (liquid chromatography system), which is hooked up to a digitizer and im using a program called TracerDaq to log the data into a standard text file. The system measures approximately one data point per second and so I usually just import the data in single ascii format to origin and convert my "date" column into seconds. Then I fit the linear portions of the resultant graph to get the velocity of the reaction. There seems to be some great examples of people building on origin to automate data analysis. The problem here is that im quite busy and not that familiar with programming and so, before I start to invest my time into something like this, it would be great to know if you guys think my project is feasible and how would you go about starting to build the app. Obviously one just has to do it to see if it works, but it doesnt hurt to ask...:D
5   L A T E S T    R E P L I E S    (Newest First)
kornster Posted - 05/13/2006 : 04:32:02 AM
Hey,

All I can say is wow. I didnt expect someone to actually do the work for me. Im in your debt. Ill try it out and see how it works. Actually, based on your description, the script has all the characteristics I was thinking it needs. Im quite sure many people, at least in my lab, will find it very useful as this decreases data analysis time to approximately 5 minutes from about 1 hour.

Thanks again.

Mike Buess Posted - 05/07/2006 : 2:34:05 PM
Sounds like your ideal waveform is the sawtooth shown below but and you want to fit each tooth. Before getting into the details of tooth selection I'll point out that you can restrict the (linear, polynomial, whatever) fit to a specific region of the curve with the data selection markers shown in the figure. (If the Analysis > Fit Linear command were run on Graph2 then only points 3 through 7 would be fitted.) The markers are positioned with the Data Selector tool or by typing the commands mks1=3 and mks2=7 in the script window or file.



How to use the markers in your script depends on the details of your data. If every graph has the same number of teeth at the same positions then the markers are determined in advance except for the odd behavior at the beginning and end of each tooth. Since I have no idea what that behavior is I can only suggest that you ignore a given number of points on both sides. The worksheet below lists the marker positions needed to fit all teeth in Graph2 by ignoring two points on both sides.



The [Fit] section below is based on the [Fit] section in Batch.ogs but has been modified to use the mks1 and mks2 values from the Markers worksheet above. (You must create the Markers worksheet before running the script.) After pasting the script to Batch.ogs you can run (test) it on an existing graph with the command run.section(Buttons\Batch,Fit). (The [Results] section has also been modified to handle multiple regions.)

So far I've assumed that the same markers can be used for all datasets. If the number and positions of the teeth vary from dataset to dataset then you must modify the Marker wks each time. The [GetLinearRegions] section at the bottom locates all teeth by comparing the differences between adjacent Y values to a threshold (batchDY) determined by the largest difference in the dataset. Differences that exceed the threshold mark the boundaries between adjacent teeth. The success of this method will depend on the steepness of your boundaries but a scaling factor (batchFac) can be used for fine tuning. Once the boundaries between teeth are found the script creates or fills the Markers worksheet ignoring batchNL points on the left of each tooth and batchNR points on the right. Note: in order to use this script you must remove // from the start of the run.section(,GetLinearRegions); command in the [Fit] section.

That's the best I can do based on the information you've provided. Hope it helps.

[Fit]
if( exist(%H,3)==0 )
{
type -a A graph window must be active;
return;
}
//run.section(,GetLinearRegions); // remove // at start of this line to create Markers wks
if( Markers!wks.maxrows==0/0 || Markers!wks.maxrows==0 )
{
type -a No markers;
return;
}
%A=%C;
SaveRedirection=type.Redirection(16,3);
type.BeginResults();
type $regression.performLR;
type $regression.EqnForLR;
type;
type.Redirection=SaveRedirection;
loop(jj,1,Markers!wks.maxrows)
{
mks2 = Markers_mks2[jj];
mks1 = Markers_mks1[jj];
run.section(lr,simplefit);
run.section(,Results);
}
type.EndResults();
delete -v SaveRedirection;

[Results]
SaveRedirection=type.Redirection(16,3);
type "Region: $(jj) of $(Markers!wks.maxrows) [%C]";
type "X-Range: $(xvalue(mks1,%C)) -> $(xvalue(mks2,%C))";
type $regression.ShortParaHeader1;
separator 4;
type "A\t$(Stat.LR.A)\t$(stat.LR.Ase)";
type "B\t$(Stat.LR.B)\t$(stat.LR.Bse)";
separator 4;
type; //Type out an extra line
type $regression.ShortParaHeader2;
separator 4;
if (stat.pValue<0.0001) %A="<0.0001"; else %A=$(stat.pValue);
type "$(Stat.R)\t$(Stat.SD)\t$(stat.npts)\t%A";
separator 4;
type;
type.Redirection=SaveRedirection;

[GetLinearRegions]
batchNL = 2; // number of points ignored on the left
batchNR = 2; // number of points ignored on the right right
batchFac = 0.6; // scaling factor for threshold
get %C -e batchNpt;
mks1 = 1;
mks2 = batchNpt;
tmp = diff(%C); // difference between adjacent Y values
sum(tmp);
batchDY = sum.min; // largest negative difference
batchDY *= batchFac; // scale by a reasonable factor
tmp = tmp>batchDY ? 0 : 1; // replace with 0s or 1 (at transitions)
sum(tmp);
batchNN = 1 + sum.total; // number of linear regions
if(exist(Markers,2)==0)
{
%P = %H;
win -t D;
win -r %H Markers;
wks.col1.type = 2;
wks.col2.type = 2;
wks.col1.name$ = mks1;
wks.col2.name$ = mks2;
win -a %P;
}
ii1 = 1;
nn = 0;
loop(jj,1,batchNN)
{
if( jj>1 ) ii1 = ii2 + 1;
if( jj<batchNN ) {ii2 = list(1,tmp); tmp[ii2] = 0};
else ii2 = batchNpt;
if( ii2-ii1>batchNL+batchNR )
{
nn++;
Markers_mks1[nn] = ii1 + batchNL;
Markers_mks2[nn] = ii2 - batchNR;
}
}
set Markers -er nn;
del tmp;
del -v batch*;

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 05/07/2006 2:46:40 PM

Edited by - Mike Buess on 05/07/2006 3:08:33 PM
kornster Posted - 05/06/2006 : 05:54:50 AM
Hey everyone!

Restricting the range of the linear fit automatically seems to be giving me some problems. In essence, I have several straight or somewhat straight (hopefully at about 45 degrees) lines connected by straight or somewhat straight (vertical) lines or trails of dots when plotted as scatter plot in origin after import in ascii format. I wanna draw "tangents" or fit these somewhat straight lines as a linear fit. Another problem is the fact that theyre usually somewhat curved at either end and so I need to find a way to find the straightest portion of the line or curve and fit this portion. The custom routine suggested earlier was excellent.

Thanks.
kornster Posted - 05/04/2006 : 12:15:52 PM
Thanks a bunch for the answer! Really helped a lot.

Thanks again.
Mike Buess Posted - 05/03/2006 : 5:49:08 PM
Check out the script file Batch.ogs in the Buttons subfolder of your Origin program folder. Looks like it does everything you want... select and import a file, plot, perform linear fit on entire dataset. Post here again if you need to restrict the fitting range or make other modifications. Note: you can run the script from your Custom Routine button by using the command run.section(Buttons\Batch,Main); in Custom.ogs as explained here

Mike Buess
Origin WebRing Member

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000