Skip to main content

Allows management of tool and workflow version in database and json

Project description

Workflow Tool Manager

Workflow Tool Manager is a python package to create a json file during a bioinformatic workflow (e.g. written in nextflow) to track the software tools, versions, parameters and database by incrementally adding new entries in each process.

Installation

Installable via pip:

pip install bio_tool_version_manager

Usage

CLI

  1. Incrementally add new tools to the "workflowfile":
bio_tool_version_manager add -h
usage: bio_tool_version_manager add [-h] [-n WORKFLOW_NAME] [--wf_version WF_VERSION] [-t TOOL_NAME]
                                    [--tool_version TOOL_VERSION] [-p TOOL_PARAMETER] [-f JSON_FILE]
                                    [--db_name DB_NAME] [--db_version DB_VERSION]

options:
  -h, --help            show this help message and exit
  -n WORKFLOW_NAME
  --wf_version WF_VERSION
                        workflow version
  -t TOOL_NAME
  --tool_version TOOL_VERSION
  -p TOOL_PARAMETER
  -f, --file JSON_FILE  Path to input JSON file
  --db_name DB_NAME
  --db_version DB_VERSION

  1. Insert into a database (requires sqlalchemy, sqlite or mariadb-database):
bio_tool_version_manager insert -h
usage: bio_tool_version_manager insert [-h] -f JSON_FILE --pid PROCESS_ID [-d DATABASE] [-H HOSTNAME] [-u DBUSER] [--finish]
                                       [-p MARIADBPASSWORD]

options:
  -h, --help            show this help message and exit
  -f, --file JSON_FILE  Path to input JSON file
  --finish              set process status to finished and finished_at timestamp
  --pid PROCESS_ID      Process ID to store
  -d, --database DATABASE
                        mysql database name or path to sqlite-db [./agres.db]
  -H, --hostname HOSTNAME
                        mysql hostname; if not provided sqlite-db will be used
  -u, --user DBUSER     mysql database username
  -p, --password MARIADBPASSWORD
                        mysql password
  1. Dump versions/workflow from database for specified process:
bio_tool_version_manager dump -h
usage: bio_tool_version_manager dump [-h] --pid PROCESS_ID [-f JSON_FILE] [-d DATABASE] [-H HOSTNAME] [-u DBUSER] [-p MARIADBPASSWORD]

options:
  -h, --help            show this help message and exit
  --pid PROCESS_ID      Process ID to create JSON from
  -f, --file JSON_FILE  Path to output JSON file
  -d, --database DATABASE
                        mysql database name or path to sqlite-db [./agres.db]
  -H, --hostname HOSTNAME
                        mysql hostname; if not provided sqlite-db will be used
  -u, --user DBUSER     mysql database username
  -p, --password MARIADBPASSWORD
                        mysql password

Python-API

The the package can also be imported and used within python:

from workflow_tool_manager.insert import get_or_create_tool, get_or_create_workflow
from sqlalchemy.orm import sessionmaker


# Create session to your engine (assume you already have a db connection as sqlalchemy-engine)
Session = sessionmaker(bind=engine)  
session = Session()  

tool1_dict = {
  'name':'blastn', 
  'version':'2.10.1', 
  'parameter':'-evalue 0.01',
  'database': {
    'name': 'mynt',
    'version': '0.1a',
  },
}

tool2_dict = {
  'name':'Tool2', 
  'version':'2.0', 
  'parameter':'--fast',
}

tool1 = get_or_create_tool(session, tool1_dict)  
tool2 = get_or_create_tool(session, tool2_dict)  
workflow = get_or_create_workflow(session, name='myworkflow', version='1.0', tools=[tool1, tool2])  

License

This project is licensed under MIT license

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bio_tool_version_manager-1.2.0.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bio_tool_version_manager-1.2.0-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file bio_tool_version_manager-1.2.0.tar.gz.

File metadata

  • Download URL: bio_tool_version_manager-1.2.0.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.0

File hashes

Hashes for bio_tool_version_manager-1.2.0.tar.gz
Algorithm Hash digest
SHA256 7d0f4b120ff2d0d9598f52e27ab13ce53f03e84ae9f6b33d0b6b5114f11fa53e
MD5 e4e655ce4d10168350c662eeaa6973ee
BLAKE2b-256 1ca734d6e73e8fe853685c3bdf0bc941a4dfb57eafda445176365d091e6218fb

See more details on using hashes here.

File details

Details for the file bio_tool_version_manager-1.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for bio_tool_version_manager-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e90c43229844e9b55fad93b42ba85287161027a71b4879f3107fc70d3d0cb80e
MD5 4a754377f5461b2c4971d67214064902
BLAKE2b-256 e64b2adcf3a547786a93289d5fa3f65d657bf43dccc1ac947f559fb0f254740d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page