検量線のスクリプト作成方法こんにちは。私のスクリプト作成レベルは本当に基礎的なものなので、助けていただければ幸いです。
次のことを実現するにはどのようにスクリプトを書けばよいでしょうか?
キャリブレーターの既知の濃度を記載した表があります。 各アッセイ (アッセイごとに 1 つのテーブル) には、いくつかの未知のシグナルとキャリブレーターのシグナルが含まれています。これは基本的に各アッセイの内部検量線です。
既知の濃度のテーブルから値を取得し、その特定のアッセイ (アッセイ テーブル) のシグナルに対してプロットし、線形回帰を使用して未知の濃度を計算するスクリプトを作成することは可能ですか?
よろしくお願いします!
Re: 検量線のスクリプト作成方法これは完璧です! マークにはいくら感謝してもしきれません。
Re: 検量線のスクリプト作成方法
Names Default to Here( 1 );
// check for sufficient tables
n tables = N Table();
If( n tables < 2,
Throw( "Two data tables are required for this analysis" )
);
tables = List();
For( t = 1, t <= n tables, t++,
Insert Into( tables, Eval( Data Table( t ) << Get Name ) );
);
// identify the calibration and unknown data tables
dlg = New Window( "Assay Unknown Samples", << Modal,
H List Box(
lb = List Box( tables ),
Line Up Box( N Col( 2 ),
Button Box( "Calibrator Table",
sel = lb << Get Selected;
cal lb << Append( sel );
),
cal lb = List Box( {},
N Lines( 1 )
),
Button Box( "Unknown Table",
sel = lb << Get Selected;
unk lb << Append( sel );
),
unk lb = List Box( {},
N Lines( 1 )
)
)
),
H List Box(
Button Box( "OK",
cal table = cal lb << Get Items;
Show( cal table );
unk table = unk lb << Get Items;
Show( unk table );
),
Button Box( "Cancel" )
)
);
If( dlg["Button"] == -1,
Throw( "User cancelled" )
);
// unload the dialog
cal table = Data Table( cal table[1] );
unk table = Data Table( unk table[1] );
// include AU 2 values for calibrators from calibration table
combined = cal table << Join( With( unk table ),
Copy formula( 0 ),
Select With( :Sample, :Peps, :AU 1 ),
Select( :AU 2 ),
By Matching Columns( :Peps = :Peps ),
Drop Multiples( 0, 0 ),
Include Nonmatches( 0, 1 ),
Preserve Main Table Order( 0 )
);
Close( cal table, No Save );
Close( unk table, No Save );
// distinquish peps
Current Data Table( combined );
combined << New Column( "Status", "Character", "Nominal" );
For Each Row(
:Status = If( 1 <= Num( Regex( :Peps, "\w{3}(\d+)", "\1" ) ) <= 29, "Calibrator", "Unknown" );
);
// placeholders for matching information
combined
<< New Column( "Predicted AU 2", "Numeric", "Continuous" )
<< New Column( "Lower 95%", "Numeric", "Continuous" )
<< New Column( "Upper 95%", "Numeric", "Continuous" );
// handle each sample set separatelySummarize( sample = By( combined:Sample ) );
Summarize( sample list = By( combined:Sample ) );
For( s = 1, s <= N Items( sample list ), s++,
// isolate sample
combined
<< Select Where( :Sample == sample list[s] )
<< Invert Row Selection
<< Exclude;
// fit the calibration curve for this sample
dlg = combined << Fit Model(
Y( :AU 1 ),
Effects( :AU 2 ),
Personality( "Standard Least Squares" ),
Emphasis( "Minimal Report" ),
Where( :Status == "Calibrator" )
);
fit = dlg << Run;
// access report layer
fit rep = fit << Report;
title = fit rep[OutlineBox(1)] << Get Title;
fit rep[OutlineBox(1)] << Set Title( title || ", Sample = " || sample list[s] );
// determine the assay for the unknown samples from the calibration curve
For Each Row(
If( Not( Excluded( Row State( Row() ) ) ),
fit << Inverse Prediction( Response( :AU 1[] ) );
);
);
// remove extraneous string column box that interferes with making combined data table
(fit rep << XPath( "//StringColBox[StringColBoxHeader=\!"Type of CI\!"]")) << Delete;
// extract the assays into a new data table
assays = fit rep["Inverse Prediction"][TableBox(1)] << Make Combined Data Table;
// fit << Close Window;
// prepare predicted values for join
assays
<< Delete Columns( Column( assays, 1 ) )
<< New Column( "Sample", "Character", "NominaL" )
<< New Column( "Peps", "Character", "NominaL" );
Current Data Table( combined );
r = 1;
For Each Row(
If( Not( Excluded( Row State( Row() ) ) ),
assays:Sample[r] = combined:Sample;
assays:Peps[r] = combined:Peps;
r++;
);
);
combined << Clear Row States;
combined << Update(
With( assays ),
Match Columns(
:Sample = :Sample,
:Peps = :Peps
)
);
Close( assays, No Save );
);
Re: 検量線のスクリプト作成方法これが最後のお願いです、約束します!
スクリプトをもう少し汎用的にして、名前に関係なくサンプルのセットに適用できるようにするには、この部分をどのように書き直したらよいでしょうか? たとえば、次のように書く代わりに:
サンプル = List( "001-AAA", "002-AAA", "003-AAA", "004-AAA");
Sample 列の概要を作成し、それらのエントリを取得してリストを作成するコードを作成できますか?
また、二変量関数を使用して検量線をプロットし、それが最終的に表示され、実行されたフィッティングを視覚的に確認できるようになれば素晴らしいでしょう。
Re: 検量線のスクリプト作成方法完全!
マークさん、いつもありがとう!
Re: 検量線のスクリプト作成方法インデックスは反復回数にのみ使用されるようになりました。 特定のサンプル ラベルは、反復の前にリストに取得されます。
// handle each sample set separately
sample = List( "001-AAA", "002-AAA", "003-AAA" );
For( s = 1, s <= 3, s++,
// isolate sample
combined
<< Select Where( :Sample == sample[s] )
<< Invert Row Selection
<< Exclude;
Re: 検量線のスクリプト作成方法あなたは私のことを誤解していると思います。 疑問とは、コードの機能を理解していないという意味です。 私はコーディングについてほとんど知識がありませんが、あなたのコードを疑う勇気はありません。私はただあなたを理解し、あなたから学ぼうとしているだけです。
最初の例は理解できたと思います。
2 番目の例では、サンプルに数値の代わりにテキスト指定がある場合、コードはどのように変更されるでしょうか? たとえば、サンプル 1、2、3 の代わりに、サンプル 001-AAA、002-AAA、003-AAA? があります。
Re: 検量線のスクリプト作成方法私のコードを疑うのですか? まあ、それはあなたの特権です。
最初の例では、列の数式プロパティを使用せずに新しい列を設定します。
For Each Row(
:Status = If( 1 <= Num( Regex( :Peps, "\w{3}(\d+)", "\1" ) ) <= 29, "Calibrator", "Unknown" );
);
の各行について()関数は、現在のデータテーブルの行を反復処理します。 行のインデックス付けは自動的に処理されます。 したがって、割り当ては行単位で行われます。 割り当ての右側は、もしも()関数。 最初の引数はブール式として解釈されます。 この式が true と評価されると、2 番目の引数 (「Calibrator」) が評価されて返されます。 それ以外の場合は、3 番目の引数 (「不明」) が評価されて返されます。 最初の引数は、Peps 数値が 1 ~ 29 の範囲内であるかどうかを決定します。 数値文字列を正規表現で抽出し、数値に変換します。 正規表現は、3 つの単語文字の後に 1 つ以上の数字文字が続くパターンと一致します。 後方参照は、唯一のキャプチャ グループを返します。
2 番目の例では、データ セット内の 3 つのサンプルを反復処理します。
For( s = 1, s <= 3, s++,
// isolate sample
ss = Char( s );
combined
<< Select Where( :Sample == ss )
<< Invert Row Selection
<< Exclude;
データ列の属性に一致するように文字列に変換される整数インデックスを使用します。 これは、結合データ テーブルにメッセージのカスケードを送信して、(1) 現在のサンプルのすべての行を選択し、(2) 現在のサンプル以外のすべての行に選択を変更し、(3) それらの行を除外します。 このアプローチは通常、データ テーブルをサブセット化し、後でデータ テーブルを結果と結合して連結するよりも簡単で高速です。
Re: 検量線のスクリプト作成方法完璧に機能します! ありがとう。
コードの各行が何をしているのか理解できたと思います。 これらについてはいくつか疑問があります。
<SPAN class="token function">For Each Row</SPAN><SPAN class="token punctuation">(</SPAN>
<SPAN class="token punctuation">:</SPAN>Status <SPAN class="token operator">=</SPAN> <SPAN class="token function">If</SPAN><SPAN class="token punctuation">(</SPAN> <SPAN class="token number">1</SPAN> <SPAN class="token operator"><=</SPAN> <SPAN class="token function">Num</SPAN><SPAN class="token punctuation">(</SPAN> <SPAN class="token function">Regex</SPAN><SPAN class="token punctuation">(</SPAN> <SPAN class="token punctuation">:</SPAN>Peps<SPAN class="token punctuation">,</SPAN> <SPAN class="token string">"\w{3}(\d+)"</SPAN><SPAN class="token punctuation">,</SPAN> <SPAN class="token string">"\1"</SPAN> <SPAN class="token punctuation">)</SPAN> <SPAN class="token punctuation">)</SPAN> <SPAN class="token operator"><=</SPAN> <SPAN class="token number">29</SPAN><SPAN class="token punctuation">,</SPAN> <SPAN class="token string">"Calibrator"</SPAN><SPAN class="token punctuation">,</SPAN> <SPAN class="token string">"Unknown"</SPAN> <SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">;</SPAN><SPAN class="token function">For</SPAN><SPAN class="token punctuation">(</SPAN> s <SPAN class="token operator">=</SPAN> <SPAN class="token number">1</SPAN><SPAN class="token punctuation">,</SPAN> s <SPAN class="token operator"><=</SPAN> <SPAN class="token number">3</SPAN><SPAN class="token punctuation">,</SPAN> s<SPAN class="token operator">++</SPAN><SPAN class="token punctuation">,</SPAN>
<SPAN class="token comment">// isolate sample</SPAN>
ss <SPAN class="token operator">=</SPAN> <SPAN class="token function">Char</SPAN><SPAN class="token punctuation">(</SPAN> s <SPAN class="token punctuation">)</SPAN><SPAN class="token punctuation">;</SPAN>
combined
<SPAN class="token operator"><</SPAN><SPAN class="token operator"><</SPAN><SPAN class="token messages"> Select Where</SPAN><SPAN class="token punctuation">(</SPAN> <SPAN class="token punctuation">:</SPAN>Sample <SPAN class="token operator">==</SPAN> ss <SPAN class="token punctuation">)</SPAN>
<SPAN class="token operator"><</SPAN><SPAN class="token operator"><</SPAN><SPAN class="token messages"> Invert Row Selection
</SPAN><SPAN class="token operator"><</SPAN><SPAN class="token operator"><</SPAN><SPAN class="token messages"> Exclude</SPAN><SPAN class="token punctuation">;</SPAN>
説明してもらえますか?
Re: 検量線のスクリプト作成方法Names Default to Here( 1 );
// check for sufficient tables
n tables = N Table();
If( n tables < 2,
Throw( "Two data tables are required for this analysis" )
);
tables = List();
For( t = 1, t <= n tables, t++,
Insert Into( tables, Eval( Data Table( t ) << Get Name ) );
);
// identify the calibration and unknown data tables
dlg = New Window( "Assay Unknown Samples", << Modal,
H List Box(
lb = List Box( tables ),
Line Up Box( N Col( 2 ),
Button Box( "Calibrator Table",
sel = lb << Get Selected;
cal lb << Append( sel );
),
cal lb = List Box( {},
N Lines( 1 )
),
Button Box( "Unknown Table",
sel = lb << Get Selected;
unk lb << Append( sel );
),
unk lb = List Box( {},
N Lines( 1 )
)
)
),
H List Box(
Button Box( "OK",
cal table = cal lb << Get Items;
Show( cal table );
unk table = unk lb << Get Items;
Show( unk table );
),
Button Box( "Cancel" )
)
);
If( dlg["Button"] == -1,
Throw( "User cancelled" )
);
// unload the dialog
cal table = Data Table( cal table[1] );
unk table = Data Table( unk table[1] );
// include AU 2 values for calibrators from calibration table
combined = cal table << Join( With( unk table ),
Copy formula( 0 ),
Select With( :Sample, :Peps, :AU 1 ),
Select( :AU 2 ),
By Matching Columns( :Peps = :Peps ),
Drop Multiples( 0, 0 ),
Include Nonmatches( 0, 1 ),
Preserve Main Table Order( 0 )
);
Close( cal table, No Save );
Close( unk table, No Save );
// distinquish peps
Current Data Table( combined );
combined << New Column( "Status", "Character", "Nominal" );
For Each Row(
:Status = If( 1 <= Num( Regex( :Peps, "\w{3}(\d+)", "\1" ) ) <= 29, "Calibrator", "Unknown" );
);
// placeholders for matching information
combined
<< New Column( "Predicted AU 2", "Numeric", "Continuous" )
<< New Column( "Lower 95%", "Numeric", "Continuous" )
<< New Column( "Upper 95%", "Numeric", "Continuous" );
// handle each sample set separately
For( s = 1, s <= 3, s++,
// isolate sample
ss = Char( s );
combined
<< Select Where( :Sample == ss )
<< Invert Row Selection
<< Exclude;
// fit the calibration curve for this sample
dlg = combined << Fit Model(
Y( :AU 1 ),
Effects( :AU 2 ),
Personality( "Standard Least Squares" ),
Emphasis( "Minimal Report" ),
Where( :Status == "Calibrator" )
);
fit = dlg << Run;
// determine the assay for the unknown samples from the calibration curve
For Each Row(
If( Not( Excluded( Row State( Row() ) ) ),
fit << Inverse Prediction( Response( :AU 1[] ) );
);
);
// access report layer
fit rep = fit << Report;
// remove extraneous string column box that interferes with making combined data table
(fit rep << XPath( "//StringColBox[StringColBoxHeader=\!"Type of CI\!"]")) << Delete;
// extract the assays into a new data table
assays = fit rep["Inverse Prediction"][TableBox(1)] << Make Combined Data Table;
fit << Close Window;
// prepare predicted values for join
assays
<< Delete Columns( Column( assays, 1 ) )
<< New Column( "Sample", "Character", "NominaL" )
<< New Column( "Peps", "Character", "NominaL" );
Current Data Table( combined );
r = 1;
For Each Row(
If( Not( Excluded( Row State( Row() ) ) ),
assays:Sample[r] = combined:Sample;
assays:Peps[r] = combined:Peps;
r++;
);
);
combined << Clear Row States;
combined << Update(
With( assays ),
Match Columns(
:Sample = :Sample,
:Peps = :Peps
)
);
Close( assays, No Save );
);Re: 検量線のスクリプト作成方法はい、彼らは内部校正者として 29 人のペップを持っています。 これらの特定の 29 peps は、校正テーブルから AU 2 値をフェッチし、次に各セットがサンプル番号に関連付けられた残りの peps を校正する必要があります。
同じ投稿で 2 つの異なることを要求したことで、これがさらに混乱したと思います。 申し訳ありません。
Re: 検量線のスクリプト作成方法では、3 つのサンプル セットは別々に扱う必要があるのでしょうか?
Re: 検量線のスクリプト作成方法話すのが早すぎたと思います。 問題マークが 1 つあります。 現時点では、スクリプトはすべての AU 2 値をキャリブレータ用のキャリブ テーブルから unk テーブルに取得していますが、これは問題ありません。 しかし、新しいテーブルは、適合モデルで使用されるキャリブレーター指定で割り当てられたすべてを使用しており、未知数はその 1 つのモデル (サンプル 1、2、および 3 のキャリブレーターが一緒にプールされている) から予測されています。
私が必要とするのは、サンプルごとの適合モデルと、そのサンプルの未知数がそのサンプルのみに関連付けられた適合モデルで決定されることです。
Re: 検量線のスクリプト作成方法これは完璧です! マークさん、本当にありがとうございました!
Re: 検量線のスクリプト作成方法わかりました、わかりやすくしてくれてありがとう。
Names Default to Here( 1 );
// check for sufficient tables
n tables = N Table();
If( n tables < 2,
Throw( "Two data tables are required for this analysis" )
);
tables = List();
For( t = 1, t <= n tables, t++,
Insert Into( tables, Eval( Data Table( t ) << Get Name ) );
);
// identify the calibration and unknown data tables
dlg = New Window( "Assay Unknown Samples", << Modal,
H List Box(
lb = List Box( tables ),
Line Up Box( N Col( 2 ),
Button Box( "Calibrator Table",
sel = lb << Get Selected;
cal lb << Append( sel );
),
cal lb = List Box( {},
N Lines( 1 )
),
Button Box( "Unknown Table",
sel = lb << Get Selected;
unk lb << Append( sel );
),
unk lb = List Box( {},
N Lines( 1 )
)
)
),
H List Box(
Button Box( "OK",
cal table = cal lb << Get Items;
Show( cal table );
unk table = unk lb << Get Items;
Show( unk table );
),
Button Box( "Cancel" )
)
);
If( dlg["Button"] == -1,
Throw( "User cancelled" )
);
// unload the dialog
cal table = Data Table( cal table[1] );
unk table = Data Table( unk table[1] );
// include AU 2 values for calibrators from calibration table
combined = cal table << Join(
With( unk table ),
Copy formula( 0 ),
Select With( :Sample, :Peps, :AU 1 ),
Select( :AU 2 ),
By Matching Columns( :Peps = :Peps ),
Drop Multiples( 0, 0 ),
Include Nonmatches( 0, 1 ),
Preserve Main Table Order( 0 )
);
Close( cal table, No Save );
Close( unk table, No Save );
// distinquish peps
Current Data Table( combined );
combined << New Column( "Status", "Character", "Nominal" );
For Each Row(
:Status = If( 1 <= Num( Regex( :Peps, "\w{3}(\d+)", "\1" ) ) <= 29, "Calibrator", "Unknown" );
);
// fit the calibration curve
dlg = combined << Fit Model(
Y( :AU 1 ),
Effects( :AU 2 ),
Personality( "Standard Least Squares" ),
Emphasis( "Minimal Report" ),
Where( :Status == "Calibrator" )
);
fit = dlg << Run;
// determine the assay for the unknown samples from the calibration curve
For Each Row(
fit << Inverse Prediction( Response( :AU 1[] ) );
);
// extract the assays into a new data table
assays = Report( fit )["Inverse Prediction"][TableBox(1)] << Make Combined Data Table;
fit << Close Window;
assays << Delete Columns( Column( assays, 1 ) );
// add the assays to the unknown table
final = combined << Join(
With( assays ),
Copy formula( 0 ),
By Matching Columns( :AU 1 = :Specified AU 1 ),
Drop Multiples( 0, 0 ),
Include Nonmatches( 1, 0 ),
Preserve Main Table Order( 1 )
);
Close( combined, No Save );
Close( assays, No Save );
final << Sort(
By( :Peps, :Sample ),
Order( Ascending, Ascending ),
Replace Table
);
AU 1 のランダムな測定により、予測された AU 2 値の一部が欠落しています。
Re: 検量線のスクリプト作成方法それは完璧に機能しました。 そしてそれは私が助けを求めたことを実行します。 しかし、私の最初の投稿には 2 つの部分がありました。 1 つ目は、あなたが教えてくれたようにキャリブレーションのスクリプトを作成する方法を知ることでした。
2 つ目は、1 つ目とは関係がないため、まったく異なるスクリプトとなり、次のことを実行します。
未知のテーブルには 3 つのサンプルがあり、各サンプルは 74 Peps について分析されました。 これらのペップのうち 29 個は、残りの 45 個の調整に使用したいと考えています。 そして、キャリブレーション テーブルから AU 2 値を取得することでそれを行いたいと考えています。 したがって、スクリプトはキャリブレーション テーブルから AU 2 値をフェッチし、未知のテーブル内の各サンプルの 1 ~ 29 Peps と結合する必要があります。その後、各サンプルと属性 AU 2 のキャリブレーション カーブ (線形回帰) を作成する必要があります。値を残りの 45 ペップにします。
付き合ってくれてありがとう!
これらの値は相関関係がないことはわかっています。これらの値は、スクリプトの作成方法を学習する目的でランダムに生成されたものです。
Re: 検量線のスクリプト作成方法私は混乱しています。
まず第一に、それはうまくいきましたか? ある程度までは機能しましたか?
次に、はい、キャリブレーションはすべてキャリブレーション テーブルの AU 1 および AU 2 の値を使用して実行されます。 それは正しくありませんか?
3 番目に、不明なテーブルには AU 2 値がありません。 予測された未知の AU 2 値を使用するということですか?
第 4 に、これはキャリブレーション定義への変更ですか、それとも AU を予測した後の新しい要件 (ステップに続く) ですか。不明なテーブルに 2 はありますか?
第五に、サンプルとは何ですか? ペップスとどう関係するの?
第 6 に、Pep1 から Pep29 までのキャリブレーター テーブルの AU 1 は関連付けられるべきではないでしょうか。 ではない:

おそらく非常に重要で基本的なものが欠けていると思います。
Re: 検量線のスクリプト作成方法マークに感謝します。うまくいきました。
スクリプトを見ると、これはキャリブレーター テーブルの AU 1 と AU 2 の値を使用した単純なキャリブレーション用であることが分かりました。
キャリブレーターがキャリブレーター テーブルで指定された AU 1 値と未知のテーブルの AU 2 になるように再配置して (サンプルごとに異なるキャリブレーターにする)、残りの成分の AU 2 値を予測するにはどうすればよいですか?サンプルの中では?
Re: 検量線のスクリプト作成方法バージョンの問題です。 JMP 13 を開いたところ、(1) 関数が強調表示されなくなり、(2) スクリプト インデックスに見つかりませんでした。
そんなことになったら嫌だ!
この回避策を試してください。
Names Default to Here( 1 );
// find all open data tables
/* for JMP 14 and later:
tables = Get Data Table List();
*/
n tables = N Table();
If( n tables < 2,
Throw( "Two data tables are required for this analysis" )
);
tables = List();
For( t = 1, t <= n tables, t++,
Insert Into( tables, Eval( Data Table( t ) << Get Name ) );
);
// present open tables for assignment as calibration or unknown.
dlg = New Window( "Assay Unknown Samples", << Modal,
H List Box(
lb = List Box( tables ),
Line Up Box( N Col( 2 ),
Button Box( "Calibrator Table",
sel = lb << Get Selected;
cal lb << Append( sel );
),
cal lb = List Box( {},
N Lines( 1 )
),
Button Box( "Unknown Table",
sel = lb << Get Selected;
unk lb << Append( sel );
),
unk lb = List Box( {},
N Lines( 1 )
)
)
),
H List Box(
Button Box( "OK",
cal table = cal lb << Get Items;
Show( cal table );
unk table = unk lb << Get Items;
Show( unk table );
),
Button Box( "Cancel" )
)
);
If( dlg["Button"] == -1,
Throw( "User cancelled" )
);
// unload dialog
cal table = Data Table( cal table[1] );
unk table = Data Table( unk table[1] );
// perform the linear calibration
dlg = cal table << Fit Model(
Y( :AU 1 ),
Effects( :AU 2 ),
Personality( "Standard Least Squares" ),
Emphasis( "Minimal Report" )
);
fit = dlg << Run;
// perform inverse prediction on unknown
Current Data Table( unk table );
For Each Row(
fit << Inverse Prediction( Response( :AU 1[] ) );
);
// unload unknown assays
assays = Report( fit )["Inverse Prediction"][TableBox(1)] << Make Combined Data Table;
fit << Close Window;
assays << Delete Columns( Column( assays, 1 ) );
// join with unknown table
unk table << Join(
With( assays ),
By Row Number
);
Close( assays, No Save );
// plot predictions with 95% confidence intervals versus actual
unk table << Graph Builder(
Size( 534, 454 ),
Show Control Panel( 0 ),
Variables(
X( :AU 1 ),
Y( :Lower 95% ),
Y( :Upper 95%, Position( 1 ) ),
Y( :Predicted AU 2, Position( 1 ) )
),
Elements(
Bar( X, Y( 1 ), Y( 2 ), Y( 3 ), Legend( 8 ), Bar Style( "Interval" ) )
),
SendToReport(
Dispatch( {}, "AU 1", ScaleBox, {Format( "Best", 12 )} ),
Dispatch( {}, "Lower 95%", ScaleBox, {Format( "Fixed Dec", 12, 0 )} )
)
);Re: 検量線のスクリプト作成方法おそらく JMP バージョンの問題 (私は JMP 13.1 を使用しています) ですが、スクリプトは機能しません。 JSL デバッガを使用しましたが、最初にエラーが発生しました: 名前が解決されていません: 'Get Data Table List' のアクセスまたは評価でデータ テーブル リストを取得 , Get Data Table List() /*###*/
Re: 検量線のスクリプト作成方法基本的な問題は理解できたと思いますが、詳細を見逃している可能性があります。 両方のデータ テーブル (キャリブレーション テーブルと不明テーブル) を開いた状態でこのスクリプトを試してください。
Names Default to Here( 1 );
// find all open data tables
tables = Get Data Table List();
If( N Items( tables ) < 2,
Throw( "Two data tables are required for this analysis" )
);
dlg = New Window( "Assay Unknown Samples", << Modal,
H List Box(
lb = List Box( tables ),
Line Up Box( N Col( 2 ),
Button Box( "Calibrator Table",
sel = lb << Get Selected;
cal lb << Append( sel );
),
cal lb = List Box( {},
N Lines( 1 )
),
Button Box( "Unknown Table",
sel = lb << Get Selected;
unk lb << Append( sel );
),
unk lb = List Box( {},
N Lines( 1 )
)
)
),
H List Box(
Button Box( "OK",
cal table = cal lb << Get Items;
Show( cal table );
unk table = unk lb << Get Items;
Show( unk table );
),
Button Box( "Cancel" )
)
);
If( dlg["Button"] == -1,
Throw( "User cancelled" )
);
// unload dialog
cal table = Data Table( cal table[1] );
unk table = Data Table( unk table[1] );
// perform the linear calibration
dlg = cal table << Fit Model(
Y( :AU 1 ),
Effects( :AU 2 ),
Personality( "Standard Least Squares" ),
Emphasis( "Minimal Report" )
);
fit = dlg << Run;
// perform inverse prediction on unknown
Current Data Table( unk table );
For Each Row(
fit << Inverse Prediction( Response( :AU 1[] ) );
);
// unload unknown assays
assays = Report( fit )["Inverse Prediction"][TableBox(1)] << Make Combined Data Table;
fit << Close Window;
assays << Delete Columns( Column( assays, 1 ) );
// join with unknown table
unk table << Join(
With( assays ),
By Row Number
);
Close( assays, No Save );
// plot predictions with 95% confidence intervals versus actual
unk table << Graph Builder(
Size( 534, 454 ),
Show Control Panel( 0 ),
Variables(
X( :AU 1 ),
Y( :Lower 95% ),
Y( :Upper 95%, Position( 1 ) ),
Y( :Predicted AU 2, Position( 1 ) )
),
Elements(
Bar( X, Y( 1 ), Y( 2 ), Y( 3 ), Legend( 8 ), Bar Style( "Interval" ) )
),
SendToReport(
Dispatch( {}, "AU 1", ScaleBox, {Format( "Best", 12 )} ),
Dispatch( {}, "Lower 95%", ScaleBox, {Format( "Fixed Dec", 12, 0 )} )
)
);
スクリプトは柔軟ではありませんが、始まりではあります。
Re: 検量線のスクリプト作成方法ここに 2 つのテーブルの例を示します。 1 つはキャリブレーター テーブルです。 もう 1 つのテーブルは、測定値 (AU 1) が含まれており、未知の値 (AU 2) を取得するために校正が必要なテーブルです。 話を少し複雑にしているのは、この表には 3 つの異なるサンプルの測定値が含まれており、これら 3 つのサンプルのそれぞれには、キャリブレーターの作成に使用されたコンポーネントも含まれています。 つまり、各サンプルには、いわば内部キャリブレーターが存在します。
内部キャリブレーターがあるという事実 (キャリブレーター テーブルにあるものの単純な線形回帰と、その式を使用してサンプル テーブルから未知数を取得する) を完全に省略するキャリブレーションのスクリプトを作成する方法を知ることは素晴らしいことです。 また、各サンプル (サンプル テーブル) 内のキャリブレーター コンポーネントの測定値 (AU 1) を使用し、それをキャリブレーター テーブルの既知の値 (AU 2) に対してプロットし、計算するキャリブレーションのスクリプトを作成する方法を知っておくとさらに良いでしょう。特定のサンプルの未知数を調べ、サンプル テーブルに存在する各サンプルに対して同じことを行います。
英語は私の母国語ではないので、もう少しわかりやすくする必要がある場合はお知らせください。
助けていただければ幸いです。
乾杯。
Re: 検量線のスクリプト作成方法分析方法とプロセスを確認していただきありがとうございます。 脚本に進みましょう!
データのサンプルを提供していただけますか? 一般名(匿名データ)を使用できます。 そうすることで、スクリプトがデータ テーブルから何を期待すべきかを理解できます。
Re: 検量線のスクリプト作成方法ありがとうマーク。
あなたが言及した手順に従って、カスタム逆予測を取得しました。 はい、線形回帰です。
この点での問題は、入力できる未知の数が限られていることです。 スクリプトに関する質問は、何千もの未知数があることを念頭に置いて尋ねられたもので、手順をスクリプト化することでそれらすべての未知数の値を取得できると想定しました。
Re: 検量線のスクリプト作成方法まずは、JMP を使用してこの分析を対話的に実行する方法を学ぶことをお勧めします。 見るヘルプ>本>予測的で特殊なモデリング> についての章フィットカーブ。 目的に応じてこのプラットフォームを使用する方法を説明します。 これには、独自のデータを分析する前にガイドし、練習するのに役立つ例が含まれています。
現在検量線に使用しているモデルは何ですか? 線形回帰について言及しています。 この場合は、「Fit Curve」の横にある赤い三角形をクリックして、「Fit Curve」を選択します。多項式>線形にフィット。 次に、[線形] の横にある赤い三角形をクリックして、[線形] を選択します。カスタム逆予測。 ダイアログが表示され、不明な応答を入力できます。
まず、Fit Curve プラットフォームを対話的に使用して、この分析が適切であり、求める結果が得られることを確認します。 それから、スクリプトを手伝ってみましょう。