Expression Tests¶
This page outlines the success and failure criteria for all tests of Expression resources.
Expression API Tests¶
Expression API tests assert the correct configuration of expression-related API routes. In order for a test case to succeed, the following conditions must be met when evaluating the response:
For all cases,
Content-Typechecking is enforced. The response MUST have aContent-Typeheader ofapplication/vnd.ga4gh.rnaget.v1.0.0+jsonORapplication/jsonFor all cases,
Status Codechecking is enforced. The response MUST have the expected status codeFor all cases, schema checking is enforced. The json object in the response body MUST conform to a pre-defined schema of required fields and data types, which is specific to each API route
Expression API Test Cases¶
Get Supported Expression Formats¶
Route:
/expressions/formatsDescription: Requests the available expression data file formats on the server. Expects an array of strings to be returned in the response body.
Rationale: Asserts that
/expressions/formatsreturns an array of strings, indicating which expression file formats the server supportsRequest:
GET /expressions/formats
Accept: application/vnd.ga4gh.rnaget.v1.0.0+json, application/json
Successful Response:
HTTP/1.1 200 OK
Content-Type: application/vnd.ga4gh.rnaget.v1.0.0+json
[
"loom",
"tsv"
]
Success Criteria:
Status Code == 200AND response body is an array of strings in json formatFailure Criteria:
Status Code != 200OR response body is NOT an array of strings in json format
Expression Filters¶
Route:
/expressions/filtersDescription: Requests the filters that can be used to narrow search results for a list of
ExpressionsRationale: Asserts that the endpoint returns an array of
filterobjectsRequest:
GET /expressions/filters
Accept: application/vnd.ga4gh.rnaget.v1.0.0+json, application/json
Successful Response:
HTTP/1.1 200 OK
Content-Type: application/vnd.ga4gh.rnaget.v1.0.0+json
[
{
"fieldType": "string",
"values": [
"1.0"
],
"filter": "version",
"description": "version to search for"
},
{
"fieldType": "string",
"filter": "studyID",
"description": "parent studyID"
}
]
Success Criteria:
Status Code == 200AND response body is array offiltersFailure Criteria:
Status Code != 200OR response body is NOT array offilters
Get Test Expression Ticket¶
Route:
/expressions/<id>/ticketDescription: Requests test expression
ticketby itsid. Expects the returned expression to match theticketjson schema.Rationale: Asserts that the
/expressions/<id>/ticketendpoint returns a validticket.Request:
GET /expressions/ac3e9279efd02f1c98de4ed3d335b98e/ticket
Accept: application/vnd.ga4gh.rnaget.v1.0.0+json, application/json
Successful Response:
HTTP/1.1 200 OK
Content-Type: application/vnd.ga4gh.rnaget.v1.0.0+json
{
"id": "ac3e9279efd02f1c98de4ed3d335b98e",
"version": "1.0",
"studyID": "f3ba0b59bed0fa2f1030e7cb508324d1",
"url": "https://url/to/expression/file",
"units": "TPM",
"fileType": "loom/tsv"
}
Success Criteria:
Status Code == 200AND response body is validticketFailure Criteria:
Status Code != 200OR response body is NOT validticket
Single Expression Ticket - Not Found¶
Route:
/expressions/<id>/ticketDescription: Requests an expression ticket with an invalid
id, that is, anidthat does not correspond to anyExpressionon the server. Expects a404 Not Foundstatus code in the response, and a response body with an error message.Rationale: Asserts that the
/expressions/<id>/ticketendpoint does not return arbitraryticket.Request:
GET /expressions/nonexistentid9999999999999999999/ticket
Accept: application/vnd.ga4gh.rnaget.v1.0.0+json, application/json
Successful Response:
HTTP/1.1 404 Not Found
Content-Type: application/vnd.ga4gh.rnaget.v1.0.0+json
{
"message": "Entry not found in database."
}
Success Criteria:
Status Code == 404AND response body is validErrorjsonFailure Criteria:
Status Code != 404OR response body is NOT validErrorjson
Get Test Expression Bytes¶
Route:
/expressions/<id>/bytesDescription: Requests test expression matrix as
bytesby itsid.Rationale: Asserts that the
/expressions/<id>/bytesendpoint returns matrix bytes.Request:
GET /expressions/ac3e9279efd02f1c98de4ed3d335b98e/bytes
Accept: application/octet-stream, application/vnd.loom, text/tab-separated-values
Successful Response:
HTTP/1.1 200 OK
Content-Type: application/octet-stream
Success Criteria:
Status Code == 200Failure Criteria:
Status Code != 200
Single Expression Bytes - Not Found¶
Route:
/expressions/<id>/bytesDescription: Requests expression matrix
byteswith an invalididthat doesn’t correspond to anyExpressionon the server. Expects a404 Not Foundstatus code and an error message in response body.Rationale: Asserts that the
/expressions/<id>/bytesendpoint does not return arbitrary matrix.Request:
GET /expressions/nonexistentid9999999999999999999/bytes
Accept: application/octet-stream, application/vnd.loom, text/tab-separated-values
Successful Response:
HTTP/1.1 404 Not Found
Content-Type: application/vnd.ga4gh.rnaget.v1.0.0+json
{
"message": "Entry not found in database."
}
Success Criteria:
Status Code == 404AND response body is validErrorjsonFailure Criteria:
Status Code != 404OR response body is NOT validErrorjson
Expression Ticket by Format¶
Route:
/expressions/ticketDescription: Requests joined matrix, specifying only the required ‘format’ parameter. Expects
ticketresponse.Rationale: Asserts that the
/expressions/ticketreturns a validticket.Request:
GET /expressions/ticket?format=loom
Accept: application/vnd.ga4gh.rnaget.v1.0.0+json, application/json
Successful Response:
HTTP/1.1 200 OK
Content-Type: application/vnd.ga4gh.rnaget.v1.0.0+json
{
"studyID": "6cccbbd76b9c4837bd7342dd616d0fec",
"url": "/path/to/E-MTAB-5423-query-results.tpms.loom",
"units": "TPM",
"version": "1.0",
"fileType": "loom"
}
Success Criteria:
Status Code == 200AND response body isticketFailure Criteria:
Status Code != 200OR response body is NOTticket
Expression Ticket - All Filters¶
Route:
/expressions/ticketDescription: Requests joined matrix, using all filtering parameters associated with test expression. Expects
ticket.Rationale: Asserts that
/expressions/ticketreturnsticketwhen specifying filters.Request:
GET /expressions/ticket?format=loom&version=1.0&studyID=f3ba0b59bed0fa2f1030e7cb508324d1
Accept: application/vnd.ga4gh.rnaget.v1.0.0+json, application/json
Successful Response:
HTTP/1.1 200 OK
Content-Type: application/vnd.ga4gh.rnaget.v1.0.0+json
{
"url": "https://path/to/expression.loom",
"units": "TPM",
"fileType": "loom"
}
Success Criteria:
Status Code == 200AND response body isticketFailure Criteria:
Status Code != 200OR response body is NOTticket
Expression Ticket - Single Filter, 1¶
Route:
/expressions/ticketDescription: Requests joined matrix using only 1 filtering parameter associated with test expression (in addition to format). Expects
ticket.Rationale: Asserts filtering parameters can be used independently of one another, and that each filter yields a valid
ticket.Requests:
GET /expressions/ticket?format=loom&version=1.0
Accept: application/vnd.ga4gh.rnaget.v1.0.0+json, application/json
Successful Response:
HTTP/1.1 200 OK
Content-Type: application/vnd.ga4gh.rnaget.v1.0.0+json
{
"url": "https://path/to/expression.loom",
"units": "TPM",
"version": "1.0",
"fileType": "loom"
}
Success Criteria:
Status Code == 200AND response body isticketFailure Criteria:
Status Code != 200OR response body is NOTticket
Expression Ticket - Single Filter, 2¶
Route:
/expressions/ticketDescription: Requests joined matrix using only 1 filtering parameter (a different filter than above) associated with test expression (in addition to format). Expects
ticket.Rationale: Asserts filtering parameters can be used independently of one another, and that each filter yields a valid
ticket.Requests:
GET /expressions/ticket?format=loom&studyID=f3ba0b59bed0fa2f1030e7cb508324d1
Accept: application/vnd.ga4gh.rnaget.v1.0.0+json, application/json
Successful Response:
HTTP/1.1 200 OK
Content-Type: application/vnd.ga4gh.rnaget.v1.0.0+json
{
"studyID": "f3ba0b59bed0fa2f1030e7cb508324d1",
"url": "/path/to/expression.loom",
"units": "TPM",
"fileType": "loom"
}
Success Criteria:
Status Code == 200AND response body isticket.Failure Criteria:
Status Code != 200OR response body is NOTticket.
Expression Ticket - Format Not Specified¶
Route:
/expressions/ticketDescription: Requests joined matrix WITHOUT specifying the required
formatparameter. Expects a4xxresponse with error message.Rationale: As the
formatparameter is required to specify file format for the/expressions/ticketendpoint, this test asserts malformed requests raise an error.Request:
GET /expressions/ticket
Accept: application/vnd.ga4gh.rnaget.v1.0.0+json, application/json
Successful Response:
HTTP/1.1 400 Bad Request
Content-Type: application/vnd.ga4gh.rnaget.v1.0.0+json
{
"message": "Input payload validation failed"
}
Success Criteria:
Status Code == 4xxAND response body is validErrorjsonFailure Criteria:
Status Code != 4xxAND response body is NOT validErrorjson
Expression Ticket - Filetype Matches¶
Route:
/expressions/ticketDescription: Requests joined matrix, only specifying the required
formatparameter. Checks thattickethas afileTypematching requestedformat.Rationale: Asserts that the
/expressions/ticketendpoint returnsticketwith fileType matching the request.Request:
GET /expressions/ticket?format=loom
Accept: application/vnd.ga4gh.rnaget.v1.0.0+json, application/json
Successful Response:
HTTP/1.1 200 OK
Content-Type: application/vnd.ga4gh.rnaget.v1.0.0+json
{
"url": "/path/to/E-MTAB-5423-query-results.tpms.loom",
"units": "TPM",
"fileType": "loom"
}
Success Criteria:
Status Code == 200AND response body isticketANDfileTypematches requestedformatFailure Criteria:
Status Code != 200OR response body is NOTticketORfileTypeDOES NOT match requestedformat
Expression Bytes by Format¶
Route:
/expressions/bytesDescription: Requests joined matrix bytes, only specifying the required
formatparameter.Rationale: Asserts that the
/expressions/bytesendpoint returns matrix bytes.Request:
GET /expressions/bytes?format=loom
Accept: application/octet-stream, application/vnd.loom, text/tab-separated-values
Successful Response:
HTTP/1.1 200 OK
Content-Type: application/octet-stream
Success Criteria:
Status Code == 200Failure Criteria:
Status Code != 200
Expression Bytes - All Filters¶
Route:
/expressions/bytesDescription: Requests joined matrix bytes using all expression filters.
Rationale: Asserts that the
/expressions/bytesendpoint returns matrix bytes when all filters are provided.Request:
GET /expressions/bytes?format=loom&version=1.0&studyID=f3ba0b59bed0fa2f1030e7cb508324d1
Accept: application/octet-stream, application/vnd.loom, text/tab-separated-values
Successful Response:
HTTP/1.1 200 OK
Content-Type: application/octet-stream
Success Criteria:
Status Code == 200Failure Criteria:
Status Code != 200
Expression Bytes - Single Filter, 1¶
Route:
/expressions/bytesDescription: Requests joined matrix bytes using one expression filter (in addition to format).
Rationale: Asserts filter parameters can be used independently of one another.
Request:
GET /expressions/bytes?format=loom&version=1.0
Accept: application/octet-stream, application/vnd.loom, text/tab-separated-values
Successful Response:
HTTP/1.1 200 OK
Content-Type: application/octet-stream
Success Criteria:
Status Code == 200Failure Criteria:
Status Code != 200
Expression Bytes - Single Filter, 2¶
Route:
/expressions/bytesDescription: Requests joined matrix bytes using one expression filter (different than above), in addition to format.
Rationale: Asserts filter parameters can be used independently of one another.
Request:
GET /expressions/bytes?format=loom&studyID=f3ba0b59bed0fa2f1030e7cb508324d1
Accept: application/octet-stream, application/vnd.loom, text/tab-separated-values
Successful Response:
HTTP/1.1 200 OK
Content-Type: application/octet-stream
Success Criteria:
Status Code == 200Failure Criteria:
Status Code != 200
Expression Bytes - Format Not Specified¶
Route:
/expressions/bytesDescription: Requests joined matrix bytes WITHOUT specifying required
formatparameter. Expects a4xxresponse with error message.Rationale: As the
formatparameter is required to specify file format for the/expressions/bytesendpoint, this test asserts malformed requests raise an error.Request:
GET /expressions/bytes
Accept: application/octet-stream, application/vnd.loom, text/tab-separated-values
Successful Response:
HTTP/1.1 400 Bad Request
Content-Type: application/vnd.ga4gh.rnaget.v1.0.0+json
{
"message": "Input payload validation failed"
}
Success Criteria:
Status Code == 4xxAND response body is validErrorjsonFailure Criteria:
Status Code != 4xxAND response body is NOT validErrorjson
Expression API Non-Implemented Test Cases¶
Expression Formats Not Implemented¶
Route:
/expressions/formatsDescription: If the
Expressionsendpoint is specified asNot Implementedin the config file, then this test will be run. Requests the/expressions/formatsendpoint, expecting a501 Not Implementedstatus code responseRationale: Asserts that
Expressionrelated endpoints are correctly non-implemented according to the specRequest:
GET /expressions/formats
Accept: application/vnd.ga4gh.rnaget.v1.0.0+json, application/json
Successful Response:
HTTP/1.1 501 Not Implemented
Content-Type: application/vnd.ga4gh.rnaget.v1.0.0+json
Success Criteria:
Status Code == 501Failure Criteria:
Status Code != 501
Expression Ticket by Id Not Implemented¶
Route:
/expressions/<id>/ticketDescription: If expressions endpoints are
Not Implemented, this test will request/expressions/<id>/ticket, expecting a501 Not Implementedstatus code responseRationale: Asserts
Expressionrelated endpoints are correctly non-implementedRequest:
GET /expressions/nonexistentid9999999999999999999/ticket
Accept: application/vnd.ga4gh.rnaget.v1.0.0+json, application/json
Successful Response:
HTTP/1.1 501 Not Implemented
Content-Type: application/vnd.ga4gh.rnaget.v1.0.0+json
Success Criteria:
Status Code == 501Failure Criteria:
Status Code != 501
Expression Bytes by Id Not Implemented¶
Route:
/expressions/<id>/bytesDescription: If expressions endpoints are
Not Implemented, this test will request/expressions/<id>/bytes, expecting a501 Not Implementedstatus code responseRationale: Asserts
Expressionrelated endpoints are correctly non-implementedRequest:
GET /expressions/nonexistentid9999999999999999999/bytes
Accept: application/octet-stream, application/vnd.loom, text/tab-separated-values
Successful Response:
HTTP/1.1 501 Not Implemented
Content-Type: application/vnd.ga4gh.rnaget.v1.0.0+json
Success Criteria:
Status Code == 501Failure Criteria:
Status Code != 501
Expression Filters Not Implemented¶
Route:
/expressions/filtersDescription: If expressions endpoints are
Not Implemented, this test will request/expressions/filters, expecting a501 Not Implementedstatus code responseRationale: Asserts that
Expressionrelated endpoints are correctly non-implementedRequest:
GET /expressions/filters
Accept: application/vnd.ga4gh.rnaget.v1.0.0+json, application/json
Successful Response:
HTTP/1.1 501 Not Implemented
Content-Type: application/vnd.ga4gh.rnaget.v1.0.0+json
Success Criteria:
Status Code == 501Failure Criteria:
Status Code != 501
Expression Ticket Not Implemented¶
Route:
/expressions/ticketDescription: If expressions endpoints are
Not Implemented, this test will request/expressions/ticket, expecting a501 Not Implementedstatus code responseRationale: Asserts that
Expressionrelated endpoints are correctly non-implementedRequest:
GET /expressions/ticket
Accept: application/vnd.ga4gh.rnaget.v1.0.0+json, application/json
Successful Response:
HTTP/1.1 501 Not Implemented
Content-Type: application/vnd.ga4gh.rnaget.v1.0.0+json
Success Criteria:
Status Code == 501Failure Criteria:
Status Code != 501
Expression Bytes Not Implemented¶
Route:
/expressions/bytesDescription: If expressions endpoints are
Not Implemented, this test will request/expressions/bytes, expecting a501 Not Implementedstatus code responseRationale: Asserts that
Expressionrelated endpoints are correctly non-implementedRequest:
GET /expressions/bytes
Accept: application/octet-stream, application/vnd.loom, text/tab-separated-values
Successful Response:
HTTP/1.1 501 Not Implemented
Content-Type: application/vnd.ga4gh.rnaget.v1.0.0+json
Success Criteria:
Status Code == 501Failure Criteria:
Status Code != 501
Expression Content Tests¶
Expression content tests assert that expression matrices downloaded from the RNAget server contain the expected content/results based on the request. Matrix rows, columns, and values are cross-referenced against the request to ensure the correct data has been returned.
Expression Content Test Cases¶
Expression Ticket by Id Content Test Cases¶
Route:
/expressions/<id>/ticketDescription: Download test expression by ticket multiple times (sometimes slicing by featureIDList, featureNameList, sampleIDList).
Rationale: Asserts correct matrix file is associated with the test expression
id. Validates expression values match expected. Validates returned columns/rows match expected based on slice parameters.Request:
GET /expressions/ac3e9279efd02f1c98de4ed3d335b98e/ticket
Accept: application/vnd.ga4gh.rnaget.v1.0.0+json, application/json
Success Criteria: Test expression matrix columns, rows, values match expected
Failure Criteria: Test expression matrix columns, rows, values DO NOT match expected
Expression Bytes by Id Content Test Cases¶
Route:
/expressions/<id>/bytesDescription: Download test expression by bytes multiple times (sometimes slicing by featureIDList, featureNameList, sampleIDList).
Rationale: Asserts correct matrix file is associated with the test expression
id. Validates expression values match expected. Validates returned columns/rows match expected based on slice parameters.Request:
GET /expressions/ac3e9279efd02f1c98de4ed3d335b98e/bytes
Accept: application/vnd.ga4gh.rnaget.v1.0.0+json, application/json
Success Criteria: Test expression matrix columns, rows, values match expected
Failure Criteria: Test expression matrix columns, rows, values DO NOT match expected
Expression Ticket Content Test Cases¶
Route:
/expressions/ticketDescription: Download joined expression matrix by ticket multiple times (sometimes slicing by featureIDList, featureNameList, sampleIDList).
Rationale: Asserts joined matrix. Validates expression values match expected. Validates returned columns/rows match expected based on slice parameters.
Request:
GET /expressions/ticket?format=loom
Accept: application/vnd.ga4gh.rnaget.v1.0.0+json, application/json
Success Criteria: Joined expression matrix columns, rows, values match expected
Failure Criteria: Joined expression matrix columns, rows, values DO NOT match expected
Expression Bytes Content Test Cases¶
Route:
/expressions/bytesDescription: Download joined expression matrix by bytes multiple times (sometimes slicing by featureIDList, featureNameList, sampleIDList).
Rationale: Asserts joined matrix. Validates expression values match expected. Validates returned columns/rows match expected based on slice parameters.
Request:
GET /expressions/bytes?format=loom
Accept: application/vnd.ga4gh.rnaget.v1.0.0+json, application/json
Success Criteria: Joined expression matrix columns, rows, values match expected
Failure Criteria: Joined expression matrix columns, rows, values DO NOT match expected