Projects (DXProject) are platform entities that serve as general-purpose containers for data, and are the unit of collaboration.
Containers (DXContainer) are special-purpose data containers that support a subset of the methods available to projects. Containers behave like projects with the PROTECTED flag unset (so that temporary intermediate data files can be deleted), except they cannot be explicitly created or destroyed, and their permissions are fixed.
DXProject is implemented as a subclass of DXContainer.
Bases: dxpy.bindings.DXObject
Remote container handler.
Returns: | A hash containing attributes of the project or container. |
---|---|
Return type: | dict |
Returns a hash with key-value pairs as specified by the API specification for the /project-xxxx/describe method. This will usually include keys such as “id”, “name”, “class”, “billTo”, “created”, “modified”, and “dataUsage”.
Parameters: |
|
---|
Creates a new folder in the project or container.
Parameters: |
|
---|---|
Returns: | A hash with key “objects” for the list of object IDs and key “folders” for the list of folder routes |
Return type: | dict |
Returns a hash containing a list of objects that reside directly inside the specified folder, and a list of strings representing the full paths to folders that reside directly inside the specified folder.
By default, the list of objects is provided as a list containing one hash {"id": "class-XXXX"} with the ID of each matching object. If describe is not False, the output of /describe is also included in an additional field “describe” for each object. If describe is True, /describe is called with the default arguments. describe may also be a hash, indicating the input hash to be supplied to each /describe call.
Parameters: |
|
---|
Moves the specified objects and folders into the folder represented by destination. Moving a folder also moves all contained folders and objects. If an object or folder is explicitly specified but also appears inside another specified folder, it will be removed from its parent folder and placed directly in destination.
Parameters: |
|
---|
Moves folder to reside in destination in the same project or container. All objects and subfolders inside folder are also moved.
Parameters: |
|
---|
Removes the specified folder from the project or container. It must be empty to be removed, unless recurse is True.
Removal propagates to any hidden objects that become unreachable from any visible object in the same project or container as a result of this operation. (This can only happen if recurse is True.)
Parameters: |
|
---|
Removes the specified objects from the project or container.
Removal propagates to any hidden objects that become unreachable from any visible object in the same project or container as a result of this operation.
Parameters: |
|
---|
Clones (copies) the specified objects and folders in the container into the folder destination in the container container. Cloning a folder also clones all all folders and objects it contains. If an object or folder is explicitly specified but also appears inside another specified folder, it will be removed from its parent folder and placed directly in destination. No objects or folders are modified in the source container.
Objects must be in the “closed” state to be cloned.
Bases: dxpy.bindings.dxproject.DXContainer
Remote project handler.
Parameters: |
|
---|
Creates a new project. Initially only the user performing this action will be in the permissions/member list, with ADMINISTER access. See the API documentation for the /project/new method for more info.
Parameters: |
|
---|
Updates the project with the new fields. All fields are optional. Fields that are not provided are not changed. See the API documentation for the /project-xxxx/update method for more info.
Parameters: |
|
---|
Invites the specified user to have access to the project.
Parameters: |
|
---|
Decreases the permissions that the specified user has in the project.
Parameters: | properties (dict) – Property names and values given as key-value pairs of strings |
---|
Given key-value pairs in properties for property names and values, the properties are set on the project for the given property names. Any property with a value of None indicates the property will be deleted.
Note
Any existing properties not mentioned in properties are not modified by this method.
Apps have associated resource containers and project cache containers. To easily access these, the following utility functions are provided. These functions are meant to be called only by a job.
Parameters: | kwargs – keyword args for find_one_data_object(), with the exception of “project” |
---|---|
Raises: | DXError if “project” is given, if this is called with dxpy.JOB_ID not set, or if “DX_RESOURCES_ID” or “DX_PROJECT_CONTEXT_ID” is not found in the environment variables |
Returns: | None if no matching object is found; otherwise returns a dxpy object handler for that class of object |
Searches for a data object in the app resources container matching the given keyword arguments. If found, the object will be cloned into the running job’s workspace container, and the handler for it will be returned. If the app resources container ID is not found in DX_RESOURCES_ID, falls back to looking in the current project.
Example:
@dxpy.entry_point('main')
def main(*args, **kwargs):
x = load_app_resource(name="Indexed genome", classname='file')
dxpy.download_dxfile(x)
Parameters: | kwargs – keyword args for find_one_data_object(), with the exception of “project” |
---|---|
Raises: | DXError if “project” is given, if this is called with dxpy.JOB_ID not set, or if “DX_PROJECT_CACHE_ID” is not found in the environment variables |
Returns: | None if no matching object is found; otherwise returns a dxpy object handler for that class of object |
Searches for a data object in the project cache container matching the given keyword arguments. If found, the object will be cloned into the running job’s workspace container, and the handler for it will be returned.
Example:
@dxpy.entry_point('main')
def main(*args, **kwargs):
x = load_from_cache(name="Indexed genome", classname='file')
if x is None:
x = compute_result(*args)
save_to_cache(x)
Parameters: | dxobject – a dxpy object handler for an object to save to the cache |
---|---|
Raises: | DXError if this is called with dxpy.JOB_ID not set, or if “DX_PROJECT_CACHE_ID” is not found in the environment variables |
Clones the given object to the project cache.
Example:
@dxpy.entry_point('main')
def main(*args, **kwargs):
x = load_from_cache(name="Indexed genome", classname='file')
if x is None:
x = compute_result(*args)
save_to_cache(x)