Download Data¶
This document contains documentation for the web services for downloading data from spectr.
Scan Data:¶
For all web services that return scan data, this is the XML format used:
<scan level="2" scanNumber="3305" retentionTime="332.33993" isCentroid="0">
<peaks>
<peak mz="899.999484" intensity="19999338.33" />
<peak mz="903.399883" intensity="88373.31" />
<peak mz="1003.87368" intensity="7733.84" />
<!-- ... peak element for every peak in the scan ... -->
</peaks>
</scan>
Scan attributes¶
level - Scan level (1 for ms1, 2 for ms2 and so on)
scanNumber - Scan number for this scan from the original spectral file
retentionTime - Retention time for this scan (in seconds)
isCentroid - Whether or not this scan is centroided (0 for false, 1 for true)
parentScanNumber - (Only for scan level > 1) Parent scan number
precursorCharge - (Only for scan level > 1) Charge of precursor ion
precursor_M_Over_Z - (Only for scan level > 1) m/z of precursor ion (double)
Peak attributes¶
mz - The m/z of the peak (double)
intensity - The intensity of the peak (float)
APINotFound¶
All responses will contain the <status_scanFileAPIKeyNotFound>YES</status_scanFileAPIKeyNotFound>
sub-element if
the supplied API key was invalid.
Web Services Details:¶
Get Scan Numbers¶
Get all scan numbers present in an uploaded file, by scan level
URI |
/query/getScanNumbers_XML |
Method |
POST |
URL Params (GET) |
None |
POST data |
<get_ScanNumbers_Request scanFileAPIKey="">
<scanLevelsToInclude>
<scanLevelToInclude>n</scanLevelToInclude>
<!-- scanLevelToInclude element for each scan level to include -->
</scanLevelsToInclude>
<scanLevelsToExclude>
<scanLevelToExclude>n</scanLevelToExclude>
<!-- scanLevelToExclude element for each scan level to exclude -->
</scanLevelsToExclude>
</get_ScanNumbers_Request>
|
Post attributes |
|
Post elements |
|
Success Response |
Success (200 OK) |
Error Response |
Bad Request (400), Unauthorized (401) |
Sample Response |
<get_ScanNumbers_Response>
<status_scanFileAPIKeyNotFound>NO</status_scanFileAPIKeyNotFound>
<scanNumbers>
<scanNumber>1</scanNumber>
<scanNumber>2</scanNumber>
<scanNumber>3</scanNumber>
<scanNumber>4</scanNumber>
</scanNumbers>
</get_ScanNumbers_Response>
|
Response Elements |
|
Get Scan Data From File (for specific scan numbers)¶
Get the scan data for a list of scan numbers.
URI |
/query/getScanDataFromScanNumbers_XML |
Method |
POST |
URL Params (GET) |
None |
POST data |
<get_ScanDataFromScanNumbers_Request scanFileAPIKey="">
<scanNumbers>
<scanNumber>1</scanNumber>
<scanNumber>2</scanNumber>
<scanNumber>3</scanNumber>
<scanNumber>4</scanNumber>
</scanNumbers>
</get_ScanDataFromScanNumbers_Request>
|
Post attributes |
|
Post elements |
|
Success Response |
Success (200 OK) |
Error Response |
Bad Request (400), Unauthorized (401) |
Sample Response |
<get_ScanDataFromScanNumbers_Response>
<status_scanFileAPIKeyNotFound>NO</status_scanFileAPIKeyNotFound>
<scans>
<!-- scan list, see top of document for more information -->
</scans>
</uploadScanFile_Submit_Response>
|
Response attributes |
|
Response Elements |
|
Get Scan Data From File¶
Get the scan data for a retention time window, m/z range, and scan level.
URI |
/query/getScansDataFromRetentionTimeRange_XML |
Method |
POST |
URL Params (GET) |
None |
POST data |
<get_ScanNumbersFromRetentionTimeRange_Request
scanFileAPIKey="">
excludeReturnScanPeakData="">
retentionTimeStart="">
retentionTimeEnd="">
mzLowCutoff="">
mzHighCutoff="">
scanLevel ="">
</get_ScanNumbersFromRetentionTimeRange_Request>
|
Post attributes |
|
Success Response |
Success (200 OK) |
Error Response |
Bad Request (400), Unauthorized (401) |
Sample Response |
<get_ScansDataFromRetentionTimeRange_Response>
<status_scanFileAPIKeyNotFound>NO</status_scanFileAPIKeyNotFound>
<scans>
<!-- scan list, see top of document for more information -->
</scans>
</get_ScansDataFromRetentionTimeRange_Response>
|
Response attributes |
|
Response Elements |
|
Get Scan Retention Times¶
Get retention times for one or more scans.
URI |
/query/getScanRetentionTimes_XML |
Method |
POST |
URL Params (GET) |
None |
POST data |
<get_ScanRetentionTimes_Request scanFileAPIKey="">
<scanNumbers>
<scanNumber>1</scanNumber>
<scanNumber>2</scanNumber>
<scanNumber>3</scanNumber>
<scanNumber>4</scanNumber>
</scanNumbers>
<!-- below is only included if scan numbers are not included -->
<scanLevelsToInclude>
<scanLevelToInclude>n</scanLevelToInclude>
<!-- scanLevelToInclude element for each scan level to include -->
</scanLevelsToInclude>
<scanLevelsToExclude>
<scanLevelToExclude>n</scanLevelToExclude>
<!-- scanLevelToExclude element for each scan level to exclude -->
</scanLevelsToExclude>
</get_ScanDataFromScanNumbers_Request>
|
Post attributes |
|
Post elements |
|
Notes |
|
Success Response |
Success (200 OK) |
Error Response |
Bad Request (400), Unauthorized (401) |
Sample Response |
<get_ScanRetentionTimes_Response>
<status_scanFileAPIKeyNotFound>NO</status_scanFileAPIKeyNotFound>
<scanParts>
<scanPart scanNumber="1" level="1" retentionTime="1.3346" />
<scanPart scanNumber="2" level="1" retentionTime="2.3346" />
<scanPart scanNumber="3" level="2" retentionTime="3.8346" />
<!-- repeat for all returned scans -->
</scanParts>
</get_ScanRetentionTimes_Response>
|
Response Elements |
|
scanPart attributes |
|
Get Scan Level Summary Data¶
Get summary statistics for each scan level
URI |
/query/getSummaryDataPerScanLevel_XML |
Method |
POST |
URL Params (GET) |
None |
POST data |
<get_SummaryDataPerScanLevel_Request scanFileAPIKey="" />
|
Post attributes |
|
Success Response |
Success (200 OK) |
Error Response |
Bad Request (400), Unauthorized (401) |
Sample Response |
<get_SummaryDataPerScanLevel_Response>
<status_scanFileAPIKeyNotFound>NO</status_scanFileAPIKeyNotFound>
<scanSummaryPerScanLevelList>
<scanSummaryPerScanLevel scanLevel="1" numberOfScans="37736" totalIonCurrent="28458447387.383" />
<scanSummaryPerScanLevel scanLevel="2" numberOfScans="28473" totalIonCurrent="7643543763.293" />
<!-- repeat for all scan levels -->
</scanSummaryPerScanLevelList>
</get_SummaryDataPerScanLevel_Response>
|
Response Elements |
|
sc. level attributes |
|
Get Binned MS1 Ion Intensity¶
Get binned total ion intensity from MS1 scans. Note, unlike other web services, this one returned GZIP compressed JSON data.
URI |
/query/getScanPeakIntensityBinnedOn_RT_MZ_JSON_GZIPPED |
Method |
POST |
URL Params (GET) |
None |
POST data |
<get_ScanPeakIntensityBinnedOn_RT_MZ_Request scanFileAPIKey="" />
|
Post attributes |
|
Success Response |
Success (200 OK) |
Error Response |
Bad Request (400), Unauthorized (401) |
Sample Response |
{
"jsonContents":"text describing contents herein",
"summaryData": {
"jsonContents":"text describing contents herein",
"binnedSummedIntensityCount":"", // Total number of bins (rt bins * mz bins)
"rtBinSizeInSeconds":"", // size of retention time bins (seconds)
"rtBinMinInSeconds":"", // minimum retetion_time_bin_start in this file
"rtBinMaxInSeconds":"", // maximum retetion_time_bin_start in this file
"rtMaxPossibleValueInSeconds":"", // rtBinMaxInSeconds + rtBinSizeInSeconds. (max rt included)
"mzBinSizeInMZ":"", // size of m/z bins
"mzBinMinInMZ":"", // minimum m/z_bin_start in this file
"mzBinMaxInMZ":"", // maximum m/z_bin_start in this file
"mzMaxPossibleValueInMZ":"", // mzBinMaxInMZ + mzBinSizeInMZ (max m/z included)
"intensityBinnedMin":"", // Minimum intensity of all bins
"intensityBinnedMax":"", // Maximum intensity of all bins
},
"ms1_IntensitiesBinnedSummedMap":
{
1 /* retention time bin start */ : {
400 /* m/z bin start */ : 393833.393 /* total ion current in this bin */
401 /* m/z bin start */ : 2732.383 /* total ion current in this bin */
402 /* m/z bin start */ : 3939.22 /* total ion current in this bin */
403 /* m/z bin start */ : 373633.33 /* total ion current in this bin */
// entry for all m/z bins ...
},
2 /* retention time bin start */ : {
400 /* m/z bin start */ : 29383.38 /* total ion current in this bin */
401 /* m/z bin start */ : 69283.343 /* total ion current in this bin */
402 /* m/z bin start */ : 11323.232 /* total ion current in this bin */
403 /* m/z bin start */ : 103.332 /* total ion current in this bin */
// entry for all m/z bins ...
},
// repeating entries for all retention time bins
}
}
|