micone.pipelines package

Submodules

micone.pipelines.command module

Module that handles the execution of subprocesses and parsing of their outputs

class micone.pipelines.command.Command(cmd: str, profile: str, timeout: int = 1000, **kwargs)[source]

Bases: object

Class that wraps functionality for running subprocesses and jobs on the cluster

Parameters:
  • cmd (str) – The command to be executed

  • profile ({'local', 'sge'}) – The execution environment

  • timeout (int, optional) – The time limit for the command If a process exceeds this time then it will be terminated Default is 1000

  • project (str, optional) – The project under which to run the pipeline on the ‘sge’ Default value is None

profile

The execution environment

Type:

{‘local’, ‘sge’}

project

The project under which to run the pipeline on the ‘sge’

Type:

str

property cmd: str

The command that will be executed

property error: str

Returns the error generated during execution of the command

log() None[source]

Logs the stdout and stderr of the command execution to the log_file

property output: str

Returns the output generated during execution of the command

proc_cmd_sync() bool[source]

Check whether the Command instance and subprocess.Popen process are in sync

Returns:

True if both the cmd and process are the same

Return type:

bool

process: Optional[Popen] = None
run(cwd: Optional[str] = None) Popen[source]

Executes the command with the correct profile and resources

Parameters:

cwd (str, optional) – The directory in which the command is to be run Default is None which uses the current working directory

Returns:

The exit status of the command

Return type:

int

property status: str

Return the status of the command execution

Returns:

One of {‘success’, ‘failure’, ‘in progress’, ‘not started’}

Return type:

str

update(cmd: str) None[source]

Update the cmd of the current Command instance

Parameters:

cmd (str) – The new command to be executed

wait() None[source]

Wait for the process to complete or terminate

Module contents