A package for splitting reads in BAM/FASTQ files into smaller fragments.
Project description
Bamurai
A Python package for splitting reads in BAM/FASTQ files into smaller fragments.
Description
Bamurai is a command-line tool that splits reads in BAM files to a rough target length and outputs a FASTQ file. This is useful for testing the performance of bioinformatics tools on long-reads data at different read lengths.
Currently there are 3 main features of Bamurai:
- Splitting reads in a BAM file to a target length
- Splitting reads in a BAM file to a target number of pieces per read
- Getting statistics from a BAM or FASTQ(.gz) file
The split command splits reads into a target length, each read will be split into fragments as close to the target length as possible. Reads shorter than the target length will not be split.
The divide command splits reads into a target number of pieces, each read will be split into the number of pieces specified. A further minimum length can be specified to ensure that reads are not split if the resultant fragments are less than the minimum length.
The stats command will output the following information by default:
Statistics for input.bam:
Total reads: 8160
Average read length: 30638
Throughput: 250006998
N50: 82547
It can be used with the --tsv argument to output the statistics in a tab-separated format for computational analysis.
file_name total_reads avg_read_len throughput n50
input.bam 8160 30638 250006998 82547
Installation
To install the released version of Bamurai from PyPI
pip install bamurai
To install the latest version of Bamurai from GitHub
pip install git+https://github.com/Shians/Bamurai.git
Usage
To get help on the command-line interface and list available commands
bamurai --help
To get help on a specific command
bamurai <command> --help
Splitting reads to target size
To split a file into 10,000 bp reads
bamurai split input.bam --target-length 10000 --output output.fastq
To create a gzipped output file
bamurai split input.bam --target-length 10000 | gzip > output.fastq.gz
Dividing reads into a target number of pieces
To divide reads into 2 pieces
bamurai divide input.bam --num_fragments 2 --output output.fastq
To divide reads into 2 pieces unless resultant fragments are less than 1000 bp
bamurai divide input.bam --num_fragments 2 --min_length 1000 --output output.fastq
Getting statistics from a BAM or FASTQ file
To get stats from a BAM file
bamurai stats input.bam
To get stats from a FASTQ file or Gzipped FASTQ file
bamurai stats input.fastq
bamurai stats input.fastq.gz
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bamurai-0.3.2.tar.gz.
File metadata
- Download URL: bamurai-0.3.2.tar.gz
- Upload date:
- Size: 11.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eeb03a6b7b2b3535448d8a15785019539153966278617f9aaec7d67e768fe51a
|
|
| MD5 |
a255e636f69ddedd62c0225ea9c35e85
|
|
| BLAKE2b-256 |
3095b4eca9e57039133a7210c4dc697b70fbab523aa1218fc928151c3f2c0810
|
Provenance
The following attestation bundles were made for bamurai-0.3.2.tar.gz:
Publisher:
publish-to-pypi.yml on Shians/Bamurai
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bamurai-0.3.2.tar.gz -
Subject digest:
eeb03a6b7b2b3535448d8a15785019539153966278617f9aaec7d67e768fe51a - Sigstore transparency entry: 170437621
- Sigstore integration time:
-
Permalink:
Shians/Bamurai@196fef71ae3f1343ae52ea136f004ad8e43900cb -
Branch / Tag:
refs/tags/v0.3.2 - Owner: https://github.com/Shians
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@196fef71ae3f1343ae52ea136f004ad8e43900cb -
Trigger Event:
push
-
Statement type:
File details
Details for the file bamurai-0.3.2-py3-none-any.whl.
File metadata
- Download URL: bamurai-0.3.2-py3-none-any.whl
- Upload date:
- Size: 13.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a1570676ee2558d006569afab27bdb06b5863008c16d52a16af75b7141669b5
|
|
| MD5 |
7c5883113015933ca30086142d65c6e2
|
|
| BLAKE2b-256 |
0d60fc939fb76be239ae8d28f69d481f96ab4d5bb39fab8b7af109704543d900
|
Provenance
The following attestation bundles were made for bamurai-0.3.2-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on Shians/Bamurai
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bamurai-0.3.2-py3-none-any.whl -
Subject digest:
4a1570676ee2558d006569afab27bdb06b5863008c16d52a16af75b7141669b5 - Sigstore transparency entry: 170437627
- Sigstore integration time:
-
Permalink:
Shians/Bamurai@196fef71ae3f1343ae52ea136f004ad8e43900cb -
Branch / Tag:
refs/tags/v0.3.2 - Owner: https://github.com/Shians
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@196fef71ae3f1343ae52ea136f004ad8e43900cb -
Trigger Event:
push
-
Statement type: