Python client to SMRT Link Services and Service Data Models
- class
pbcommand.services.
ServiceAccessLayer
(base_url, port, debug=False, sleep_time=2)[source]¶Bases:
object
General Client Access Layer for interfacing with the job types on SMRT Link Analysis Services
Parameters:
- base_url – base url of the SL Server (e.g, smrtlink-alpha, or http://smrtlink-alpha)
- port – port of the SL server
- debug – set improved debugging output on Services request failures
- sleep_time – sleep time (in seconds) between polling for job status
JOB_DEFAULT_TIMEOUT
= 1800¶
ROOT_DS
= '/secondary-analysis/datasets'¶
ROOT_JM
= '/secondary-analysis/job-manager'¶
ROOT_JOBS
= '/secondary-analysis/job-manager/jobs'¶
ROOT_PT
= '/secondary-analysis/resolved-pipeline-templates'¶
create_by_pipeline_template_id
(name, pipeline_template_id, epoints, task_options=())[source]¶Creates and runs a pbsmrtpipe pipeline by pipeline template id
get_analysis_job_by_id
(job_id)[source]¶Get an Analysis job by id or UUID or return None
Return type: ServiceJob
get_analysis_job_reports
(job_id)[source]¶Get list of DataStore ReportFile types output from (pbsmrtpipe) analysis job
get_analysis_job_tasks
(job_id_or_uuid)[source]¶Get all the Task associated with a Job by UUID or Int Id
get_dataset_by_id
(dataset_type, int_or_uuid)[source]¶Get a Dataset using the DataSetMetaType and (int|uuid) of the dataset
get_dataset_by_uuid
(int_or_uuid, ignore_errors=False)[source]¶The recommend model is to look up DataSet type by explicit MetaType
Returns None if the dataset was not found
get_import_dataset_job_datastore
(job_id)[source]¶Get a List of Service DataStore files from an import DataSet job
import_fasta
(fasta_path, name, organism, ploidy)[source]¶Convert fasta file to a ReferenceSet and Import. Returns a Job
log_progress_update
(job_type_id, job_id, message, level, source_id)[source]¶This is the generic job logging mechanism
run_by_pipeline_template_id
(name, pipeline_template_id, epoints, task_options=(), time_out=1800)[source]¶Blocks and runs a job with a timeout
run_import_fasta
(fasta_path, name, organism, ploidy, time_out=1800)[source]¶Import a Reference into a Block
run_import_local_dataset
(path)[source]¶Import a file from FS that is local to where the services are running
Returns a JobResult instance
Return type: JobResult
to_summary
()[source]¶Returns a summary of System status, DataSets, and Jobs in the system
Return type: str
uri
¶
- class
pbcommand.services.
ServiceJob
(ix, job_uuid, name, state, path, job_type, created_at, settings, is_active=True, smrtlink_version=None, created_by=None, updated_at=None, error_message=None)[source]¶Bases:
object
Parameters:
- ix (int) – Job Integer Id
- job_uuid (str) – Globally unique Job UUID
- name (str) – Display name of job
- state (str) – Job State
- path – Absolute Path to the job directory
- job_type (str) – Job Type
- created_at (DateTime) – when the job was created at
- settings (dict) – dict of job specific settings
- is_active (bool) – If the Job is active (only active jobs are displayed in the SL UI)
- smrtlink_version (str | None) – SMRT Link Version (if known)
- created_by (str | None) – User that created the job
- updated_at (DateTime | None) – when the last update of the job occurred
- error_message (str | None) – Error message if the job has failed
- class
pbcommand.services.
JobTypes
[source]¶Bases:
object
SMRT Link Analysis JOb Types
CONVERT_FASTA
= 'convert-fasta-reference'¶
IMPORT_DS
= 'import-dataset'¶
IMPORT_DSTORE
= 'import-datastore'¶
MERGE_DS
= 'merge-datasets'¶
MOCK_PB_PIPE
= 'mock-pbsmrtpipe'¶
PB_PIPE
= 'pbsmrtpipe'¶
- class
pbcommand.services.
JobStates
[source]¶Bases:
object
Allowed SMRT Link Service Job states
ALL
= ('RUNNING', 'CREATED', 'FAILED', 'SUCCESSFUL', 'SUBMITTED')¶
ALL_COMPLETED
= ('FAILED', 'SUCCESSFUL')¶
CREATED
= 'CREATED'¶
FAILED
= 'FAILED'¶
RUNNING
= 'RUNNING'¶
SUBMITTED
= 'SUBMITTED'¶
SUCCESSFUL
= 'SUCCESSFUL'¶