Crimson
Crimson converts non-standard bioinformatics tool outputs to JSON or YAML.
Currently it can convert outputs of the following tools:
- FastQC (
fastqc) - FusionCatcher (
fusioncatcher) - samtools flagstat (
flagstat) - Picard metrics tools (
picard) - STAR log file (
star) - STAR-Fusion hits table (
star-fusion) - Variant Effect Predictor
plain text output (
vep)
For each conversion, there are two execution options: as command line tool or as a Python
library function. The first alternative uses crimson as a command-line tool. The second one
requires importing the crimson library in your program.
Installation
Crimson is available on the Python Package Index
and you can install it via pip:
$ pip install crimson
It is also available on
BioConda, both through the
conda package manager or as a
Docker container.
For Docker execution, you may also use the GitHub Docker registry. This registry hosts the latest version, but does not host versions 1.1.0 or earlier.
docker pull ghcr.io/bow/crimson
Usage
As a command line tool
The general command is crimson {tool_name}. By default, the output is written to
stdout. For example, to use the picard parser, you would execute:
$ crimson picard /path/to/a/picard.metrics
You can also write the output to a file by specifying a file name. The following
command writes the output to a file named converted.json:
$ crimson picard /path/to/a/picard.metrics converted.json
Some parsers may accept additional input formats. The FastQC parser, for example, also accepts a path to a FastQC output directory as its input:
$ crimson fastqc /path/to/a/fastqc/dir
It also accepts a path to a zipped result:
$ crimson fastqc /path/to/a/fastqc_result.zip
When in doubt, use the --help flag:
$ crimson --help # for the general help
$ crimson fastqc --help # for the parser-specific help, in this case FastQC
As a Python library function
The specific function to import is generally located at crimson.{tool_name}.parser. So to
use the picard parser in your program, you can do:
from crimson import picard
# You can specify the input file name as a string or path-like object...
parsed = picard.parse("/path/to/a/picard.metrics")
# ... or a file handle
with open("/path/to/a/picard.metrics") as src:
parsed = picard.parse(src)
Why?
- Not enough tools use standard output formats.
- Writing and re-writing the same parsers across different scripts is not a productive way to spend the day.
Local Development
Setting up a local development requires that you set up all of the supported Python versions. We use pyenv for this.
# Clone the repository and cd into it.
$ git clone https://github.com/bow/crimson
$ cd crimson
# Create your local development environment. This command also installs
# all supported Python versions using `pyenv`.
$ make env
# Run the test and linter suite to verify the setup.
$ make lint test
# When in doubt, just run `make` without any arguments.
$ make
Contributing
If you are interested, Crimson accepts the following types contribution:
- Documentation updates / tweaks (if anything seems unclear, feel free to open an issue)
- Bug reports
- Support for tools' outputs which can be converted to JSON or YAML
For any of these, feel free to open an issue in the issue tracker or submit a pull request.
License
Crimson is BSD-licensed. Refer to the LICENSE file for the full license.
Metadata
Release files for crimson 1.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| crimson-1.1.1.tar.gz | 20.1 kB | Without provenance | Details for crimson-1.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| crimson-1.1.1-py3-none-any.whl | Python 3 | none | any | Details for crimson-1.1.1-py3-none-any.whl |
Total release size: 43.1 kB
Release files / crimson-1.1.1.tar.gz
| Download URL | crimson-1.1.1.tar.gz |
|---|---|
| Size | 20.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bdc54961dbb29cfd9479c310f382475820e80f7158ebc2a732f756dc72b7978d
|
|
BLAKE2b-256 checksum How to use checksums |
d34c5cae5b14b05e34db95b6438372f83b663afbf175e0e7d8c15332e2a30aaa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.0
|
Release files / crimson-1.1.1-py3-none-any.whl
| Download URL | crimson-1.1.1-py3-none-any.whl |
|---|---|
| Size | 23.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
837db07437d983ada803aef456c76f6c6c792124f8e7fffae413377c1bf4c431
|
|
BLAKE2b-256 checksum How to use checksums |
96925e3a134c20e2ee02ff86ac2bcdfe781172937467e49207f7d73ca62c8800
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.0
|
Security for crimson 1.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.