odm_api.ManageDataApi¶
All URIs are relative to http://localhost
| Method | HTTP request | Description |
|---|---|---|
| delete_data | DELETE /api/v1/manage-data/data | Delete objects from ODM |
| get_detached_objects | GET /api/v1/manage-data/detached-objects | Retrieve a list of detached objects |
delete_data¶
List[ManagedObject] delete_data(accessions=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¶
- Api Key Authentication (Access-token):
- Api Key Authentication (Genestack-API-Token):
import odm_api
from odm_api.models.managed_object import ManagedObject
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.ManageDataApi(api_client)
accessions = ['accessions_example'] # List[str] | Accessions files to be deleted. (optional)
try:
# Delete objects from ODM
api_response = api_instance.delete_data(accessions=accessions)
print("The response of ManageDataApi->delete_data:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ManageDataApi->delete_data: %s\n" % e)
Parameters¶
| Name | Type | Description | Notes |
|---|---|---|---|
| accessions | List[str] | 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. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
get_detached_objects¶
DetachedCollection get_detached_objects(detached_object_type=detached_object_type, limit=limit, cursor=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¶
- Api Key Authentication (Access-token):
- Api Key Authentication (Genestack-API-Token):
import odm_api
from odm_api.models.detached_collection import DetachedCollection
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.ManageDataApi(api_client)
detached_object_type = ['detached_object_type_example'] # List[str] | Filter by detached object type. Multiple values can be used to filter the data. (optional)
limit = 56 # int | This parameter determines the number of results to retrieve per page, with the default set at 2000. (optional)
cursor = 'cursor_example' # str | 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)
try:
# Retrieve a list of detached objects
api_response = api_instance.get_detached_objects(detached_object_type=detached_object_type, limit=limit, cursor=cursor)
print("The response of ManageDataApi->get_detached_objects:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ManageDataApi->get_detached_objects: %s\n" % e)
Parameters¶
| Name | Type | Description | Notes |
|---|---|---|---|
| detached_object_type | List[str] | Filter by detached object type. Multiple values can be used to filter the data. | [optional] |
| limit | int | This parameter determines the number of results to retrieve per page, with the default set at 2000. | [optional] |
| cursor | str | 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. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]