Sample Sheets API

The REST API for sample sheet operations is described in this document.

API Views

Sample Sheet Management

class samplesheets.views_api.InvestigationRetrieveAPIView(**kwargs)[source]

Retrieve metadata of an investigation with its studies and assays.

This view can be used to e.g. retrieve assay UUIDs for landing zone operations.

URL: /samplesheets/api/investigation/retrieve/{Project.sodar_uuid}

Methods: GET

Returns:

  • archive_name: Original archive name if imported from a zip (string)

  • comments: Investigation comments (dict)

  • description: Investigation description (string)

  • file_name: Investigation file name (string)

  • identifier: Locally unique investigation identifier (string)

  • irods_status: Whether iRODS collections for the investigation have been created (boolean)

  • parser_version: Version of altamISA used in importing (string)

  • project: Project UUID (string)

  • sodar_uuid: Investigation UUID (string)

  • studies: Study and assay information (dict, using study UUID as key)

  • title: Investigation title (string)

class samplesheets.views_api.SheetImportAPIView(**kwargs)[source]

Upload sample sheet as separate ISA-Tab TSV files or a zip archive. Will replace existing sheets if valid.

The request should be in format of multipart/form-data. Content type for each file must be provided.

URL: /samplesheets/api/import/{Project.sodar_uuid}

Methods: POST

Returns:

  • detail: Detail of project success (string)

  • sodar_warnings: SODAR import issue warnings (list of srings, optional)

class samplesheets.views_api.SheetISAExportAPIView(**kwargs)[source]

Export sample sheets as ISA-Tab TSV files, either packed in a zip archive or wrapped in a JSON structure.

URL for zip export: /samplesheets/api/export/zip/{Project.sodar_uuid}

URL for JSON export: /samplesheets/api/export/json/{Project.sodar_uuid}

Methods: GET

iRODS Data Objects and Collections

class samplesheets.views_api.IrodsCollsCreateAPIView(**kwargs)[source]

Create iRODS collections for a project.

URL: /samplesheets/api/irods/collections/create/{Project.sodar_uuid}

Methods: POST

Returns:

  • path: Full iRODS path to the root of created collections (string)

class samplesheets.views_api.SampleDataFileExistsAPIView(**kwargs)[source]

Return status of data object existing in SODAR iRODS by MD5 checksum. Includes all projects in search regardless of user permissions.

URL: /samplesheets/api/file/exists

Methods: GET

Parameters:

  • checksum: MD5 checksum (string)

Returns:

  • detail: String

  • status: Boolean

class samplesheets.views_api.ProjectIrodsFileListAPIView(**kwargs)[source]

Return a list of files in the project sample data repository.

URL: /samplesheets/api/file/list/{Project.sodar_uuid}

Methods: GET

Returns:

  • irods_data: List of iRODS data objects (list of dicts)

iRODS Access Tickets

class samplesheets.views_api.IrodsAccessTicketRetrieveAPIView(**kwargs)[source]

Retrieve an iRODS access ticket for a project.

URL: /samplesheets/api/irods/ticket/retrieve/{IrodsAccessTicket.sodar_uuid}

Methods: GET

Returns

  • path: Full iRODS path (string)

  • label: Text label for ticket (string, optional)

  • ticket: Ticket string for accessing the path (string)

  • assay: Assay UUID (string)

  • study: Study UUID (string)

  • date_created: Creation datetime (YYYY-MM-DDThh:mm:ssZ)

  • date_expires: Expiry datetime (YYYY-MM-DDThh:mm:ssZ or null)

  • user: User who created the request (SODARUserSerializer dict)

  • is_active: Whether the request is currently active (boolean)

  • sodar_uuid: IrodsAccessTicket UUID (string)

class samplesheets.views_api.IrodsAccessTicketListAPIView(**kwargs)[source]

List iRODS access tickets for a project.

URL: /samplesheets/api/irods/ticket/list/{Project.sodar_uuid}

Methods: GET

Query parameters:

  • active (boolean, optional, default=false)

Returns: List of ticket dicts, see IrodsAccessTicketRetrieveAPIView

class samplesheets.views_api.IrodsAccessTicketCreateAPIView(**kwargs)[source]

