toil.cwl.utils
¶
Utility functions used for Toil’s CWL interpreter.
Module Contents¶
Functions¶
|
Apply the given operation to all top-level CWL objects with the given named CWL class. |
|
Apply the given operations to all CWL objects with the given named CWL class. |
|
Given a relative path, follow it in the given directory structure. |
|
Download nested dictionary from the Toil file store to a local path. |
Attributes¶
- toil.cwl.utils.logger¶
- toil.cwl.utils.CWL_UNSUPPORTED_REQUIREMENT_EXIT_CODE = 33¶
- exception toil.cwl.utils.CWLUnsupportedException[source]¶
Bases:
digraph inheritanceaba341841e { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "CWLUnsupportedException" [URL="#toil.cwl.utils.CWLUnsupportedException",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Fallback exception."]; }Exception
Fallback exception.
- toil.cwl.utils.CWL_UNSUPPORTED_REQUIREMENT_EXCEPTION: Type[cwltool.errors.UnsupportedRequirement] | Type[CWLUnsupportedException]¶
- toil.cwl.utils.visit_top_cwl_class(rec, classes, op)[source]¶
Apply the given operation to all top-level CWL objects with the given named CWL class.
Like cwltool’s visit_class but doesn’t look inside any object visited.
- Parameters:
rec (Any) –
classes (Iterable[str]) –
op (Callable[[Any], Any]) –
- Return type:
None
- toil.cwl.utils.DownReturnType¶
- toil.cwl.utils.UpReturnType¶
- toil.cwl.utils.visit_cwl_class_and_reduce(rec, classes, op_down, op_up)[source]¶
Apply the given operations to all CWL objects with the given named CWL class.
Applies the down operation top-down, and the up operation bottom-up, and passes the down operation’s result and a list of the up operation results for all child keys (flattening across lists and collapsing nodes of non-matching classes) to the up operation.
- Returns:
The flattened list of up operation results from all calls.
- Parameters:
rec (Any) –
classes (Iterable[str]) –
op_down (Callable[[Any], DownReturnType]) –
op_up (Callable[[Any, DownReturnType, List[UpReturnType]], UpReturnType]) –
- Return type:
List[UpReturnType]
- toil.cwl.utils.DirectoryStructure¶
- toil.cwl.utils.get_from_structure(dir_dict, path)[source]¶
Given a relative path, follow it in the given directory structure.
Return the string URI for files, the directory dict for subdirectories, or None for nonexistent things.
- toil.cwl.utils.download_structure(file_store, index, existing, dir_dict, into_dir)[source]¶
Download nested dictionary from the Toil file store to a local path.
Guaranteed to fill the structure with real files, and not symlinks out of it to elsewhere. File URIs may be toilfile: URIs or any other URI that Toil’s job store system can read.
- Parameters:
file_store (toil.fileStores.abstractFileStore.AbstractFileStore) – The Toil file store to download from.
index (Dict[str, str]) – Maps from downloaded file path back to input URI.
existing (Dict[str, str]) – Maps from file_store_id URI to downloaded file path.
dir_dict (DirectoryStructure) – a dict from string to string (for files) or dict (for
into_dir (str) –
- Return type:
None
subdirectories) describing a directory structure.
- Parameters:
- Return type:
None
into.