A suite of convenience tools for working with sequencing files and Code Ocean capsules
Project description
Code Ocean Aux Tools
Convenience tools for working in Code Ocean capsules and pipelines.
Background
These convenience tools were created to make working with working with sequencing files more streamlined. Some of the tools in this package are only useful in the Code Ocean platform but many of these tools will be useful outside of the platform.
Requirements
Python>=3.8
Installing Code Ocean Aux Tools in your capsule
Add one line of code to your postintall script. At a later time this will be a package you can add to pip in the environment UI.
pip install -i https://test.pypi.org/simple/ Code-Ocean-Aux-Tools
List of Available Commands
The following commands will work at the terminal or in a bash script
- get_cpu_count
- get_dir_contents
- get_fasta_file
- get_fastq_pair
- get_fwd_fastqs
- get_groups
- get_pipeline_confirm
- get_read_direction
- get_read_pattern
- get_read_prefix
- get_rev_file
- set_log_msg
List of Available Python Functions
There are 2 modules you can import (co_utils
& co_fastq
)
At the top of your python script, import them
from co_tools import co_utils
from co_tools import co_fastq
co_utils
- get_cpu_limit()
- get_dir_contents()
- get_groups()
- is_pipeline()
co_fastq
- get_fastq_pair()
- get_fwd_fastqs()
- get_read_direction()
- get_read_pattern()
- get_prefix()
- get_rev_file()
Logging
There is a pre-configured logger that will work seamlessly in bash and/or python and output to the same log file. The format for each log entry is:
[{Date} {Time} - {log name} - {filename}:{lineno} - {Log Level}] {log message}
The available log levels are debug
, info
, warning
, error
, and critical
Python
To use the logger in a python script just import it and use it
from co_tools.get_logger import LOGGER
To use it just type LOGGER.{log level}("your log message here")
where {log level}
is your desired log level.
e.g. LOGGER.info("logging is fun")
Bash
To use the logger in a bash script, just use the set_log_msg
command. It takes 1 required argument and an additional optional argument.
The required argument is the log message and the optional argument is for the desired log level.
e.g. set_log_msg "logging is fun" "INFO"
Setting the log level for LOGGER
Create an environment variable called CO_LOG_LEVEL
and assign it one of the 5 available log levels. The default value is WARNING
. Ideally you will assign the value to CO_LOG_LEVEL
in your runscript just before the entry script is executed.
e.g.
export CO_LOG_LEVEL="INFO"
python -u main.py "$@"
or
export CO_LOG_LEVEL="INFO"
bash main.sh "$@"
Code Ocean is a cloud-based computational platform that aims to make it easy for researchers to share, discover, and run code. Visit our Open Science Library for free code and to demo our free product. Contact our sales for a demo of our enterprise VPC product.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for code_ocean_aux_tools-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f599c65c75a041671f5aa6963207455b343ec10e9dd89a572663e686b02e45f4 |
|
MD5 | 1f1dae2595d4bf493ac7cfc78e049230 |
|
BLAKE2b-256 | 64cda244ad01067f54d6c14fcfc1f74c2e08b1eb97681b3ab3bc731b349eab91 |
Hashes for code_ocean_aux_tools-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d94cc05d3b12be7ab4a68edbd5306cba214f8b56b7645dc54b26ccae4db5936 |
|
MD5 | f2b6d6762b585c2c0715eb5098d56c8a |
|
BLAKE2b-256 | 55d0702451a456b635f451f4a72cd3f7ba967a210c644422bd1504a47b1d31b5 |