Create an iRODS access ticket for a project.

URL: /samplesheets/api/irods/ticket/create/{Project.sodar_uuid}

Methods: POST

Parameters:

  • path: Full iRODS path (string)

  • label: Text label for ticket (string, optional)

  • date_expires: Expiration date (YYYY-MM-DDThh:mm:ssZ, optional)

Returns: Ticket dict, see IrodsAccessTicketRetrieveAPIView

class samplesheets.views_api.IrodsAccessTicketUpdateAPIView(**kwargs)[source]

Update an iRODS access ticket for a project.

URL: /samplesheets/api/irods/ticket/update/{IrodsAccessTicket.sodar_uuid}

Methods: PUT, PATCH

Parameters:

  • label: Label (string)

  • date_expires: Expiration date (YYYY-MM-DDThh:mm:ssZ, optional)

Returns: Ticket dict, see IrodsAccessTicketRetrieveAPIView

class samplesheets.views_api.IrodsAccessTicketDestroyAPIView(**kwargs)[source]

Delete an iRODS access ticket.

URL: /samplesheets/api/irods/ticket/delete/{IrodsAccessTicket.sodar_uuid}

Methods: DELETE

iRODS Data Requests

class samplesheets.views_api.IrodsDataRequestRetrieveAPIView(**kwargs)[source]

Retrieve a iRODS data request.

URL: /samplesheets/api/irods/request/retrieve/{IrodsDataRequest.sodar_uuid}

Methods: GET

Returns:

  • project: Project UUID (string)

  • action: Request action (string)

  • path: iRODS path to object or collection (string)

  • target_path: Target path (string, currently unused)

  • user: User initiating request (dict)

  • status: Request status (string)

  • status_info: Request status info (string)

  • description: Request description (string)

  • date_created: Request creation date (datetime)

  • sodar_uuid: Request UUID (string)

class samplesheets.views_api.IrodsDataRequestListAPIView(**kwargs)[source]

List the iRODS data requests for a project.

If the requesting user is an owner, delegate or superuser, the view lists all requests with the status of ACTIVE or FAILED. If called as a contributor, returns the user’s own requests regardless of the state.

URL: /samplesheets/api/irods/requests/{Project.sodar_uuid}

Methods: GET

Returns: List of iRODS data requests (list of dicts)

class samplesheets.views_api.IrodsDataRequestCreateAPIView[source]

Create an iRODS delete request for a project.

The request must point to a collection or data object within the sample data repository of the project. The user making the request must have the role of contributor or above in the project.

URL: /samplesheets/api/irods/request/create/{Project.sodar_uuid}

Methods: POST

Parameters:

  • path: iRODS path to object or collection (string)

  • description: Request description (string, optional)

class samplesheets.views_api.IrodsDataRequestUpdateAPIView[source]

Update an iRODS data request for a project.

URL: /samplesheets/api/irods/request/update/{IrodsDataRequest.sodar_uuid}

Methods: PUT, PATCH

Parameters:

  • path: iRODS path to object or collection (string)

  • description: Request description

class samplesheets.views_api.IrodsDataRequestDestroyAPIView[source]

Delete an iRODS data request object.

This action only deletes the request object and is equvalent to cencelling the request. No associated iRODS collections or data objects will be deleted.

URL: /samplesheets/api/irods/request/delete/{IrodsDataRequest.sodar_uuid}

Methods: DELETE

class samplesheets.views_api.IrodsDataRequestAcceptAPIView[source]

Accept an iRODS data request for a project.

Accepting will delete the iRODS collection or data object targeted by the request. This action can not be undone.

URL: /samplesheets/api/irods/request/accept/{IrodsDataRequest.sodar_uuid}

Methods: POST

class samplesheets.views_api.IrodsDataRequestRejectAPIView[source]

Reject an iRODS data request for a project.

This action will set the request status as rejected and keep the targeted iRODS collection or data object intact.

URL: /samplesheets/api/irods/request/reject/{IrodsDataRequest.sodar_uuid}

Methods: POST

Versioning

For accept header versioning, the following header is expected in the current SODAR version:

Accept: application/vnd.bihealth.sodar+json; version=0.14.2