ManageDataApi¶
All URIs are relative to http://localhost
| Method | HTTP request | Description |
|---|---|---|
| DeleteData | DELETE /api/v1/manage-data/data | Delete objects from ODM |
| GetDetachedObjects | GET /api/v1/manage-data/detached-objects | Retrieve a list of detached objects |
DeleteData¶
array[ManagedObject] DeleteData(accessions = var.accessions)
Delete objects from ODM
The objects will be marked for deletion. In case the selected object has more than one version, the endpoint deletes all of them. The following object types can be deleted by the endpoint: * STUDY * SAMPLE_GROUP * SAMPLE_OBJECT * LIBRARY_GROUP * PREPARATION_GROUP * CELL_GROUP * TABULAR_DATA * GENE_VARIANT * FLOW_CYTOMETRY * REFERENCE_GENOME * FILE Moreover, if the selected object is linked to any other data, the endpoint will also delete the linked data associated with it according to the specified rules: * If you delete a STUDY, the entire study with all the listed group types and files, will be removed. * Deleting a SAMPLE_GROUP will result in the removal of all samples associated with this sample group, along with any linked TABULAR_DATA/GENE_VARIANT/FLOW_CYTOMETRY/LIBRARY_GROUP/PREPARATION_GROUP/CELL_GROUP. The linked TABULAR_DATA/GENE_VARIANT/FLOW_CYTOMETRY/CELL_GROUP will be deleted, even if it is linked to another metadata group. * Deleting a SAMPLE_OBJECT will result in the removal of that sample from the study, and it will not be displayed in the version history. If a LIBRARY_OBJECT or PREPARATION_OBJECT is linked to this SAMPLE_OBJECT, it will be deleted as well. * Deleting a LIBRARY_GROUP or PREPARATION_GROUP will result in the removal of all libraries or preparations associated with this group, along with any linked TABULAR_DATA/CELL_GROUP. * Deleting a CELL_GROUP will result in the removal of linked TABULAR_DATA (cell expression group). * If you delete TABULAR_DATA/GENE_VARIANT/FLOW_CYTOMETRY, all associated data, such as links and runs will be removed from ODM. * If you delete REFERENCE_GENOME, searching for variant by variantFeature (genes) won't be available for linked VCF groups. * If you delete FILE, the file will be removed from ODM.
Example¶
library(odmApi)
# Delete objects from ODM
#
# prepare function argument(s)
var_accessions <- c("inner_example") # array[character] | Accessions files to be deleted. (Optional)
api_instance <- ManageDataApi$new()
# Configure API key authorization: Access-token
api_instance$api_client$api_keys["Authorization"] <- Sys.getenv("API_KEY")
# Configure API key authorization: Genestack-API-Token
# api_instance$api_client$api_keys["Genestack-API-Token"] <- Sys.getenv("API_KEY")
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
# result <- api_instance$DeleteData(accessions = var_accessionsdata_file = "result.txt")
result <- api_instance$DeleteData(accessions = var_accessions)
dput(result)
Parameters¶
| Name | Type | Description | Notes |
|---|---|---|---|
| accessions | list( character ) | Accessions files to be deleted. | [optional] |
Return type¶
Authorization¶
Access-token, Genestack-API-Token
HTTP request headers¶
- Content-Type: Not defined
- Accept: application/json
HTTP response details¶
| Status code | Description | Response headers |
|---|---|---|
| 202 | The deletion of the following files and all linked data has started. | - |
| 400 | Deletion could not be performed due to Bad Request. | - |
| 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). | - |
| 403 | Not enough permissions to call method or the file is not meant to be deleted. | - |
| 404 | Some of the provided accessions could not be found in ODM. Deletion will not be preformed. Please review your list and repeat the attempt. | - |
| 406 | Some of the provided accessions do not belong to the supported object types. Deletion will not be performed. Please review your list and repeat the attempt. | - |
| 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. | - |
GetDetachedObjects¶
DetachedCollection GetDetachedObjects(detached_object_type = var.detached_object_type, limit = var.limit, cursor = var.cursor)
Retrieve a list of detached objects
Retrieve various types of detached data objects. An object is defined as 'detached' if it lacks any direct or indirect link to a root-level object, which in this context is referred to as 'study'. Study is considered as detached object itself in case there are no links to objects at a lower level. Data with specific detachedObjectType can be retrieved by specifying the types in detachedObjectType parameter. The detached objects are sorted according to their detachedObjectType and genestack:accession. Specific ordering can be observed in the list of supported detached types found below. Pagination of the results can be conveniently managed using the cursor and limit parameters. Supported types of detached objects (listed in the order of retrieval) include: * STUDY * SAMPLE_GROUP * LIBRARY_GROUP * PREPARATION_GROUP * CELL_GROUP * TABULAR_DATA * GENE_VARIANT * FLOW_CYTOMETRY
Example¶
library(odmApi)
# Retrieve a list of detached objects
#
# prepare function argument(s)
var_detached_object_type <- c("inner_example") # array[character] | Filter by detached object type. Multiple values can be used to filter the data. (Optional)
var_limit <- 56 # integer | This parameter determines the number of results to retrieve per page, with the default set at 2000. (Optional)
var_cursor <- "cursor_example" # character | This parameter enables retrieval of objects starting from a specific point. Currently, it represents the accession of the last obtained object. However, please note that its functionality might change over time, so it is advisable to consider the cursor's content as a general string. (Optional)
api_instance <- ManageDataApi$new()
# Configure API key authorization: Access-token
api_instance$api_client$api_keys["Authorization"] <- Sys.getenv("API_KEY")
# Configure API key authorization: Genestack-API-Token
# api_instance$api_client$api_keys["Genestack-API-Token"] <- Sys.getenv("API_KEY")
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
# result <- api_instance$GetDetachedObjects(detached_object_type = var_detached_object_type, limit = var_limit, cursor = var_cursordata_file = "result.txt")
result <- api_instance$GetDetachedObjects(detached_object_type = var_detached_object_type, limit = var_limit, cursor = var_cursor)
dput(result)
Parameters¶
| Name | Type | Description | Notes |
|---|---|---|---|
| detached_object_type | list( character ) | Filter by detached object type. Multiple values can be used to filter the data. | [optional] |
| limit | integer | This parameter determines the number of results to retrieve per page, with the default set at 2000. | [optional] |
| cursor | character | This parameter enables retrieval of objects starting from a specific point. Currently, it represents the accession of the last obtained object. However, please note that its functionality might change over time, so it is advisable to consider the cursor's content as a general string. | [optional] |
Return type¶
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 | Retrieved detached data. | - |
| 400 | Detached data cannot be retrieved due to Bad Request. | - |
| 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). | - |
| 403 | Not enough permissions to call method. | - |
| 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. | - |