Skip to main content

Lightly modified versions of htslib and bcftools.

Project description

xsamtools

xsamtools makes the samtools tooling from htslib and bcftools available through pypi packaging. These tools have been lightly modified to allow merges on VCF streams without an index.

Installation

pip install xsamtools

Installation requires a C toolchain. Typically Ubuntu/Debian systems should have the following packages installed:

  • libbz2-dev
  • liblzma-dev
  • libcurl4-openssl-dev

libcurl4-openssl-dev may be omitted at the cost of some cloud support features in htslib.

Usage

After succesful installation, the following executables are available:

samtools:

  • htsfile
  • bgzip
  • tabix
  • bcftools

xsamtools:

  • merge_vcfs.py

xsamtools also provides Python tooling to create named (FIFO) pipes to Google Storage objects:

from xsamtools import pipes

reader = pipes.BlobReaderProcess("bucket-name", "read-key")
print("reader path", reader.filepath)  # local FIFO filepath

writer_key = pipes.BlobWriterProcess("bucket-name", "writ-key")
print("writer path", writer.filepath)  # local FIFO filepath

These streams appear as either readable or writable files on the filesystem. Such objects are not seekable.

A utility method is also provided to merge VCFs from GS objects:

from xsamtools import vcf

vcf.combine("src-bucket-name", ["first-src-vcf-key", "second-src-vcf-key"], "dst-bucket-name", "dst-vcf-key")

There is no formal limit on the number of VCF keys. Care should be taken that the VCF objects provided are aligned by chromosome or the merge will fail.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xsamtools-0.3.0.tar.gz (3.8 MB view details)

Uploaded Source

File details

Details for the file xsamtools-0.3.0.tar.gz.

File metadata

  • Download URL: xsamtools-0.3.0.tar.gz
  • Upload date:
  • Size: 3.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.5

File hashes

Hashes for xsamtools-0.3.0.tar.gz
Algorithm Hash digest
SHA256 383c60ffc4b9c2128a76b9939e6168076eb94fc84ab2823d3a9b2e28749d3f0f
MD5 4cb6f6fdbe5ed60bcef24612f053b491
BLAKE2b-256 bf5f795a7f82362d66cea78bb86f017a927e80591a55fe8343585ce66092c2ea

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page