Help:Extension/MolFunctions

From Metabolomics.JP
(Difference between revisions)
Jump to: navigation, search
Line 7: Line 7:
 
__TOC__
 
__TOC__
  
Molfiles形式のSKP部に、適切なデータを入れたmolファイルを用意することで、組成式、平均質量、精密質量、smilesを取得できるようになるextensionです。
+
Extension to obtain molecular formula, exact mass, and others from MOL-format files.
 
+
例えば、以下のような記述です。各値のペアはタブ区切りです。
+
  
 +
You need to prepare a MOL-format file with a trailer like the following.
 +
<pre>
 
  S  SKP  5
 
  S  SKP  5
 
  ID FL3FECGS0010
 
  ID FL3FECGS0010
Line 18: Line 18:
 
  SMILES C(O)C(C1O)(COC1Oc(c2O)cc(O3)c(C(=O)C=C3c(c4)cc(c(O)c4)O)c2O)O
 
  SMILES C(O)C(C1O)(COC1Oc(c2O)cc(O3)c(C(=O)C=C3c(c4)cc(c(O)c4)O)c2O)O
 
  M  END
 
  M  END
 +
</pre>
  
molファイルの格納されたディレクトリはファイル数が多くなってしまうため、IDの上位4文字のディレクトリを作成し、その中へグループ分けして格納して下さい。<br>
+
Since the number of MOL-format files is large, create directories whose names are the upper 4 digits of the filenames. <br>
例えば上記の「FL3FECGS0010」であれば、IDの上位4文字は「FL3F」なので「/path to mol directory/FL3F/FL3FECGS0010.mol」というパスになります。
+
For example, in the case of FL3FECGS0010, the location will be <tt>/path to mol directory/FL3F/FL3FECGS0010.mol</tt>.
  
molディレクトリへは、$_SERVER["DOCUMENT_ROOT"]の値を使用してアクセスします。<br>
+
The system assumes the location of the MOL directory as $_SERVER["DOCUMENT_ROOT"].<br>
そのため、Web経由以外からこのextensionが呼び出されると失敗します(例えば、maintenance/runJobs.phpによるjobの一括処理)。<br>
+
For this reason, the extension fails when called from outside of www, such as jobs by maintenance/runJobs.php.<br> In this case, assign the path of DocumentRoot in $spath (line 121).
そのため、121行目の「$path」にDocumentRootの絶対パスを書いておくと、正しく処理されます。
+
  
 
== Requirements ==
 
== Requirements ==
Line 42: Line 42:
 
  <pre>require_once( "$IP/extensions/MolFunctions.php" );
 
  <pre>require_once( "$IP/extensions/MolFunctions.php" );
 
$egMolPath = "path to mol directory from DocumentRoot";</pre>
 
$egMolPath = "path to mol directory from DocumentRoot";</pre>
$egMolPathを設定しなかった場合、処理は実行されません。</li>
+
If $egMolPath is nil, the extention stops.</li>
 
</ol>
 
</ol>
  
 
== Function ==
 
== Function ==
# [[Doc:Extensions#.7B.7B.23formula:id.3D.27.27.7D.7D|formula]]
+
# [[Help:Extensions#.7B.7B.23formula:id.3D.27.27.7D.7D|formula]]
# [[Doc:Extensions#.7B.7B.23avemass:id.3D.27.27.7D.7D|avemass]]
+
# [[Help:Extensions#.7B.7B.23avemass:id.3D.27.27.7D.7D|avemass]]
# [[Doc:Extensions#.7B.7B.23extmass:id.3D.27.27.7D.7D|extmass]]
+
# [[Help:Extensions#.7B.7B.23extmass:id.3D.27.27.7D.7D|extmass]]
# [[Doc:Extensions#.7B.7B.23smiles:id.3D.27.27.7D.7D|smiles]]
+
# [[Help:Extensions#.7B.7B.23smiles:id.3D.27.27.7D.7D|smiles]]

Revision as of 17:12, 20 September 2008

Extension Information
Implementation
Description
Author(s)K, Suwa
Version0.1
MediaWiki1.11.1
License
Hooks used
Token type

Contents


Extension to obtain molecular formula, exact mass, and others from MOL-format files.

You need to prepare a MOL-format file with a trailer like the following.

 S  SKP  5
 ID	FL3FECGS0010
 FORMULA	C20H18O11
 EXACTMASS	434.084911418
 AVERAGEMASS	434.35032
 SMILES	C(O)C(C1O)(COC1Oc(c2O)cc(O3)c(C(=O)C=C3c(c4)cc(c(O)c4)O)c2O)O
 M  END

Since the number of MOL-format files is large, create directories whose names are the upper 4 digits of the filenames.
For example, in the case of FL3FECGS0010, the location will be /path to mol directory/FL3F/FL3FECGS0010.mol.

The system assumes the location of the MOL directory as $_SERVER["DOCUMENT_ROOT"].
For this reason, the extension fails when called from outside of www, such as jobs by maintenance/runJobs.php.
In this case, assign the path of DocumentRoot in $spath (line 121).

Requirements

None

Download

versionsourcesize
0.1(September 11,2008)MolFunctions.phps

Installtion

  1. Download source and rename to MolFunctions.php.
  2. Put in extensions/ directory.
  3. Insert follow line to LocalSettings.php
    require_once( "$IP/extensions/MolFunctions.php" );
    $egMolPath = "path to mol directory from DocumentRoot";
    If $egMolPath is nil, the extention stops.

Function

  1. formula
  2. avemass
  3. extmass
  4. smiles
Personal tools
Namespaces

Variants
Actions
Navigation
metabolites
Toolbox