Skip to content

odm_api.StudyIntegrationAsCuratorApi

All URIs are relative to http://localhost

Method HTTP request Description
get_studies_by_files_as_curator GET /api/v1/as-curator/integration/link/studies/by/files Retrieve study metadata objects by querying related attachment files
get_studies_by_libraries_as_curator GET /api/v1/as-curator/integration/link/studies/by/libraries Retrieve study metadata objects by querying related libraries
get_studies_by_preparations_as_curator GET /api/v1/as-curator/integration/link/studies/by/preparations Retrieve study metadata objects by querying related preparations
get_studies_by_samples_as_curator GET /api/v1/as-curator/integration/link/studies/by/samples Retrieve study metadata objects by querying related samples
get_study_by_file_as_curator GET /api/v1/as-curator/integration/link/study/by/file/{id} Retrieve study metadata by querying attachment file ID (accession)
get_study_by_sample_as_curator GET /api/v1/as-curator/integration/link/study/by/sample/{id} Retrieve study metadata by querying sample ID (accession)
search_studies_by_filter_as_curator POST /api/v1/as-curator/integration/fulltext/search/studies Find and retrieve studies by full-text or facet query

get_studies_by_files_as_curator

ListResponse get_studies_by_files_as_curator(response_format=response_format, filter=filter, query=query, page_limit=page_limit, page_offset=page_offset, returned_metadata_fields=returned_metadata_fields)

Retrieve study metadata objects by querying related attachment files

Retrieve study metadata objects whose linked attached files metadata matches all supplied conditions.

Conditions

It is possible to supply conditions for:

  1. Attachment files (full-text or metadata key-value pair)
  2. Parent studies (full-text or metadata key-value pair)

Metadata full-text queries

