[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
![Build Status - GitHub](https://github.com/Clinical-Genomics/crunchy/workflows/Build/badge.svg)
[![codecov](https://codecov.io/gh/Clinical-Genomics/crunchy/branch/master/graph/badge.svg)](https://codecov.io/gh/Clinical-Genomics/crunchy)
[![CodeFactor](https://www.codefactor.io/repository/github/clinical-genomics/crunchy/badge)](https://www.codefactor.io/repository/github/clinical-genomics/crunchy)
# Crunchy
A python wrapper around [spring][spring] and cram (samtools) to compress fastq to spring and bam to cram. When compressing fastqs to spring an integrity check can be performed by using flag: `crunchy compress spring --spring-path <springfile> --first <read_1.fastq> --second <read_2.fastq> --check-integrity`
## Install
### Pip
```
pip install crunchy
```
### Docker
This will install crunchy as well as samtools and spring within the container.
```
docker pull clinicalgenomics/crunchy:0.5
```
Run crunchy using:
```
docker run clinicalgenomics/crunchy:0.5 crunchy
```
### Developers
```
git clone https://github.com/Clinical-Genomics/crunchy
pip install -e .
crunchy --help
Usage: crunchy [OPTIONS] COMMAND [ARGS]...
Base command for crunchy
.---. .---.
: : o : me want cookie!
_..-: o : :-.._ /
.-'' ' `---' `---' " ``-.
.' " ' " . " . ' " `.
: '.---.,,.,...,.,.,.,..---. ' ;
`. " `. .' " .'
`. '`. .' ' .'
`. `-._ _.-' " .' .----.
`. " '"--...--"' . ' .' .' o `.
.'`-._' " . " _.-'`. : o :
.' ```--.....--''' ' `:_ o :
.' " ' " " ; `.;";";";'
; ' " ' . ; .' ; ; ;
; ' ' ' " .' .-'
' " " ' " " _.-'
Options:
--spring-binary TEXT Path to spring binary [default: spring]
--samtools-binary TEXT Path to spring binary [default: samtools]
-t, --threads INTEGER Number of threads to use for spring
compression [default: 8]
-r, --reference TEXT Path to reference genome
--log-level [DEBUG|INFO|WARNING]
Choose what log messages to show
--tmp-dir TEXT If specific temp dir should be used
--help Show this message and exit.
Commands:
auto Run whole pipeline by compressing, comparing and deleting...
compare Compare two files by generating checksums.
compress Compress genomic files
decompress Decompress genomic files
```
## Workflow
Each command can be run separately. To compress all fastq pairs below a directory run `crunchy auto spring <path_to_dir>`.
1. **Recursively find all fastq pairs**
1. **Compress all pairs with spring**
```file_1.fastq + file_2.fastq (spring)-> file.spring```
1. **Decompress with spring**
```file.spring (spring)-> file_1.spring.fastq + file_2.spring.fastq```
1. **Compare checksum with previous**
```file_1.spring.fastq + file_1.fastq (hashlib)-> compare```
1. **Delete fastq** (If the compression was lossless)
```file_1.fastq + file_2.fastq (rm)->```
[spring]: https://github.com/shubhamchandak94/Spring
Raw data
{
"_id": null,
"home_page": "https://github.com/Clinical-Genomics/crunchy",
"name": "crunchy",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.9.0",
"maintainer_email": "",
"keywords": "vcf,compression",
"author": "Mans Magnusson",
"author_email": "henrik.stranneheim@scilifelab.com",
"download_url": "https://files.pythonhosted.org/packages/86/10/fb83a4aa754bf5617cf7ec17308290cc2f6bf7c690ab02d164c52bee81eb/crunchy-1.0.3.tar.gz",
"platform": null,
"description": "\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n![Build Status - GitHub](https://github.com/Clinical-Genomics/crunchy/workflows/Build/badge.svg)\n[![codecov](https://codecov.io/gh/Clinical-Genomics/crunchy/branch/master/graph/badge.svg)](https://codecov.io/gh/Clinical-Genomics/crunchy)\n[![CodeFactor](https://www.codefactor.io/repository/github/clinical-genomics/crunchy/badge)](https://www.codefactor.io/repository/github/clinical-genomics/crunchy)\n\n# Crunchy\n\nA python wrapper around [spring][spring] and cram (samtools) to compress fastq to spring and bam to cram. When compressing fastqs to spring an integrity check can be performed by using flag: `crunchy compress spring --spring-path <springfile> --first <read_1.fastq> --second <read_2.fastq> --check-integrity`\n\n## Install\n\n### Pip\n```\npip install crunchy\n```\n\n### Docker\nThis will install crunchy as well as samtools and spring within the container.\n```\ndocker pull clinicalgenomics/crunchy:0.5\n```\nRun crunchy using:\n```\ndocker run clinicalgenomics/crunchy:0.5 crunchy\n```\n\n### Developers\n```\ngit clone https://github.com/Clinical-Genomics/crunchy\npip install -e .\ncrunchy --help\nUsage: crunchy [OPTIONS] COMMAND [ARGS]...\n\n Base command for crunchy\n\n .---. .---.\n : : o : me want cookie!\n _..-: o : :-.._ /\n .-'' ' `---' `---' \" ``-.\n .' \" ' \" . \" . ' \" `.\n : '.---.,,.,...,.,.,.,..---. ' ;\n `. \" `. .' \" .'\n `. '`. .' ' .'\n `. `-._ _.-' \" .' .----.\n `. \" '\"--...--\"' . ' .' .' o `.\n .'`-._' \" . \" _.-'`. : o :\n .' ```--.....--''' ' `:_ o :\n .' \" ' \" \" ; `.;\";\";\";'\n ; ' \" ' . ; .' ; ; ;\n ; ' ' ' \" .' .-'\n ' \" \" ' \" \" _.-'\n\nOptions:\n --spring-binary TEXT Path to spring binary [default: spring]\n --samtools-binary TEXT Path to spring binary [default: samtools]\n -t, --threads INTEGER Number of threads to use for spring\n compression [default: 8]\n -r, --reference TEXT Path to reference genome\n --log-level [DEBUG|INFO|WARNING]\n Choose what log messages to show\n --tmp-dir TEXT If specific temp dir should be used\n --help Show this message and exit.\n\nCommands:\n auto Run whole pipeline by compressing, comparing and deleting...\n compare Compare two files by generating checksums.\n compress Compress genomic files\n decompress Decompress genomic files\n```\n\n## Workflow\n\nEach command can be run separately. To compress all fastq pairs below a directory run `crunchy auto spring <path_to_dir>`.\n\n1. **Recursively find all fastq pairs**\n\n1. **Compress all pairs with spring**\n```file_1.fastq + file_2.fastq (spring)-> file.spring```\n\n1. **Decompress with spring**\n```file.spring (spring)-> file_1.spring.fastq + file_2.spring.fastq```\n\n1. **Compare checksum with previous**\n```file_1.spring.fastq + file_1.fastq (hashlib)-> compare```\n\n1. **Delete fastq** (If the compression was lossless)\n```file_1.fastq + file_2.fastq (rm)->```\n\n[spring]: https://github.com/shubhamchandak94/Spring\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Compress fastq with spring",
"version": "1.0.3",
"split_keywords": [
"vcf",
"compression"
],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "8750cc42043550c46cb1387c89d09146",
"sha256": "d2c44ad086a69a900b9a9e14dff4a3591b14806c123a966d2777b3591ad83bd5"
},
"downloads": -1,
"filename": "crunchy-1.0.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8750cc42043550c46cb1387c89d09146",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9.0",
"size": 18174,
"upload_time": "2022-12-12T10:54:47",
"upload_time_iso_8601": "2022-12-12T10:54:47.994877Z",
"url": "https://files.pythonhosted.org/packages/ec/df/75dd0388fa3d943fd6a360b0fb9df05ebb23a90ac31d0f8b16b24fb95e53/crunchy-1.0.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "cb0b0446921fa108c563de4fcdf5a5d9",
"sha256": "8c6abbf4df72485260f7fda6192c818d3895c8fe055fa63676bf3b95c2e6f3e7"
},
"downloads": -1,
"filename": "crunchy-1.0.3.tar.gz",
"has_sig": false,
"md5_digest": "cb0b0446921fa108c563de4fcdf5a5d9",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9.0",
"size": 15280,
"upload_time": "2022-12-12T10:54:49",
"upload_time_iso_8601": "2022-12-12T10:54:49.638873Z",
"url": "https://files.pythonhosted.org/packages/86/10/fb83a4aa754bf5617cf7ec17308290cc2f6bf7c690ab02d164c52bee81eb/crunchy-1.0.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-12-12 10:54:49",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "Clinical-Genomics",
"github_project": "crunchy",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"requirements": [
{
"name": "click",
"specs": [
[
"==",
"8.1.3"
]
]
},
{
"name": "coloredlogs",
"specs": [
[
"==",
"15.0.1"
]
]
},
{
"name": null,
"specs": []
},
{
"name": "humanfriendly",
"specs": [
[
"==",
"10.0"
]
]
},
{
"name": "importlib-metadata",
"specs": [
[
"==",
"5.0.0"
]
]
},
{
"name": "zipp",
"specs": [
[
"==",
"3.9.0"
]
]
}
],
"lcname": "crunchy"
}