Doc:MassBank/PPR
From Metabolomics.JP
(Difference between revisions)
m |
m |
||
Line 64: | Line 64: | ||
table.insert(list, formula) | table.insert(list, formula) | ||
end | end | ||
− | print(" | + | print("{{MassBank/Matrix|data=") |
print(table.concat(list,"&&")) | print(table.concat(list,"&&")) | ||
Revision as of 21:03, 3 June 2009
Contents |
How to Create Precursor-Product Page
Step1
まず以下のスロットにイオンのリストを半角スペース区切りで質量の降順に入力してください。 その後、Createボタンを押してください。
Step2
生成された文字列がページソースの基本です。
{{#lua:
FORMULA_PAT = "(C?[1-9]?[0-9]?)(H?[1-9]?[0-9]?)(C?l?[2-9]?)(F?[2-9]?)(I?[2-9]?)(N?[1-9]?[0-9]?)(O?[1-9]?[0-9]?)(P?[2-9]?)(S?[2-9]?)"; FORMULA_CHAR = "CHFINOPSl0-9"; ATOM = {"C", "H", "Cl", "F", "I", "N", "O", "P", "S"}; MASS = {12, 1, 35, 19, 127, 14, 16, 31, 32};
function toFormula(t) for i,v in pairs(t) do if (v == "") then t[i] = 0 else if (v == ATOM[i]) then t[i] = 1 else t[i]=tonumber(string.sub(v,1+string.len(ATOM[i]))) end end end return t end
function mass(str) local t = toFormula({string.match(str,FORMULA_PAT)}) ret = 0; for i,v in pairs(t) do ret = ret + t[i] * MASS[i] end return ret; end
function diff(str1, str2) ---computes str1 - str2. If negative, returns nil.--- local t1 = toFormula({string.match(str1,FORMULA_PAT)}) local t2 = toFormula({string.match(str2,FORMULA_PAT)}) for i,_ in pairs(t1) do if (t1[i] < t2[i]) then return nil else t1[i] = t1[i]-t2[i] end end local ret = ""; for i,v in pairs(t1) do if (v >= 1) then ret = ret .. ATOM[i] end if (v > 1) then ret = ret .. v end end return ret end
local list = {} local x = nil for formula in stdin:gmatch("([%S]+)") do if (x ~= nil and mass(formula) > mass(x)) then print('Illegal ion order (check mass!): '..x..' < '..formula..'
') end x = formula table.insert(list, formula) end print("
General Index | Ion Frequency | Prec.-Product | Neutral Loss | Help |
IDs and Links | |
---|---|
MassBank | [1] |
CAS | |
Keio ID |
Top 10 Similar Molecules of
Ranking | About scoring |
---|---|
The similarity score between two molecules is defined as the sum of Shannon entropy of ionic formulas shared by the molecules:
|
Links
Page list for each fragment |
---|
Annotations
Precursor | Product | Comments |
---|---|---|
(0) | (0) | ")
print(table.concat(list,"&&")) for i=1,table.getn(list)-1 do label = false str = "&&"..list[i]..":" for j=i+1,table.getn(list) do if (diff(list[i],list[j])) then str = str .. " " ..list[j] label = true end end if (label) then print(str) end end |
Precursor-Product Relationship
About the PP Table (行列表示について) | |
---|---|
The matrix is viewed columnwise. The topmost precursor ion in bold face produces the product ions beneath it.
Each formula in matrix cells corresponds to the neutral loss. Blackout cells indicate products that cannot be derived, and orange cells indicate a structurally plausible link produced by cleaving a single chemical bond (in cases of ring-opening, two bonds). |
行列は列方向に見ます。最上段太字の前駆イオン(precursor ion)が直下の生成イオン群(product ions)になると解釈します。
行列要素に書かれている組成式はニュートラルロスです。黒は前駆イオンから生成しえない関係、オレンジは分子構造における共有結合1本の切断(開環の場合は2本)で生じる関係を意味します。 |
No "ION INFO" line in the form &&(formula)&&(formula)&&...&&
MassBank/PPR | 210 CHClFIONSP |
---|---|
210 CHClFIONSP |
|