Single words can be supplied as is; otherwise, use speech marks (") to quote queries that include whitespace. Speech marks and backslash characters in the query need to be escaped with a backslash (\).

Metadata filters

Metadata filters are key-value pairs joined by an operator. The = operator matches literal values/string. The != operator matches anything except the literal value/string. The < or > operators match numerical results that are less or greater than the supplied value. Strings containing whitespace need to be quoted with (").

Combinations

Metadata queries/filters for the same parameter can be combined with &&, AND, || and OR operators, using white-space to separate out the terms and operators. Parentheses ( ) can be used for complex expressions.

Paging

For performance reasons this endpoint returns results in "pages" of limited size. In order to retrieve all matching results the client needs to request multiple pages starting from an offset to the first result. You can do this using the pageOffset query parameter. A value of 0 (the default) instructs the server to return the first page of results, 100 would return a page of results starting from the 101st result and so on. To retrieve all results, iterate through pages using pageOffset values of n * pageLimit until a page returns fewer results than the page limit, which indicates there are no more results.

Example

  • Api Key Authentication (Access-token):
  • Api Key Authentication (Genestack-API-Token):
import odm_api
from odm_api.models.list_response import ListResponse
from odm_api.models.response_format import ResponseFormat
from odm_api.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = odm_api.Configuration(
    host = "http://localhost"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: Access-token
configuration.api_key['Access-token'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Access-token'] = 'Bearer'

# Configure API key authorization: Genestack-API-Token
configuration.api_key['Genestack-API-Token'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Genestack-API-Token'] = 'Bearer'

# Enter a context with an instance of the API client
with odm_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = odm_api.StudyIntegrationAsCuratorApi(api_client)
    response_format = odm_api.ResponseFormat() # ResponseFormat | Supply this parameter with the value `term_id` as part of the query to return extended information including IDs for values and dictionaries. (optional)
    filter = 'filter_example' # str | Filter by attachment file metadata (key-value metadata pair(s)). E.g. \"Species or strain\"=\"Homo sapiens\" (optional)
    query = 'query_example' # str | Search for study metadata objects via a full-text query over all attached files metadata fields. E.g. \"RNA-Seq of human dendritic cells\". Queries matching dictionary terms are automatically expanded to include synonyms. (optional)
    page_limit = 56 # int | Maximum number of results to return. This value must be between 0 and 2000 (inclusive). (optional)
    page_offset = 56 # int | Show the page {pageOffset+1} results from the start of the results. E.g. 100 will show a page of results  starting from the 101st result. The default value is 0. (optional)
    returned_metadata_fields = 'returned_metadata_fields_example' # str | The parameter defines amount of metadata attributes to return:  1. `minimal_data` - return metadata attributes according to the default template. 2. `extended_data_included` - return metadata attributes according to applied template, if object doesn’t have applied template default template will be used. This is the default for User endpoints. 3. `original_data_included` - return all metadata attributes with values and null attributes, if they are present in the applied template. This is the default for Curator endpoints. (optional)

    try:
        # Retrieve study metadata objects by querying related attachment files
        api_response = api_instance.get_studies_by_files_as_curator(response_format=response_format, filter=filter, query=query, page_limit=page_limit, page_offset=page_offset, returned_metadata_fields=returned_metadata_fields)
        print("The response of StudyIntegrationAsCuratorApi->get_studies_by_files_as_curator:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling StudyIntegrationAsCuratorApi->get_studies_by_files_as_curator: %s\n" % e)

Parameters

Name Type Description Notes
response_format ResponseFormat Supply this parameter with the value `term_id` as part of the query to return extended information including IDs for values and dictionaries. [optional]
filter str Filter by attachment file metadata (key-value metadata pair(s)). E.g. \"Species or strain\"=\"Homo sapiens\" [optional]
query str Search for study metadata objects via a full-text query over all attached files metadata fields. E.g. \"RNA-Seq of human dendritic cells\". Queries matching dictionary terms are automatically expanded to include synonyms. [optional]
page_limit int Maximum number of results to return. This value must be between 0 and 2000 (inclusive). [optional]
page_offset int Show the page {pageOffset+1} results from the start of the results. E.g. 100 will show a page of results starting from the 101st result. The default value is 0. [optional]
returned_metadata_fields str The parameter defines amount of metadata attributes to return: 1. `minimal_data` - return metadata attributes according to the default template. 2. `extended_data_included` - return metadata attributes according to applied template, if object doesn’t have applied template default template will be used. This is the default for User endpoints. 3. `original_data_included` - return all metadata attributes with values and null attributes, if they are present in the applied template. This is the default for Curator endpoints. [optional]

Return type

ListResponse

Authorization

Access-token, Genestack-API-Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, text/tab-separated-values

HTTP response details

Status code Description Response headers
200 The request was successful. The returned value is a list of objects. -
401 User is not authenticated. Please supply a valid Access Token in the `Authorization` HTTP header (e.g. Authorization: bearer [token]) or Genestack API token in the `Genestack-API-Token` header (this token may be obtained from the Genestack UI Profile page). -
500 An internal server error occurred. This indicates an unexpected failure in the Genestack system, please file a bug report to support@genestack.com, including the error details. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_studies_by_libraries_as_curator

ListResponse get_studies_by_libraries_as_curator(response_format=response_format, filter=filter, query=query, search_specific_terms=search_specific_terms, page_limit=page_limit, page_offset=page_offset, returned_metadata_fields=returned_metadata_fields)

Retrieve study metadata objects by querying related libraries

Retrieve study metadata objects whose linked library metadata matches all supplied conditions.

Conditions

It is possible to supply conditions for:

  1. Samples (full-text or metadata key-value pair)
  2. Parent studies (full-text or metadata key-value pair)
  3. Linked variant objects (list of data key-value pairs)
  4. Linked flow cytometry objects (list of data key-value pairs)
  5. Linked any data (except variant and flow cytometry) objects (list of data key-value pairs)

Metadata full-text queries

Single words can be supplied as is; otherwise, use speech marks (") to quote queries that include whitespace. Speech marks and backslash characters in the query need to be escaped with a backslash (\).

Metadata filters

Metadata filters are key-value pairs joined by an operator. The = operator matches literal values/string. The != operator matches anything except the literal value/string. The < or > operators match numerical results that are less or greater than the supplied value. Strings containing whitespace need to be quoted with (").

Data queries

Data queries must be a list of key-value pairs, separated by whitespace. The set of valid keys depends on the specific query type, and is documented in the query parameter summary. The values can be simple non-whitespace strings, or strings enclosed by speech marks ("). Depending on the key, the value may be be a comma-delimited list of string values. Others require numerical values.

Combinations

Metadata queries/filters for the same parameter can be combined with &&, AND, || and OR operators, using white-space to separate out the terms and operators. Parentheses ( ) can be used for complex expressions.

Versioning

Specific versions of omics data files (eg. GCT) can be queried via the useVersions parameter. Different versions of an omics data file are associated via their CHAIN_ID metadata value. This CHAIN_ID can be supplied to the useVersions parameter along with the version number or specific omics data file accessions to include them in the query. If nothing is supplied to the useVersions parameter then only the active version (which is usually the last one imported) is queried. This acts as a filter before the rest of the query is carried out.

Example usage: useVersions=* (query all versions, including those without CHAIN_IDs) useVersions=v2 (query the second version. If there is no second version then the data file is not queried) useVersions=v1,v0 (query the first version and any data files without CHAIN_IDs(v0) ) useVersions=GSVC002:v3 (for omics data files with a CHAIN_ID of GSCV002 query the third version) useVersions=GSVC002:GSF00494,GSF000496 (for omics data files with a CHAIN_ID of GSCV002 query only the specific accessions GSF00494 and GSF000496)

Rules for multiple CHAIN_IDs can be supplied to the parameter using the ; separator.

Paging

For performance reasons this endpoint returns results in "pages" of limited size. In order to retrieve all matching results the client needs to request multiple pages starting from an offset to the first result. You can do this using the pageOffset query parameter. A value of 0 (the default) instructs the server to return the first page of results, 100 would return a page of results starting from the 101st result and so on. To retrieve all results, iterate through pages using pageOffset values of n * pageLimit until a page returns fewer results than the page limit, which indicates there are no more results.

Example

  • Api Key Authentication (Access-token):
  • Api Key Authentication (Genestack-API-Token):
import odm_api
from odm_api.models.list_response import ListResponse
from odm_api.models.response_format import ResponseFormat
from odm_api.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = odm_api.Configuration(
    host = "http://localhost"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: Access-token
configuration.api_key['Access-token'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Access-token'] = 'Bearer'

# Configure API key authorization: Genestack-API-Token
configuration.api_key['Genestack-API-Token'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Genestack-API-Token'] = 'Bearer'

# Enter a context with an instance of the API client
with odm_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = odm_api.StudyIntegrationAsCuratorApi(api_client)
    response_format = odm_api.ResponseFormat() # ResponseFormat | Supply this parameter with the value `term_id` as part of the query to return extended information including IDs for values and dictionaries. (optional)
    filter = 'filter_example' # str | Filter by library metadata (key-value metadata pair(s)). E.g. `\"Library Type\"=RNA-Seq-1` (optional)
    query = 'query_example' # str | Search for library objects via a full-text query over all library metadata fields. E.g. `\"illumina HiSeq500\"`. Queries matching dictionary terms are automatically expanded to include synonyms. (optional)
    search_specific_terms = True # bool | If the full-text query term is present in an ODM dictionary, enabling this parameter will modify the query to include child terms of the full-text query.  For example, the search query \"Body fluid\" can be expanded to include the term \"Blood\" (a child term of  \"Body fluid\") so files containing either \"Body fluid\" or  \"Blood\"  in their metadata will be returned in the search results.  The parent-child relationship is defined by the key \"broaders\" or \"subClassOf\"  in the dictionary.  If the full query term is not present in a dictionary then this parameter has no effect. (optional)
    page_limit = 56 # int | Maximum number of results to return. This value must be between 0 and 2000 (inclusive). (optional)
    page_offset = 56 # int | Show the page {pageOffset+1} results from the start of the results. E.g. 100 will show a page of results  starting from the 101st result. The default value is 0. (optional)
    returned_metadata_fields = 'returned_metadata_fields_example' # str | The parameter defines amount of metadata attributes to return:  1. `minimal_data` - return metadata attributes according to the default template. 2. `extended_data_included` - return metadata attributes according to applied template, if object doesn’t have applied template default template will be used. This is the default for User endpoints. 3. `original_data_included` - return all metadata attributes with values and null attributes, if they are present in the applied template. This is the default for Curator endpoints. (optional)

    try:
        # Retrieve study metadata objects by querying related libraries
        api_response = api_instance.get_studies_by_libraries_as_curator(response_format=response_format, filter=filter, query=query, search_specific_terms=search_specific_terms, page_limit=page_limit, page_offset=page_offset, returned_metadata_fields=returned_metadata_fields)
        print("The response of StudyIntegrationAsCuratorApi->get_studies_by_libraries_as_curator:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling StudyIntegrationAsCuratorApi->get_studies_by_libraries_as_curator: %s\n" % e)

Parameters

Name Type Description Notes
response_format ResponseFormat Supply this parameter with the value `term_id` as part of the query to return extended information including IDs for values and dictionaries. [optional]
filter str Filter by library metadata (key-value metadata pair(s)). E.g. `\"Library Type\"=RNA-Seq-1` [optional]
query str Search for library objects via a full-text query over all library metadata fields. E.g. `\"illumina HiSeq500\"`. Queries matching dictionary terms are automatically expanded to include synonyms. [optional]
search_specific_terms bool If the full-text query term is present in an ODM dictionary, enabling this parameter will modify the query to include child terms of the full-text query. For example, the search query \"Body fluid\" can be expanded to include the term \"Blood\" (a child term of \"Body fluid\") so files containing either \"Body fluid\" or \"Blood\" in their metadata will be returned in the search results. The parent-child relationship is defined by the key \"broaders\" or \"subClassOf\" in the dictionary. If the full query term is not present in a dictionary then this parameter has no effect. [optional]
page_limit int Maximum number of results to return. This value must be between 0 and 2000 (inclusive). [optional]
page_offset int Show the page {pageOffset+1} results from the start of the results. E.g. 100 will show a page of results starting from the 101st result. The default value is 0. [optional]
returned_metadata_fields str The parameter defines amount of metadata attributes to return: 1. `minimal_data` - return metadata attributes according to the default template. 2. `extended_data_included` - return metadata attributes according to applied template, if object doesn’t have applied template default template will be used. This is the default for User endpoints. 3. `original_data_included` - return all metadata attributes with values and null attributes, if they are present in the applied template. This is the default for Curator endpoints. [optional]

Return type

ListResponse

Authorization

Access-token, Genestack-API-Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, text/tab-separated-values

HTTP response details

Status code Description Response headers
200 The request was successful. The returned value is a list of objects. -
401 User is not authenticated. Please supply a valid Access Token in the `Authorization` HTTP header (e.g. Authorization: bearer [token]) or Genestack API token in the `Genestack-API-Token` header (this token may be obtained from the Genestack UI Profile page). -
500 An internal server error occurred. This indicates an unexpected failure in the Genestack system, please file a bug report to support@genestack.com, including the error details. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_studies_by_preparations_as_curator

ListResponse get_studies_by_preparations_as_curator(response_format=response_format, filter=filter, query=query, search_specific_terms=search_specific_terms, page_limit=page_limit, page_offset=page_offset, returned_metadata_fields=returned_metadata_fields)

Retrieve study metadata objects by querying related preparations

Retrieve study metadata objects whose linked preparation metadata matches all supplied conditions.

Conditions

It is possible to supply conditions for:

  1. Samples (full-text or metadata key-value pair)
  2. Parent studies (full-text or metadata key-value pair)
  3. Linked variant objects (list of data key-value pairs)
  4. Linked flow cytometry objects (list of data key-value pairs)
  5. Linked any data (except variant and flow cytometry) objects (list of data key-value pairs)

Metadata full-text queries

Single words can be supplied as is; otherwise, use speech marks (") to quote queries that include whitespace. Speech marks and backslash characters in the query need to be escaped with a backslash (\).

Metadata filters

Metadata filters are key-value pairs joined by an operator. The = operator matches literal values/string. The != operator matches anything except the literal value/string. The < or > operators match numerical results that are less or greater than the supplied value. Strings containing whitespace need to be quoted with (").

Data queries

Data queries must be a list of key-value pairs, separated by whitespace. The set of valid keys depends on the specific query type, and is documented in the query parameter summary. The values can be simple non-whitespace strings, or strings enclosed by speech marks ("). Depending on the key, the value may be be a comma-delimited list of string values. Others require numerical values.

Combinations

Metadata queries/filters for the same parameter can be combined with &&, AND, || and OR operators, using white-space to separate out the terms and operators. Parentheses ( ) can be used for complex expressions.

Versioning

Specific versions of omics data files (eg. GCT) can be queried via the useVersions parameter. Different versions of an omics data file are associated via their CHAIN_ID metadata value. This CHAIN_ID can be supplied to the useVersions parameter along with the version number or specific omics data file accessions to include them in the query. If nothing is supplied to the useVersions parameter then only the active version (which is usually the last one imported) is queried. This acts as a filter before the rest of the query is carried out.

Example usage: useVersions=* (query all versions, including those without CHAIN_IDs) useVersions=v2 (query the second version. If there is no second version then the data file is not queried) useVersions=v1,v0 (query the first version and any data files without CHAIN_IDs(v0) ) useVersions=GSVC002:v3 (for omics data files with a CHAIN_ID of GSCV002 query the third version) useVersions=GSVC002:GSF00494,GSF000496 (for omics data files with a CHAIN_ID of GSCV002 query only the specific accessions GSF00494 and GSF000496)

Rules for multiple CHAIN_IDs can be supplied to the parameter using the ; separator.

Paging

For performance reasons this endpoint returns results in "pages" of limited size. In order to retrieve all matching results the client needs to request multiple pages starting from an offset to the first result. You can do this using the pageOffset query parameter. A value of 0 (the default) instructs the server to return the first page of results, 100 would return a page of results starting from the 101st result and so on. To retrieve all results, iterate through pages using pageOffset values of n * pageLimit until a page returns fewer results than the page limit, which indicates there are no more results.

Example

  • Api Key Authentication (Access-token):
  • Api Key Authentication (Genestack-API-Token):
import odm_api
from odm_api.models.list_response import ListResponse
from odm_api.models.response_format import ResponseFormat
from odm_api.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = odm_api.Configuration(
    host = "http://localhost"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: Access-token
configuration.api_key['Access-token'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Access-token'] = 'Bearer'

# Configure API key authorization: Genestack-API-Token
configuration.api_key['Genestack-API-Token'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Genestack-API-Token'] = 'Bearer'

# Enter a context with an instance of the API client
with odm_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = odm_api.StudyIntegrationAsCuratorApi(api_client)
    response_format = odm_api.ResponseFormat() # ResponseFormat | Supply this parameter with the value `term_id` as part of the query to return extended information including IDs for values and dictionaries. (optional)
    filter = 'filter_example' # str | Filter by preparation metadata (key-value metadata pair(s)). E.g. `Digestion=Trypsin` (optional)
    query = 'query_example' # str | Search for preparation objects via a full-text query over all preparation metadata fields. E.g. `\"reversed-phase liquid chromatography\"`. Queries matching dictionary terms are automatically expanded to include synonyms. (optional)
    search_specific_terms = True # bool | If the full-text query term is present in an ODM dictionary, enabling this parameter will modify the query to include child terms of the full-text query.  For example, the search query \"Body fluid\" can be expanded to include the term \"Blood\" (a child term of  \"Body fluid\") so files containing either \"Body fluid\" or  \"Blood\"  in their metadata will be returned in the search results.  The parent-child relationship is defined by the key \"broaders\" or \"subClassOf\"  in the dictionary.  If the full query term is not present in a dictionary then this parameter has no effect. (optional)
    page_limit = 56 # int | Maximum number of results to return. This value must be between 0 and 2000 (inclusive). (optional)
    page_offset = 56 # int | Show the page {pageOffset+1} results from the start of the results. E.g. 100 will show a page of results  starting from the 101st result. The default value is 0. (optional)
    returned_metadata_fields = 'returned_metadata_fields_example' # str | The parameter defines amount of metadata attributes to return:  1. `minimal_data` - return metadata attributes according to the default template. 2. `extended_data_included` - return metadata attributes according to applied template, if object doesn’t have applied template default template will be used. This is the default for User endpoints. 3. `original_data_included` - return all metadata attributes with values and null attributes, if they are present in the applied template. This is the default for Curator endpoints. (optional)

    try:
        # Retrieve study metadata objects by querying related preparations
        api_response = api_instance.get_studies_by_preparations_as_curator(response_format=response_format, filter=filter, query=query, search_specific_terms=search_specific_terms, page_limit=page_limit, page_offset=page_offset, returned_metadata_fields=returned_metadata_fields)
        print("The response of StudyIntegrationAsCuratorApi->get_studies_by_preparations_as_curator:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling StudyIntegrationAsCuratorApi->get_studies_by_preparations_as_curator: %s\n" % e)

Parameters

Name Type Description Notes
response_format ResponseFormat Supply this parameter with the value `term_id` as part of the query to return extended information including IDs for values and dictionaries. [optional]
filter str Filter by preparation metadata (key-value metadata pair(s)). E.g. `Digestion=Trypsin` [optional]
query str Search for preparation objects via a full-text query over all preparation metadata fields. E.g. `\"reversed-phase liquid chromatography\"`. Queries matching dictionary terms are automatically expanded to include synonyms. [optional]
search_specific_terms bool If the full-text query term is present in an ODM dictionary, enabling this parameter will modify the query to include child terms of the full-text query. For example, the search query \"Body fluid\" can be expanded to include the term \"Blood\" (a child term of \"Body fluid\") so files containing either \"Body fluid\" or \"Blood\" in their metadata will be returned in the search results. The parent-child relationship is defined by the key \"broaders\" or \"subClassOf\" in the dictionary. If the full query term is not present in a dictionary then this parameter has no effect. [optional]
page_limit int Maximum number of results to return. This value must be between 0 and 2000 (inclusive). [optional]
page_offset int Show the page {pageOffset+1} results from the start of the results. E.g. 100 will show a page of results starting from the 101st result. The default value is 0. [optional]
returned_metadata_fields str The parameter defines amount of metadata attributes to return: 1. `minimal_data` - return metadata attributes according to the default template. 2. `extended_data_included` - return metadata attributes according to applied template, if object doesn’t have applied template default template will be used. This is the default for User endpoints. 3. `original_data_included` - return all metadata attributes with values and null attributes, if they are present in the applied template. This is the default for Curator endpoints. [optional]

Return type

ListResponse

Authorization

Access-token, Genestack-API-Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, text/tab-separated-values

HTTP response details

Status code Description Response headers
200 The request was successful. The returned value is a list of objects. -
401 User is not authenticated. Please supply a valid Access Token in the `Authorization` HTTP header (e.g. Authorization: bearer [token]) or Genestack API token in the `Genestack-API-Token` header (this token may be obtained from the Genestack UI Profile page). -
500 An internal server error occurred. This indicates an unexpected failure in the Genestack system, please file a bug report to support@genestack.com, including the error details. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_studies_by_samples_as_curator

ListResponse get_studies_by_samples_as_curator(response_format=response_format, filter=filter, query=query, search_specific_terms=search_specific_terms, page_limit=page_limit, page_offset=page_offset, returned_metadata_fields=returned_metadata_fields)

Retrieve study metadata objects by querying related samples

Retrieve study metadata objects whose linked sample metadata matches all supplied conditions.

Conditions

It is possible to supply conditions for:

  1. Samples (full-text or metadata key-value pair)
  2. Parent studies (full-text or metadata key-value pair)
  3. Linked variant objects (list of data key-value pairs)
  4. Linked flow cytometry objects (list of data key-value pairs)
  5. Linked any data (except variant and flow cytometry) objects (list of data key-value pairs)

Metadata full-text queries

Single words can be supplied as is; otherwise, use speech marks (") to quote queries that include whitespace. Speech marks and backslash characters in the query need to be escaped with a backslash (\).

Metadata filters

Metadata filters are key-value pairs joined by an operator. The = operator matches literal values/string. The != operator matches anything except the literal value/string. The < or > operators match numerical results that are less or greater than the supplied value. Strings containing whitespace need to be quoted with (").

Data queries

Data queries must be a list of key-value pairs, separated by whitespace. The set of valid keys depends on the specific query type, and is documented in the query parameter summary. The values can be simple non-whitespace strings, or strings enclosed by speech marks ("). Depending on the key, the value may be be a comma-delimited list of string values. Others require numerical values.

Combinations

Metadata queries/filters for the same parameter can be combined with &&, AND, || and OR operators, using white-space to separate out the terms and operators. Parentheses ( ) can be used for complex expressions.

Versioning

Specific versions of omics data files (eg. GCT) can be queried via the useVersions parameter. Different versions of an omics data file are associated via their CHAIN_ID metadata value. This CHAIN_ID can be supplied to the useVersions parameter along with the version number or specific omics data file accessions to include them in the query. If nothing is supplied to the useVersions parameter then only the active version (which is usually the last one imported) is queried. This acts as a filter before the rest of the query is carried out.

Example usage: useVersions=* (query all versions, including those without CHAIN_IDs) useVersions=v2 (query the second version. If there is no second version then the data file is not queried) useVersions=v1,v0 (query the first version and any data files without CHAIN_IDs(v0) ) useVersions=GSVC002:v3 (for omics data files with a CHAIN_ID of GSCV002 query the third version) useVersions=GSVC002:GSF00494,GSF000496 (for omics data files with a CHAIN_ID of GSCV002 query only the specific accessions GSF00494 and GSF000496)

Rules for multiple CHAIN_IDs can be supplied to the parameter using the ; separator.

Paging

For performance reasons this endpoint returns results in "pages" of limited size. In order to retrieve all matching results the client needs to request multiple pages starting from an offset to the first result. You can do this using the pageOffset query parameter. A value of 0 (the default) instructs the server to return the first page of results, 100 would return a page of results starting from the 101st result and so on. To retrieve all results, iterate through pages using pageOffset values of n * pageLimit until a page returns fewer results than the page limit, which indicates there are no more results.

Example

  • Api Key Authentication (Access-token):
  • Api Key Authentication (Genestack-API-Token):
import odm_api
from odm_api.models.list_response import ListResponse
from odm_api.models.response_format import ResponseFormat
from odm_api.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = odm_api.Configuration(
    host = "http://localhost"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: Access-token
configuration.api_key['Access-token'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Access-token'] = 'Bearer'

# Configure API key authorization: Genestack-API-Token
configuration.api_key['Genestack-API-Token'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Genestack-API-Token'] = 'Bearer'

# Enter a context with an instance of the API client
with odm_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = odm_api.StudyIntegrationAsCuratorApi(api_client)
    response_format = odm_api.ResponseFormat() # ResponseFormat | Supply this parameter with the value `term_id` as part of the query to return extended information including IDs for values and dictionaries. (optional)
    filter = 'filter_example' # str | Filter by sample metadata (key-value metadata pair(s)). E.g. \"Species or strain\"=\"Homo sapiens\" (optional)
    query = 'query_example' # str | Search for study metadata objects via a full-text query over all sample metadata fields. E.g. \"RNA-Seq of human dendritic cells\". Queries matching dictionary terms are automatically expanded to include synonyms. (optional)
    search_specific_terms = True # bool | If the full-text query term is present in an ODM dictionary, enabling this parameter will modify the query to include child terms of the full-text query.  For example, the search query \"Body fluid\" can be expanded to include the term \"Blood\" (a child term of  \"Body fluid\") so files containing either \"Body fluid\" or  \"Blood\"  in their metadata will be returned in the search results.  The parent-child relationship is defined by the key \"broaders\" or \"subClassOf\"  in the dictionary.  If the full query term is not present in a dictionary then this parameter has no effect. (optional)
    page_limit = 56 # int | Maximum number of results to return. This value must be between 0 and 2000 (inclusive). (optional)
    page_offset = 56 # int | Show the page {pageOffset+1} results from the start of the results. E.g. 100 will show a page of results  starting from the 101st result. The default value is 0. (optional)
    returned_metadata_fields = 'returned_metadata_fields_example' # str | The parameter defines amount of metadata attributes to return:  1. `minimal_data` - return metadata attributes according to the default template. 2. `extended_data_included` - return metadata attributes according to applied template, if object doesn’t have applied template default template will be used. This is the default for User endpoints. 3. `original_data_included` - return all metadata attributes with values and null attributes, if they are present in the applied template. This is the default for Curator endpoints. (optional)

    try:
        # Retrieve study metadata objects by querying related samples
        api_response = api_instance.get_studies_by_samples_as_curator(response_format=response_format, filter=filter, query=query, search_specific_terms=search_specific_terms, page_limit=page_limit, page_offset=page_offset, returned_metadata_fields=returned_metadata_fields)
        print("The response of StudyIntegrationAsCuratorApi->get_studies_by_samples_as_curator:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling StudyIntegrationAsCuratorApi->get_studies_by_samples_as_curator: %s\n" % e)

Parameters

Name Type Description Notes
response_format ResponseFormat Supply this parameter with the value `term_id` as part of the query to return extended information including IDs for values and dictionaries. [optional]
filter str Filter by sample metadata (key-value metadata pair(s)). E.g. \"Species or strain\"=\"Homo sapiens\" [optional]
query str Search for study metadata objects via a full-text query over all sample metadata fields. E.g. \"RNA-Seq of human dendritic cells\". Queries matching dictionary terms are automatically expanded to include synonyms. [optional]
search_specific_terms bool If the full-text query term is present in an ODM dictionary, enabling this parameter will modify the query to include child terms of the full-text query. For example, the search query \"Body fluid\" can be expanded to include the term \"Blood\" (a child term of \"Body fluid\") so files containing either \"Body fluid\" or \"Blood\" in their metadata will be returned in the search results. The parent-child relationship is defined by the key \"broaders\" or \"subClassOf\" in the dictionary. If the full query term is not present in a dictionary then this parameter has no effect. [optional]
page_limit int Maximum number of results to return. This value must be between 0 and 2000 (inclusive). [optional]
page_offset int Show the page {pageOffset+1} results from the start of the results. E.g. 100 will show a page of results starting from the 101st result. The default value is 0. [optional]
returned_metadata_fields str The parameter defines amount of metadata attributes to return: 1. `minimal_data` - return metadata attributes according to the default template. 2. `extended_data_included` - return metadata attributes according to applied template, if object doesn’t have applied template default template will be used. This is the default for User endpoints. 3. `original_data_included` - return all metadata attributes with values and null attributes, if they are present in the applied template. This is the default for Curator endpoints. [optional]

Return type

ListResponse

Authorization

Access-token, Genestack-API-Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, text/tab-separated-values

HTTP response details

Status code Description Response headers
200 The request was successful. The returned value is a list of objects. -
401 User is not authenticated. Please supply a valid Access Token in the `Authorization` HTTP header (e.g. Authorization: bearer [token]) or Genestack API token in the `Genestack-API-Token` header (this token may be obtained from the Genestack UI Profile page). -
500 An internal server error occurred. This indicates an unexpected failure in the Genestack system, please file a bug report to support@genestack.com, including the error details. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_study_by_file_as_curator

object get_study_by_file_as_curator(id, response_format=response_format, returned_metadata_fields=returned_metadata_fields)

Retrieve study metadata by querying attachment file ID (accession)

Example

  • Api Key Authentication (Access-token):
  • Api Key Authentication (Genestack-API-Token):
import odm_api
from odm_api.models.response_format import ResponseFormat
from odm_api.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = odm_api.Configuration(
    host = "http://localhost"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: Access-token
configuration.api_key['Access-token'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Access-token'] = 'Bearer'

# Configure API key authorization: Genestack-API-Token
configuration.api_key['Genestack-API-Token'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Genestack-API-Token'] = 'Bearer'

# Enter a context with an instance of the API client
with odm_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = odm_api.StudyIntegrationAsCuratorApi(api_client)
    id = 'id_example' # str | Unique identifier (accession) of the object.
    response_format = odm_api.ResponseFormat() # ResponseFormat | Supply this parameter with the value `term_id` as part of the query to return extended information including IDs for values and dictionaries. (optional)
    returned_metadata_fields = 'returned_metadata_fields_example' # str | The parameter defines amount of metadata attributes to return:  1. `minimal_data` - return metadata attributes according to the default template. 2. `extended_data_included` - return metadata attributes according to applied template, if object doesn’t have applied template default template will be used. This is the default for User endpoints. 3. `original_data_included` - return all metadata attributes with values and null attributes, if they are present in the applied template. This is the default for Curator endpoints. (optional)

    try:
        # Retrieve study metadata by querying attachment file ID (accession)
        api_response = api_instance.get_study_by_file_as_curator(id, response_format=response_format, returned_metadata_fields=returned_metadata_fields)
        print("The response of StudyIntegrationAsCuratorApi->get_study_by_file_as_curator:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling StudyIntegrationAsCuratorApi->get_study_by_file_as_curator: %s\n" % e)

Parameters

Name Type Description Notes
id str Unique identifier (accession) of the object.
response_format ResponseFormat Supply this parameter with the value `term_id` as part of the query to return extended information including IDs for values and dictionaries. [optional]
returned_metadata_fields str The parameter defines amount of metadata attributes to return: 1. `minimal_data` - return metadata attributes according to the default template. 2. `extended_data_included` - return metadata attributes according to applied template, if object doesn’t have applied template default template will be used. This is the default for User endpoints. 3. `original_data_included` - return all metadata attributes with values and null attributes, if they are present in the applied template. This is the default for Curator endpoints. [optional]

Return type

object

Authorization

Access-token, Genestack-API-Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 The request was successful. The returned value is the object. -
400 The supplied object ID is invalid. -
401 User is not authenticated. Please supply a valid Access Token in the `Authorization` HTTP header (e.g. Authorization: bearer [token]) or Genestack API token in the `Genestack-API-Token` header (this token may be obtained from the Genestack UI Profile page). -
500 An internal server error occurred. This indicates an unexpected failure in the Genestack system, please file a bug report to support@genestack.com, including the error details. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_study_by_sample_as_curator

object get_study_by_sample_as_curator(id, response_format=response_format, returned_metadata_fields=returned_metadata_fields)

Retrieve study metadata by querying sample ID (accession)

Example

  • Api Key Authentication (Access-token):
  • Api Key Authentication (Genestack-API-Token):
import odm_api
from odm_api.models.response_format import ResponseFormat
from odm_api.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = odm_api.Configuration(
    host = "http://localhost"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: Access-token
configuration.api_key['Access-token'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Access-token'] = 'Bearer'

# Configure API key authorization: Genestack-API-Token
configuration.api_key['Genestack-API-Token'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Genestack-API-Token'] = 'Bearer'

# Enter a context with an instance of the API client
with odm_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = odm_api.StudyIntegrationAsCuratorApi(api_client)
    id = 'id_example' # str | Unique identifier (accession) of the object.
    response_format = odm_api.ResponseFormat() # ResponseFormat | Supply this parameter with the value `term_id` as part of the query to return extended information including IDs for values and dictionaries. (optional)
    returned_metadata_fields = 'returned_metadata_fields_example' # str | The parameter defines amount of metadata attributes to return:  1. `minimal_data` - return metadata attributes according to the default template. 2. `extended_data_included` - return metadata attributes according to applied template, if object doesn’t have applied template default template will be used. This is the default for User endpoints. 3. `original_data_included` - return all metadata attributes with values and null attributes, if they are present in the applied template. This is the default for Curator endpoints. (optional)

    try:
        # Retrieve study metadata by querying sample ID (accession)
        api_response = api_instance.get_study_by_sample_as_curator(id, response_format=response_format, returned_metadata_fields=returned_metadata_fields)
        print("The response of StudyIntegrationAsCuratorApi->get_study_by_sample_as_curator:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling StudyIntegrationAsCuratorApi->get_study_by_sample_as_curator: %s\n" % e)

Parameters

Name Type Description Notes
id str Unique identifier (accession) of the object.
response_format ResponseFormat Supply this parameter with the value `term_id` as part of the query to return extended information including IDs for values and dictionaries. [optional]
returned_metadata_fields str The parameter defines amount of metadata attributes to return: 1. `minimal_data` - return metadata attributes according to the default template. 2. `extended_data_included` - return metadata attributes according to applied template, if object doesn’t have applied template default template will be used. This is the default for User endpoints. 3. `original_data_included` - return all metadata attributes with values and null attributes, if they are present in the applied template. This is the default for Curator endpoints. [optional]

Return type

object

Authorization

Access-token, Genestack-API-Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 The request was successful. The returned value is the object. -
400 The supplied object ID is invalid. -
401 User is not authenticated. Please supply a valid Access Token in the `Authorization` HTTP header (e.g. Authorization: bearer [token]) or Genestack API token in the `Genestack-API-Token` header (this token may be obtained from the Genestack UI Profile page). -
500 An internal server error occurred. This indicates an unexpected failure in the Genestack system, please file a bug report to support@genestack.com, including the error details. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

search_studies_by_filter_as_curator

FindObjectsResponse search_studies_by_filter_as_curator(request)

Find and retrieve studies by full-text or facet query

Find studies and retrieve their data using full-text search or facet search by metadata of study itself or child object (samples, libraries, preparations, signal groups). Only studies available to that users are returned.

The endpoint returns: - a list of studies with their metadata summary; - a list of filter objects with counts; filter list is the same for all users in an and can be configured in “Study Browser” application via "Configure facets" (by a user with corresponding permission); for each filter object, only the first 5 most popular facets are returned, the facts are sorted by the count value in descending order; only studies available to user are counted.

Filter attributes for fulltext search: - "type": "FULL_TEXT" - "match" - "mode"

For details on two latter ones, see the request body model. Only one filter with "type=": "FULL_TEXT" can be passed in the request body.

To filter studies via facets, the filter attributes are necessary: type = SELECT, filterOptionId. For details, use the request body model. filterOptionId can be obtained from the response body when the endpoint is first called without filters. Multiple filters with type = SELECT can be passed in the request body. Filters within the same attribute are automatically used with the OR operator. Filters of different attributes are automatically used with the AND operator. This behaviour can not be changed.

It is possible to call the endpoint without any filters, then all the studies available to the user are returned.

Example

  • Api Key Authentication (Genestack-API-Token):
import odm_api
from odm_api.models.find_objects_response import FindObjectsResponse
from odm_api.models.search_study_request import SearchStudyRequest
from odm_api.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = odm_api.Configuration(
    host = "http://localhost"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: Genestack-API-Token
configuration.api_key['Genestack-API-Token'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Genestack-API-Token'] = 'Bearer'

# Enter a context with an instance of the API client
with odm_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = odm_api.StudyIntegrationAsCuratorApi(api_client)
    request = odm_api.SearchStudyRequest() # SearchStudyRequest | 

    try:
        # Find and retrieve studies by full-text or facet query
        api_response = api_instance.search_studies_by_filter_as_curator(request)
        print("The response of StudyIntegrationAsCuratorApi->search_studies_by_filter_as_curator:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling StudyIntegrationAsCuratorApi->search_studies_by_filter_as_curator: %s\n" % e)

Parameters

Name Type Description Notes
request SearchStudyRequest

Return type

FindObjectsResponse

Authorization

Genestack-API-Token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 The request was successful. Retrieved studies and filters. -
400 Invalid request body -
401 User is not authenticated. Please supply a valid Genestack API token in the `Genestack-API-Token` HTTP header (this token may be obtained from the Genestack UI Profile page). -
500 An internal server error occurred. This indicates an unexpected failure in the Genestack system, please file a bug report to support@genestack.com, including the error details. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]