Template:MassBank/Matrix
From Metabolomics.JP
(Difference between revisions)
Line 1: | Line 1: | ||
{{MassBank/Header}} | {{MassBank/Header}} | ||
+ | <!---化合物組成式の正規表現--------->{{#def: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]?)}} | ||
+ | <!---化合物組成式に出てくる文字列--->{{#def:FORMULA_CHAR|CHFINOPSl0-9}} | ||
+ | <!---化合物組成式に使われる原子----->{{#def:ATOM|{"C", "H", "Cl", "F", "I", "N", "O", "P", "S"} }} | ||
+ | <!---各原子の質量(上のリスト)------->{{#def:MASS|{12, 1, 35, 19, 127, 14, 16, 31, 32} }} | ||
=Top 10 Similar Molecules= | =Top 10 Similar Molecules= | ||
Line 82: | Line 86: | ||
{{#lua: | {{#lua: | ||
---print comments--- | ---print comments--- | ||
− | FORMULA_CHAR = " | + | FORMULA_CHAR = "{{#var:FORMULA_CHAR}}" |
+ | FORMULA_PAT = "{{#var:FORMULA_PAT}}" | ||
+ | FORMULA_CHAR = "{{#var:FORMULA_CHAR}}" | ||
+ | ATOM = {{#var:ATOM}} | ||
+ | MASS = {{#var:MASS}} | ||
+ | |||
+ | 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 | ||
+ | |||
ret = "" | ret = "" | ||
comment = ""; | comment = ""; | ||
Line 93: | Line 124: | ||
if (h ~= nil and t ~= nil) then | if (h ~= nil and t ~= nil) then | ||
if (comment ~= "") then | if (comment ~= "") then | ||
− | ret = ret .."~-\n~~"..head.." ~~ "..tail.."\n~~ "..comment.."\n" | + | ret = ret .."~-\n~~"..head.."("..mass(head)..")".." ~~ "..tail.."("..mass(tail)..")".."\n~~ "..comment.."\n" |
comment = "" | comment = "" | ||
end | end | ||
Line 103: | Line 134: | ||
until true | until true | ||
end | end | ||
+ | ---output each comment (head=precursor, tail=product)--- | ||
if (comment ~= "") then | if (comment ~= "") then | ||
ret = ret .. "~-\n~~"..head.." ~~ "..tail.."\n~~ "..comment.."\n" | ret = ret .. "~-\n~~"..head.." ~~ "..tail.."\n~~ "..comment.."\n" | ||
Line 124: | Line 156: | ||
{{#replace: | {{#replace: | ||
{{#lua: | {{#lua: | ||
− | FORMULA_PAT = " | + | FORMULA_PAT = "{{#var:FORMULA_PAT}}" |
− | FORMULA_CHAR = " | + | FORMULA_CHAR = "{{#var:FORMULA_CHAR}}" |
− | ATOM = { | + | ATOM = {{#var:ATOM}} |
− | MASS = { | + | MASS = {{#var:MASS}} |
function toFormula(t) | function toFormula(t) |
Revision as of 11:33, 8 June 2009
General Index | Ion Frequency | Prec.-Product | Neutral Loss | Help |
Contents |
Top 10 Similar Molecules
Similarity score is defined as the sum of Shannon entropy of shared ionic formulas.
- MassBank:KOX00662p Score:19.04
- MassBank:KOX00276p Score:19.04
- MassBank:KOX00039p Score:10.76
- MassBank:KOX00795p Score:8.27
- MassBank:KOX00740p Score:8.27
- MassBank:KOX00739p Score:8.27
- MassBank:KOX00547p Score:8.27
- MassBank:KOX00292p Score:8.27
- MassBank:KOX00102p Score:8.27
- MassBank:KOX00700p Score:5.38
Links
Annotations
Precursor | Product | Comments |
---|---|---|
CHClFINOPS |
Precursor-Product Relationship
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).
No "ION INFO" line in the form &&(formula)&&(formula)&&...&&
ID: MassBank/Matrix | 210 CHClFIONSP |
210 CHClFIONSP |
|