Skip to content

pysam-0.9.0

Compare
Choose a tag to compare
@AndreasHeger AndreasHeger released this 01 Mar 23:43
· 1192 commits to master since this release

The 0.9.0 release upgrades htslib to htslib 1.3 and numerous other
enchancements and bugfixes. See below for a detailed list.

Htslib 1.3 <https://github.com/samtools/htslib/releases/tag/1.3>_
comes with additional capabilities for remote file access which depend
on the presence of optional system libraries. As a consequence, the
installation script :file:setup.py has become more complex. For an
overview, see :ref:installation. We have tested installation on
linux and OS X, but could not capture all variations. It is possible
that a 0.9.1 release might follow soon addressing installation issues.

The pysam.VariantFile class provides access to
vcf and bcf formatted files. The class is certainly
usable and interface is reaching completion, but the API and the
functionality is subject to change.

  • upgrade to htslib 1.3
  • python 3 compatibility tested throughout.
  • added a first set of bcftools commands in the pysam.bcftools submodule.
  • samtools commands are now in the pysam.samtools module. For backwards compatibility they are still imported into the pysam namespace.
  • samtools/bcftools return stdout as a single (byte) string. As output
    can be binary (VCF.gz, BAM) this is necessary to ensure py2/py3
    compatibility. To replicate the previous behaviour in py2.7,
    use::pysam.samtools.view(self.filename).splitlines(True)
  • get_tags() returns the tag type as a character, not an integer (#214)
  • TabixFile now raises ValueError on indices created by tabix <1.0 (#206)
  • improve OSX installation and develop mode
  • FastxIterator now handles empty sequences (#204)
  • TabixFile.isremote is not TabixFile.is_remote in line with AlignmentFile
  • AlignmentFile.count() has extra optional argument read_callback
  • setup.py has been changed to:
    • install a single builtin htslib library. Previously, each pysam module contained its own version. This reduces compilation time and code bloat
    • run configure for the builtin htslib library in order to detect optional libraries such as libcurl. Configure behaviour can be controlled by setting the environment variable HTSLIB_CONFIGURE_OPTIONS.
  • get_reference_sequence() now returns the reference sequence and not something looking like it. This bug had effects on get_aligned_pairs(with_seq=True), see #225. If you have relied on get_aligned_pairs(with_seq=True) in pysam-0.8.4, please check your results.
  • improved autodetection of file formats in AlignmentFile and VariantFile.