A set of variant file helper utilities built on top of bcftools and htslib.
Project description
bcf_extras
Extra variant file helper utilities built on top of bcftools
and htslib
.
License
bcf_extras
is licensed under GPLv3. See the license for more
information.
Dependencies
The package requires that bcftools
and htslib
are installed on your
operating system.
What's Included
copy-compress-index
Creates a .vcf.gz
with a corresponding tabix index from a VCF, sorting the
VCF if necessary.
For example, the following would generate sample-1.vcf.gz
and sample-1.vcf.gz.tbi
:
bcf-extras copy-compress-index sample-1.vcf
add-header-lines
Adds header lines from a text file to a particular position in the VCF header.
Useful for e.g. inserting missing ##contig
lines to a bunch of VCFs at once
(taking advantage of this + something like GNU parallel.)
For the ##contig
lines example, inserting the contents of
tests/vcfs/new_lines.txt
, we could run the
following command on [tests/vcfs/ahl.vcf
](tests/vcfs/ahl.vcf, replacing the
file with a new copy:
bcf-extras add-header-lines tests/vcfs/ahl.vcf tests/vcfs/new_lines.txt --delete-existing
There is also a flag, --tmp-dir
, for specifying a temporary folder location
into which header artifacts will be placed. This is especially useful when
running jobs on clusters, which may have specific locations for temporary I/O.
Using GNU parallel, we can do multiple VCFs at once, e.g.:
parallel 'bcf-extras add-header-lines {} tests/vcfs/new_lines.txt --delete-existing' ::: /path/to/my/vcfs/*.vcf
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 bcf_extras-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e71cdc1e2a058f9fc191ecbb839a259179935c76fe6c25e986191fb48a210081 |
|
MD5 | 5ab084b9a10beacbe359da873fe42554 |
|
BLAKE2b-256 | 9c7b9e48aff51722e39855c6a089601c6605787bc28ab1570f5793dd304c1427 |