2.2. Utility Functions

These functions provide shorthand functional interfaces for actions such as getting a DXDataObject handler from an ID or link, or creating a link from a handler. In addition, there are functions for performing simple actions with an ID or link as input without creating a full object handler.

Parameters:
  • object_id (string or DXDataObject) – Object ID or the object handler itself
  • project_id (string) – A project ID, if creating a cross-project DXLink

Creates a DXLink (a dict formatted as a symbolic DNAnexus object reference) to the specified object. Returns object_id if it appears to be a DXLink already.

Parameters:x – A potential DNAnexus link

Returns whether x appears to be a DNAnexus link (is a dict with key "$dnanexus_link") with a referenced data object.

Parameters:link (dict) – A DNAnexus link
Returns:Object ID, Project ID (or None if no project specified in the link)
Return type:tuple

Returns the object and project IDs stored in the given DNAnexus link.

dxpy.bindings.dxdataobject_functions.get_handler(id_or_link, project=None)[source]
Parameters:
  • id_or_link (string or dict) – String containing an object ID or dict containing a DXLink
  • project (string) – String project ID to use as the context if the the object is a data object
Return type:

DXObject

Parses a string or DXLink dict. Creates and returns an object handler for it.

Example:

get_handler("file-1234")
dxpy.bindings.dxdataobject_functions.describe(id_or_link, **kwargs)[source]
Parameters:id_or_link – String containing an object ID or dict containing a DXLink, or a list of object ID’s or dict’s containing a DXLink.

Given an object ID, calls describe() on the object.

Example:

describe("file-1234")
dxpy.bindings.dxdataobject_functions.get_details(id_or_link, **kwargs)[source]
Parameters:id_or_link – String containing an object ID or dict containing a DXLink

Given an object ID, calls get_details() on the object.

Example:

get_details("file-1234")
dxpy.bindings.dxdataobject_functions.remove(id_or_link, **kwargs)[source]
Parameters:id_or_link – String containing an object ID or dict containing a DXLink

Given an object ID, calls remove() on the object.

Example:

remove("file-1234")

Previous topic

2.1. dxpy Object Handlers

Next topic

2.3. Projects and Containers

This Page