Namespace LABKEY.Assay
Assay static class to retrieve read-only assay definitions.
Additional Documentation:
Defined in: Assay.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Method Attributes | Method Name and Description |
---|---|
<static> |
LABKEY.Assay.getAll(config)
Gets all assays.
|
<static> |
LABKEY.Assay.getById(config)
Gets an assay by its ID.
|
<static> |
LABKEY.Assay.getByName(config)
Gets an assay by name.
|
<static> |
LABKEY.Assay.getByType(config)
Gets an assay by type.
|
<static> |
LABKEY.Assay.getNAbRuns(config)
Select NAb assay data from an assay folder.
|
<static> |
LABKEY.Assay.getStudyNabGraphURL(config)
Retrieve the URL of an image that contains a graph of dilution curves for NAb results that have been copied to a study.
|
<static> |
LABKEY.Assay.getStudyNabRuns(config)
Select detailed NAb information for runs with summary data that has been copied to a study folder.
|
<static> |
LABKEY.Assay.importRun()
Create an assay run and import results.
|
Method Detail
<static>
LABKEY.Assay.getAll(config)
Gets all assays.
Example:<script type="text/javascript"> function successHandler(assayArray) { var html = ''; for (var defIndex = 0; defIndex < assayArray.length; defIndex ++) { var definition = assayArray[defIndex ]; html += '<b>' + definition.type + '</b>: ' + definition.name + '<br>'; for (var domain in definition.domains) { html += ' ' + domain + '<br>'; var properties = definition.domains[domain]; for (var propertyIndex = 0; propertyIndex < properties.length; propertyIndex++) { var property = properties[propertyIndex]; html += ' ' + property.name + ' - ' + property.typeName + '<br>'; } } } document.getElementById('testDiv').innerHTML = html; } function errorHandler(error) { alert('An error occurred retrieving data.'); } LABKEY.Assay.getAll({success: successHandler, failure: errorHandler}); </script> <div id='testDiv'>Loading...</div>
- Parameters:
- {Function} config.success
- Required. Function called when the "getAll" function executes successfully. Will be called with the argument: LABKEY.Assay.AssayDesign[].
- {Object} config
- An object which contains the following configuration properties.
- {Object} config.scope Optional
- The scope to be used for the success and failure callbacks
- {Function} config.failure Optional
- Function called when execution of the "getAll" function fails.
- {String} config.containerPath Optional
- The container path in which the requested Assays are defined. If not supplied, the current container path will be used.
<static>
LABKEY.Assay.getById(config)
Gets an assay by its ID.
- Parameters:
- {Function(LABKEY.Assay.AssayDesign[])} config.success
- Function called when the "getById" function executes successfully.
- {Object} config
- An object which contains the following configuration properties.
- {Function} config.failure Optional
- Function called when execution of the "getById" function fails.
- {Object} config.scope Optional
- The scope to be used for the success and failure callbacks
- {Integer} config.id
- Unique integer ID for the assay.
- {String} config.containerPath Optional
- The container path in which the requested Assay is defined. If not supplied, the current container path will be used.
<static>
LABKEY.Assay.getByName(config)
Gets an assay by name.
- Parameters:
- {Function(LABKEY.Assay.AssayDesign[])} config.success
- Function called when the "getByName" function executes successfully.
- {Object} config
- An object which contains the following configuration properties.
- {Function} config.failure Optional
- Function called when execution of the "getByName" function fails.
- {Object} config.scope Optional
- The scope to be used for the success and failure callbacks
- {String} config.name Optional
- String name of the assay.
- {String} config.containerPath Optional
- The container path in which the requested Assay is defined. If not supplied, the current container path will be used.
<static>
LABKEY.Assay.getByType(config)
Gets an assay by type.
- Parameters:
- {Function(LABKEY.Assay.AssayDesign[])} config.success
- Function called when the "getByType" function executes successfully.
- {Object} config
- An object which contains the following configuration properties.
- {Function} config.failure Optional
- Function called when execution of the "getByType" function fails.
- {Object} config.scope Optional
- The scope to be used for the success and failure callbacks
- {String} config.type
- String name of the assay type. "ELISpot", for example.
- {String} config.containerPath Optional
- The container path in which the requested Assays are defined. If not supplied, the current container path will be used.
<static>
LABKEY.Assay.getNAbRuns(config)
Select NAb assay data from an assay folder.
- Parameters:
- {Object} config
- An object which contains the following configuration properties.
- {String} config.assayName
- The name of the NAb assay design for which runs are to be retrieved.
- {Boolean} config.includeStats Optional
- Whether or not statistics (standard deviation, max, min, etc.) should be returned with calculations and well data.
- {Boolean} config.includeWells Optional
- Whether well-level data should be included in the response.
- {Boolean} config.calculateNeut Optional
- Whether neutralization should be calculated on the server.
- {Boolean} config.includeFitParameters Optional
- Whether the parameters used in the neutralization curve fitting calculation should be included in the response.
- {Function} config.success
- Function called when the "getNAbRuns" function executes successfully.
This function will be called with the following arguments:
- runs: an array of NAb run objects
- options: the options used for the AJAX request
- responseObj: the XMLHttpResponseObject instance used to make the AJAX request
- {Function} config.failure Optional
- Function called when execution of the "getNAbRuns" function fails.
This function will be called with the following arguments:
- errorInfo: an object describing the error with the following fields:
- exception: the exception message
- exceptionClass: the Java class of the exception thrown on the server
- stackTrace: the Java stack trace at the point when the exception occurred
- responseObj: the XMLHttpResponseObject instance used to make the AJAX request
- options: the options used for the AJAX request
- errorInfo: an object describing the error with the following fields:
- {Array} config.filterArray Optional
- Array of objects created by LABKEY.Filter.create.
- {String} config.sort Optional
- String description of the sort. It includes the column names listed in the URL of a sorted data region (with an optional minus prefix to indicate descending order). In the case of a multi-column sort, up to three column names can be included, separated by commas.
- {String} config.containerPath Optional
- The path to the container in which the schema and query are defined, if different than the current container. If not supplied, the current container's path will be used.
- {Integer} config.maxRows Optional
- The maximum number of runs to return from the server (defaults to 100). If you want to return all possible rows, set this config property to -1.
- {Integer} config.offset Optional
- The index of the first row to return from the server (defaults to 0). Use this along with the maxRows config property to request pages of data.
- {Integer} config.timeout Optional
- The maximum number of milliseconds to allow for this operation before generating a timeout error (defaults to 30000).
<static>
LABKEY.Assay.getStudyNabGraphURL(config)
Retrieve the URL of an image that contains a graph of dilution curves for NAb results that have been copied to a study.
Note that this method must be executed against the study folder containing the copied NAb summary data.
Example:<script type="text/javascript"> function showGraph(data) { var el = document.getElementById("graphDiv"); if (data.objectIds && data.objectIds.length > 0) el.innerHTML = '<img src=\"' + data.url + '\">'; else el.innerHTML = 'No graph available. Insufficient permissions, ' + 'or no matching results were found.'; } function initiateGraph(ids) { LABKEY.Assay.getStudyNabGraphURL({ objectIds: ids, success: showGraph, captionColumn: 'VirusName', chartTitle: 'My NAb Chart', height: 500, width: 700, fitType: 'FOUR_PARAMETER' }); } Ext.onReady(initiateGraph([185, 165])); </script> <div id="graphDiv">
- Parameters:
- {Object} config
- An object which contains the following configuration properties.
- {Array} config.objectIds
- The object Ids for the NAb data rows that have been copied to the study. This method will ignore requests to graph any object IDs that the current user does not have permission to view.
- {String} config.captionColumn
- The data column that should be used for per-specimen captions. If the column doesn't exist, or if it has a null value, a sensible default will be chosen, generally specimen ID or participant/visit.
- {String} config.chartTitle Optional
- The desired title for the chart. Defaults to no title.
- {String} config.fitType Optional
- Allowable values are FIVE_PARAMETER, FOUR_PARAMETER, and POLYNOMIAL. Defaults to FIVE_PARAMETER.
- {String} config.height Optional
- Desired height of the graph image in pixels. Defaults to 300.
- {String} config.width Optional
- Desired width of the graph image in pixels. Defaults to 425.
- {String} config.containerPath Optional
- The path to the study container containing the NAb summary data, if different than the current container. If not supplied, the current container's path will be used.
- {Function} config.success
- Function called when the "getStudyNabGraphURL" function executes successfully.
This function will be called with the following arguments:
- result: an object with the following properties:
- url: a string URL of the dilution curve graph.
- objectIds: an array containing the IDs of the samples that were successfully graphed.
- responseObj: the XMLHttpResponseObject instance used to make the AJAX request
- options: the options used for the AJAX request
- result: an object with the following properties:
- {Function} config.failure Optional
- Function called when execution of the "getStudyNabGraphURL" function fails.
This function will be called with the following arguments:
- errorInfo: an object describing the error with the following fields:
- exception: the exception message
- exceptionClass: the Java class of the exception thrown on the server
- stackTrace: the Java stack trace at the point when the exception occurred
- responseObj: the XMLHttpResponseObject instance used to make the AJAX request
- options: the options used for the AJAX request
- errorInfo: an object describing the error with the following fields:
- {Integer} config.timeout Optional
- The maximum number of milliseconds to allow for this operation before generating a timeout error (defaults to 30000).
<static>
LABKEY.Assay.getStudyNabRuns(config)
Select detailed NAb information for runs with summary data that has been copied to a study folder. Note that this
method must be executed against the study folder containing the copied NAb summary data.
- Parameters:
- {Object} config
- An object which contains the following configuration properties.
- {Array} config.objectIds
- The object Ids for the NAb data rows that have been copied to the study.
- {Boolean} config.includeStats Optional
- Whether or not statistics (standard deviation, max, min, etc.) should be returned with calculations and well data.
- {Boolean} config.includeWells Optional
- Whether well-level data should be included in the response.
- {Boolean} config.calculateNeut Optional
- Whether neutralization should be calculated on the server.
- {Boolean} config.includeFitParameters Optional
- Whether the parameters used in the neutralization curve fitting calculation should be included in the response.
- {String} config.containerPath Optional
- The path to the study container containing the NAb summary, if different than the current container. If not supplied, the current container's path will be used.
- {Function} config.success
- Function called when the "getStudyNabRuns" function executes successfully.
This function will be called with the following arguments:
- runs: an array of NAb run objects
- {Function} config.failure Optional
- Function called when execution of the "getStudyNabRuns" function fails.
This function will be called with the following arguments:
- errorInfo: an object describing the error with the following fields:
- exception: the exception message
- exceptionClass: the Java class of the exception thrown on the server
- stackTrace: the Java stack trace at the point when the exception occurred
- responseObj: the XMLHttpResponseObject instance used to make the AJAX request
- options: the options used for the AJAX request
- errorInfo: an object describing the error with the following fields:
- {Integer} config.timeout Optional
- The maximum number of milliseconds to allow for this operation before generating a timeout error (defaults to 30000).
<static>
LABKEY.Assay.importRun()
Create an assay run and import results.
Here is an example of retrieving one or more File objects from a form <input>
element and submitting them together to create a new run.
<input id='myfiles' type='file' multiple>
<a href='#' onclick='doSubmit()'>Submit</a>
<script>
function doSubmit() {
LABKEY.Assay.importRun({
assayId: 3,
name: "new run",
properties: {
"Run Field": "value"
},
batchProperties: {
"Batch Field": "value"
},
files: [ document.getElementById('myfiles') ],
success: function (json, response) {
window.location = json.successurl;
},
failure: error (json, response) {
}
});
}
</script>
Alternatively, you may use an HTML form to submit the multipart/form-data without using the JavaScript API. <form action='./assay.importRun.api' method='POST' enctype='multipart/form-data'> <input name='assayId' type='text' /> <input name='name' type='text' /> <input name='file' type='file' /> <input name='submit' type='submit' /> </form>
- Parameters:
- {Number} config.assayId
- The assay protocol id.
- {String} config.containerPath Optional
- The path to the container in which the assay run will be imported, if different than the current container. If not supplied, the current container's path will be used.
- {String} config.name Optional
- The name of a run to create. If not provided, the run will be given the same name as the uploaded file or "[Untitled]".
- {String} config.comments Optional
- Run comments.
- {Object} config.properties Optional
- JSON formatted run properties.
- {Number} config.batchId Optional
- The id of an existing {LABKEY.Exp.RunGroup} to add this run into.
- {Object} config.batchProperties Optional
- JSON formatted batch properties. Only used if batchId is not provided when creating a new batch.
- {Array} config.files
- Array of
File
objects or form file input elements to import. - {Function} config.success
- The success callback function will be called with the following arguments:
- json: The success response object contains two properties:
- success: true
- successurl: The url to browse the newly imported assay run.
- assayId: The assay id.
- batchId: The previously existing or newly created batch id.
- runId: The newly created run id.
- response: The XMLHttpResponseObject used to submit the request.
- json: The success response object contains two properties:
- {Function} config.failure
- The error callback function will be called with the following arguments:
- errorInfo: an object describing the error with the following fields:
- exception: the exception message
- exceptionClass: the Java class of the exception thrown on the server
- stackTrace: the Java stack trace at the point when the exception occurred
- response: the XMLHttpResponseObject used to submit the request.
- errorInfo: an object describing the error with the following fields: