| WSDL (Web Services Description Language) : http://metlin.scripps.edu/soap/metlin-1.0.wsdl |
Register here to receive valid token |
Metabolite Search |
|
- To obtain range of metabolites matching search parameters (mass, tolerance, adduct, etc.). |
| Parameter | Type | Description |
| Token | String | Register to receive a token. |
| Mass | Array of float | Specifies one or more masses to be searched. 500 mass limit. |
| Adduct | Array of string | Specifies one or more adducts to be selected. Neutral : ('M') Positive : ('M+H','M+NH4','M+Na','M+H-2H2O','M+H-H2O','M+K','M+ACN+H', 'M+ACN+Na','M+2Na-H', 'M+2H','M+3H','M+H+Na','M+2H+Na','M+2Na','M+2Na+H') Negative : ('M-H','M-H2O-H','M+Na-2H','M+Cl','M+K-2H','M+FA-H','M-2H','M-3H') |
| Tolerance | Float | Specifies amount of tolerance (< 1 Da or < 1000 ppm). |
| Tolerance units | String | Specifies the units of tolerance (Da or ppm). |
|
Below is a sample php-SOAP client [Please feel free to copy and use this as a template]: |
| <?php ini_set('soap.wsdl_cache_enable', 0 ); // Batch search for multiple masses and adducts $token = "myToken"; $mass = array(195.0877,181.0702); $adduct = array('M+H','M+Na','M+K'); $tolunits = "ppm"; $tolerance = 30; // Search parameters. Can also use a class instead of an array to map "mass", "adduct", ... to their corresponding value // Can call the SoapClient functions _getTypes() and _getFunctions() to see the required types and structures for the WSDL $parameters = array("token" => $token, "mass" => $mass, "adduct" => $adduct, "tolerance" => $tolerance, "tolunits" => $tolunits); // Call the MeatboliteSearch function via the soap service try{ $client = new SoapClient("http://metlin.scripps.edu/soap/metlin-1.0.wsdl"); $return = $client->MetaboliteSearch($parameters); }catch (SoapFault $fault){ echo $fault; trigger_error("SOAP Fault: (faultcode: {$fault->faultcode}, faultstring: {$fault->faultstring})", E_USER_ERROR); } /* The SOAP return variable for the MetaboliteSearch function is struct containing a 2-D array * with the format: $return[all adduct/mass combos][metabolites returned from each combo]. Adduct/mass * combinations are stored in the array as follows: for a seach of adducts (a1,a2,...,an) and masses (m1,m2,...,mn) * the results are stored in the array as result (a1/m1,a1/m2,...,a2/m1,...,an/mn) with each adduct mass combo * mapping to an array of metabolites that matches the particular adduct mass search. */ $count = 0; for($i = 0; $i<count($adduct); $i++){ echo("<br><b><u>Adduct: $adduct[$i] </u></b></br>"); for($j=0; $j<count($mass); $j++){ echo("<br><b>Mass: $mass[$j] </b>"); $AMCombo = $return[$count]; echo(" <b>Results: ".count($AMCombo)."</b>"); if(count($AMCombo) > 0){ echo "<table border='1' width=90% style='table-layout:fixed'><tr><td width = '7%'>METLIN ID</td> <td width = '7%'>MASS</td><td width='36%'>NAME</td><td width='10%'>FORMULA</td> <td width = '10%'>ADDUCT</td></tr>"; // Display each metabolite foreach($AMCombo as $singleSearchResults){ echo "<tr>"; echo "<td><a href=\"http://metlin.scripps.edu/metabo_info.php?molid=".$singleSearchResults->molid."\">".$singleSearchResults->molid."</a></td>"; echo "<td>".number_format($singleSearchResults->mass,4)."</td>"; echo "<td>".$singleSearchResults->name."</td>"; echo "<td>".$singleSearchResults->formula."</td>"; echo "<td> $adduct[$i] </td>"; echo "</tr>"; } echo "</table>"; }else echo "<br>"; ; $count++; } } ?> |
|
Search Results -> Below is the response to the sample client above: |
|
Adduct: M+H Mass: 195.0877 Results: 15
Mass: 181.0702 Results: 29
Adduct: M+Na Mass: 195.0877 Results: 3
Mass: 181.0702 Results: 4
Adduct: M+K Mass: 195.0877 Results: 1
Mass: 181.0702 Results: 1
|
|
Using Java: Here is a sample Metabolite Search Java Client :
You will need to do the following in order to compile and run this example: (Note that the WSDL file in the java is different from the link above.) |
|
% java -cp .;* org.apache.axis.wsdl.WSDL2Java http://metlin.scripps.edu/soap/metlin-1.1.wsdl % javac -classpath .;* MetlinTest.java % java -cp .;* MetlinTest |
Spectrum Match |
|
- Spectrum Match facilitates identification of both known and unknown metabolites against METLIN MS/MS database using the modified X-Rank algorithm with your spectrum(m/z, intensity) and few parameters. |
| Parameter | Type | Description |
| Token | String | Register to receive a token. The same token can be used for both Metabolite Search and Spectrum Match. |
| Mass | Array of float | Specifies one or more masses to be searched. 30 mass limit. |
| Intensity | Array of int | Specifies one or more intensities. Each intensity corresponds with a mass (mass[0] will be paired with intensity[0]...). Number of intensities must equal the number of masses. |
| Mode | String | Specifies the mode. Must be either 'pos' or 'neg' exactly. |
| Collision Energy | int | Specifies the collision energy. Must be either 10, 20, or 40. Units are eV. |
| Tolerance MSMS | float | Specifies the tolerance of the MSMS data. Must be between 0.001 and 0.5. Units are Da. |
| Tolerance Precursor | int | Specifies the tolerance of the precursor. Must be between 1 and 100. Units are ppm. |
| Precursor Mass | float | Specifies the mass of the precursor. |
|
Below is a sample php-SOAP client [Please feel free to copy and use this as a template]: |
| <?php ini_set('soap.wsdl_cache_enable', 0 ); // Spectrum Match Parameters $token = "myToken"; $specMasses = array(138.066,110.071,42.034,69.045,123.043,83.060,109.036); $intensity = array(10877,2221,644,351,350,318,234); $mode = "pos"; $ce = 20; $tolMS = 0.01; $tolPrec = 20; $prec = 195.0877; // Search parameters. Can also use a class instead of an array to map "token", "mass", ... to their corresponding value // Can call the SoapClient functions _getTypes() and _getFunctions() to see the required types and structures for the WSDL $specparam = array("token"=>$token, "mass" => $specMasses, "intensity" => $intensity, "mode" => $mode, "collisionEnergy" => $ce, "toleranceMSMS" => $tolMS, "tolerancePrecursor" => $tolPrec, "precursorMass" => $prec); // Call the SpectrumMatch function via the soap service try{ $client = new SoapClient("http://metlin.scripps.edu/soap/metlin-1.0.wsdl"); $return = $client->SpectrumMatch($specparam); }catch (SoapFault $fault){ echo $fault; trigger_error("SOAP Fault: faultcode:". ($fault->faultcode), $fault->faultstring); } /* The SOAP return variable for the SpectrumMatch function is a struct containing a 2-D array * with the format: $return->SpectrumMatchResult[# of results][line info on each result]. */ $count = count($return); if($count < 1){ echo "No result is returned, please try again with different parameters!!"; } else{ echo "<table align =\"center\" border=\"1\" cellpadding = \"3\" bordercolor = \"#747170\"><tr>"; echo "<th align = \"center\" valign=\"top\">METLIN ID</th>"; echo "<th align = \"center\" valign=\"top\">Name</th>"; echo "<th align = \"center\" valign=\"top\">METLIN Score<br/>(0-100)</th>"; echo "<th align = \"center\" valign=\"top\">precursor</th>"; echo "<th align = \"center\" valign=\"top\">precursor<br/>ΔPPM</th>"; echo "<th align = \"center\" valign=\"top\">Spectrum Matching</th></tr>"; for($i=0 ; $i < $count ; $i++){ $metlinID = $return[$i][0]->value; $name = $return[$i][1]->value; $metlinScore = $return[$i][2]->value; $precursor = $return[$i][3]->value; $precursorPPM = $return[$i][4]->value; $spectrumMatching = $return[$i][5]->value; echo '<tr><td align = "center" width="80"><a href="http://metlin.scripps.edu/metabo_info.php?molid='.$metlinID.'">'.$metlinID."</a></td>"; echo '<td width="200">'.$name.'</td>'; echo "<td align='center'>".$metlinScore."</td>"; echo "<td align='center'>".$precursor."</td>"; echo "<td align='center'>".$precursorPPM."</td>"; echo '<td width="240"> <a href="'.$spectrumMatching.'" class="highslide" onclick="return hs.expand(this)"> <img src= "'.$spectrumMatching.'" alt ='.$metlinID.' title= "Click to enlarge" width = "240" height = "150"></a></td></tr>'; } echo "</table>"; } ?> |
|
Search Results -> Below is a screen shot of the response to the sample client above: |
![]() |
|
Using Java: Here is a sample Spectrum Match Java Client : Note: Due to versioning issues, this client seems to have compliance issues. A new version of the WSDL and Client code will be released soon, which will implement the newer standards.
You will need to do the following in order to compile and run this example: |
|
% java -cp .;* org.apache.axis.wsdl.WSDL2Java http://metlin.scripps.edu/soap/metlin-1.1.wsdl % javac -classpath .;* MetlinTest.java % java -cp .;* MetlinTest |