## Tools.pbs.BaseQsub


Usage

``` python
Tools.pbs.BaseQsub(
    job_name, pbs_script=None, base_job_id=None, pbs_working_dir=None
)
```


## Methods

| Name | Description |
|----|----|
| [__init__()](#__init__) | The BaseQsub class is the most basic means to create PBS jobs using qsub. |
| [copy_supplied_script()](#copy_supplied_script) | Copies a supplied script/file using the new script/file name and |
| [get_base_job_name()](#get_base_job_name) | Returns a tuple of the base job id and the job_name. The base |
| [submit_pbs_script()](#submit_pbs_script) | A function to submit the PBS job to the system. |

------------------------------------------------------------------------


#### \_\_init\_\_()


The BaseQsub class is the most basic means to create PBS jobs using qsub.


Usage

``` python
__init__(job_name, pbs_script=None, base_job_id=None, pbs_working_dir=None)
```


It takes a given pbs script and creates a new directory for the pbs job using a randomly generating string of letters/numbers. After the supplied pbs script is copied into the new folder it can be submitted to the system. After submission the PBS job id will be available as a class variable.


##### Parameters


`pbs_script: str. = None`  
The path to the PBS script that will be submitted to the system.

`job_name: str.`  
A job name that will be used for naming the pbs working directory, and for the -N parameter in the PBS script.

`base_job_id: str. = None`  
While usually none, this can be used to re-run a PBS job that was created by this class.

`pbs_working_dir: str. = None`  
The path to the PBS working directory where the scripts will be copied to and where the job will be started and run by the PBS system.


------------------------------------------------------------------------


#### copy_supplied_script()


Copies a supplied script/file using the new script/file name and


Usage

``` python
copy_supplied_script(supplied_script, new_script)
```


location unless the supplied script doesn't exist.


##### Parameters


`supplied_script: str.`  
The script to be copied.

`new_script: str.`  
The path (/) to copy the supplied script to.


------------------------------------------------------------------------


#### get_base_job_name()


Returns a tuple of the base job id and the job_name. The base


Usage

``` python
get_base_job_name(length=5)
```


job id can be of any length.


##### Parameters


`length: int. = ``5`  
The number of characters used in the base job id.


------------------------------------------------------------------------


#### submit_pbs_script()


A function to submit the PBS job to the system.


Usage

``` python
submit_pbs_script(cmd=None, **kwargs)
```


##### Parameters


`cmd: list | str. = None`  
A command list/string used qsub system call.

`kwargs: dict. = {}`  
Keyword arguments used in subprocess.Popen.
