Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pysam to 0.23.0 #730

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pyup-bot
Copy link
Collaborator

@pyup-bot pyup-bot commented Feb 5, 2025

This PR updates pysam from 0.15.4 to 0.23.0.

Changelog

0.23.0

==============

.. rubric:: 5 February 2025

This pysam release wraps htslib/samtools/bcftools 1.21 (PR 1310).

It has been tested with Python versions 3.6 through 3.13, and wheels are
available via PyPI_ for all of those Python versions. Python versions 3.6
through 3.8 are end-of-life; particularly if you use pysam with one of
these versions, please vote in the version survey at issue 1230.

This is expected to be the last release supporting Python 3.6 and 3.7.

Bugs fixed:

* Fix :func:`pysam.samtools.command(save_stdout=filename) <.samtools.command>`
redirection of output to a file. (677, reported by Haowen Zhang and analysed
by Youri Hoogstrate)

* Reinstate HTTPS/S3/GCS support in pre-built Linux wheels when used on Debian
and Ubuntu: these wheels now work around the discrepancy between Red Hat and
Debian CA Certificate file locations. (1257, 1268, reported by Daisie Huang
and Li Tai Fang)

* Calling :meth:`.VariantHeader.new_record` repeatedly with the same
:obj:`samples` object now sets GT correctly every time. (1308, reported
by Arthur Gymer)

* Correct the exception produced when :meth:`.AlignedSegment.set_tags` is
used with an invalid value type. (1233, PR 1235, reported by Weisheng Wu
and Marcus Stoiber)

* Many type hinting corrections. (1298, 1316, PR 1296, PR 1306, PR 1313,
PR 1315, thanks to Victor Epain, Arthur Gymer, mshunjan, and Matt Stone)

* The undocumented :func:`!pysam.samtools.import_` alias for invoking
``samtools import`` has been removed;
use :func:`pysam.samtools.fqimport() <.samtools.command>` instead.

* Corrections to several test data files to account for HTSlib 1.20 and later's
improved validity checking. (1291, reported by David Seifert; etc)

New functionality:

* :meth:`.AlignedSegment.get_aligned_pairs` now optionally returns the
associated CIGAR operator in each position tuple. (1292, PR 1294,
thanks to Lara Fuhrmann and Ivan Blagoev Topolsky)

* New :meth:`AlignmentFile.flush() <.HTSFile.flush>` and
:meth:`VariantFile.flush() <.HTSFile.flush>` methods for flushing buffered
output to streams. (1299, requested by blex-max)

* Improved :class:`str() <str>` for :class:`.AlignedSegment` now displays
reference sequence names when they are available and uses ``N`` only when
necessary. (1318, requested by Liu)

* Implement :func:`repr` for :class:`.AlignedSegment` so that it displays the
most useful fields. (PR 1267, thanks to Marcel Martin)

* Pysam's tests can now run in parallel. (1284, reported by Yuri Victorovich)

Documentation improvements:

* More complete documentation of invoking SAMtools and BCFtools subcommands
via Pysam. (1096, 1241, PR 1261, PR 1275, 1323, et al, reported by
Seung-been "Steven" Lee, Robert Baldwin, Michael Hall, Indraniel Das,
and shokrofont)

* Use the Pysam names for CIGAR operators rather than internal C names.
(1255, reported by Ilya Shlyakhter)

* Mention :meth:`AlignmentFile.fetch("*") <.AlignmentFile.fetch>` in the
FAQ entry on fetching unmapped reads. (424, reported by Ben Weisburd)

0.22.1

==============

.. rubric:: 24 April 2024

Bugfix release, which still wraps htslib/samtools/bcftools 1.18.

Bugs fixed:

* Preserve all header field tags defined in the SAM specification (notably TP)
in :meth:`.AlignmentHeader.from_dict` and :meth:`.AlignmentHeader.to_dict`.
(1237, PR 1238, thanks to Tim Fennell and Nils Homer)

* Adjust HTSlib's Makefile so that ``make distclean`` no longer tries to
rebuild the htscodecs configury. (PR 1247, reported by Nicola Soranzo)

* Reinstate S3 support in pre-built Linux wheels: support for this protocol
was inadvertently omitted from the pre-built 0.22.0 wheels on Linux.
(1249, 1277, etc varying circumstances; likely it is this that was
reported by Mathew Baines, Benjamin Sargsyan, et al)

* Add missing :attr:`.AlignedSegment.is_mapped` etc properties to type stubs.
(PR 1273, thanks to Matt Stone)

* Fix off-by-one NamedTupleProxy, :class:`.asBed`, etc array bounds check.
(1279, reported by Dan Bolser)

* Make pysam's klib headers compatible with C++. (reported by Martin Grigorov)

0.22.0

==============

.. rubric:: 5 October 2023

This pysam release wraps htslib/samtools/bcftools 1.18 (PR 1208).

It has been tested with Python versions 3.6 through 3.12, and wheels are
available via PyPI_ for all of those Python versions. Python versions 3.6
and 3.7 are end-of-life; particularly if you use pysam with either of
these versions, please vote in the version survey at issue 1230.

The final pysam release that supported Python 2.7 was v0.20.0.

Bugs fixed:

* Remove Cython from runtime dependencies. (PR 1186, thanks to Nicola Soranzo,
also reported by Arya Massarat in PR 1194)

* Miscellaneous dependency improvements. (PR 1216, 1217, PR 1218, PR 1219,
thanks to Martin Larralde and Arthur Vigil)

* Suppress spurious "Could not retrieve index file" message when opening an
AlignmentFile. (939, 1214, reported by ChengYong Tham and Sebastian Röner)

* Propagate SAM parsing errors encounted in :meth:`.AlignedSegment.fromstring`.
(1196, reported by DV Klopfenstein)

* Accept invalid MD:A tagged fields produced by HTSeq instead of crashing
in :meth:`AlignedSegment.get_aligned_pairs(with_seq=True)
<.AlignedSegment.get_aligned_pairs>`. (1226, reported by Isaac Vock)

* Fix multiarch macOS CI builds by removing brewed liblzma. (1205, reported
by Till Hartmann)

* Fix :attr:`.VariantRecordSample.alleles` type hint. (1179, reported by
David Seifert)

New functionality:

* Add optional :meth:`HTSFile.seek(..., whence) <.HTSFile.seek>` parameter
and clarify which functions use libc.SEEK_SET vs io.SEEK_SET.
(1185, requested by luyulin)

* File handling improvements in samtools & bcftools commands. (should improve
1193 and 1195, reported by Rob Bierman and Sam Chorlton)

* Improve :class:`.FastxFile` performance. (PR 1227, thanks to Fabian Klötzl
and Valentyn Bezshapkin)

* Improve the accuracy of type hints for :class:`.AlignmentFile` iteration.
(1184, PR 1189, reported by PikalaxALT)

Documentation improvements:

* Clarify that :meth:`.AlignedSegment.get_aligned_pairs` results are 0-based.
(1180, reported by Nick Semenkovich)

* Clarify :meth:`.AlignedSegment.get_reference_positions` documentation.
(836, 838, reported by Liang Ou and Nick Stoler)

* Clarify that installation via pip usually uses a wheel, and that configuring
the build via $HTSLIB_CONFIGURE_OPTIONS etc only applies when installing from
an sdist. (1086, reported by Layne Sadler)

A message from pysam's founder, Andreas Heger:

 As many of you will have noticed, John Marshall has been effectively
 maintaining pysam and supporting users over the last few years.
 I, Andreas, am very grateful for the countless hours he has contributed.
 Unfortunately, I will not be able to contribute much in the near and
 intermediate future. To keep pysam going, John has kindly agreed to
 continue maintaining and supporting pysam as the principal developer
 of pysam. I am very happy to know that pysam is in good hands and want
 to thank again John and the wider pysam community for their suggestions,
 bug reports, code contributions and general support.

Thank you Andreas for all your work over the years and the solid foundations
that pysam enjoys and the useful functionality it provides.

0.21.0

==============

.. rubric:: 2 April 2023

This release wraps htslib/samtools/bcftools version 1.17.

Pysam is now compatible with Python 3.11. We have removed Python 2.x
support. Pysam is tested with Python versions 3.6 to 3.11.

* [1175] VariantHeader.new_record: set start/stop before alleles
* [1173] Add multiple build improvements in htscodecs on multi-arch macOS
* [1148] Ignore CIGAR-less reads in find_introns.
* [1172] Add new `samtools cram-size` and `samtools reset` commands
* [1169] Fix CRAM index-related crash when using the musl C standard library.
* [1168] Add a minimal pyproject.toml for PEP517.
* [1158] Fix type hints and add FastqProxy type hints.
* [1147] Py3.11 compatibility, get shared object suffix from EXT_SUFFIX.
* [1143] Add mypy symbols for samtools and bcftools.
* [1155] Fix pysam.index() when using recent `samtools index` options.
* [1151] Test suite py3.11 compatibility, work around failing test case.
* [1149] MacOS universal build compatibility.
* [1146] Fix build when CFLAGS/etc environment variables are set.

0.20.0

==============

.. rubric:: 29 October 2022

This release wraps htslib/bcftools version 1.16 and samtools version 1.16.1.

* [1113] Full compatibility with setuptools v62.1.0's build directory name changes
* [1121] Build-time symbol check portability improved
* [1122] Fix setting sample genotype using .alleles property
* [1128] Fix test suite failure when using a libdeflate-enabled samtools

Many additional type hints have been provided by the community,
thanks!

0.19.1

==============

.. rubric:: 27 May 2022

This release wraps htslib/samtools/bcftools version 1.15.1.

* [1104] add an add_samples() method to quickly add multiple samples
to VCF.

0.19.0

==============

.. rubric:: 30 March 2022

This release wraps htslib/samtools/bcftools version 1.15.

* [1085] Improve getopt()/getopt_long() resetting when running samtools/bcftools commands

* [1078] Support BAM_CPAD in get_aligned_pairs

* [1063] Run flake8 and fix some linting issues

* [1088] Add AlignedSegment is_mapped/mate_is_mapped/is_forward/mate_is_forward properties

* Write an absent AlignedSegment.qual as all-bytes-0xff

* Fix BGZFile.read() behaviour near or at EOF

* First API for the htslib modified bases interface

0.18.0

==============

.. rubric:: 17 November 2021

This release wraps htslib/samtools/bcftools version 1.14.

* [1048] and [1060], clarify documentation of index statistics with CRAM files
* Prevent "retval may be used uninitialised" warning.
* Add new "samples" subcommand to pysam/samtools.py
* Introduce TupleProxyIterator iterator object class

0.17.0

==============

.. rubric:: 30 September 2021

This release wraps htslib/samtools/bcftools version 1.13. Corresponding
to new samtools commands, `pysam.samtools` now has additional functions
`ampliconclip`, `ampliconstats`, `fqimport`, and `version`.

Bugs fixed:

* [447] The maximum QNAME length is fully restored to 254
* [506, 958, 1000] Don't crash the Python interpreter on ``pysam.bcftools.*()`` errors
* [603] count_coverage: ignore reads that have no SEQ field
* [928] Fix ``pysam.bcftools.mpileup()`` segmentation fault
* [983] Add win32/\*.[ch] to MANIFEST.in
* [994] Raise exception in ``get_tid()`` if header could not be parsed
* [995] Choose TBI/CSI in ``tabix_index()`` via both min_shift and csi
* [996] ``AlignmentFile.fetch()`` now works with large chromosomes longer than 2\ :sup:`29` bases
* [1019] Fix Sphinx documentation generation by avoiding Python 2 ``ur'string'`` syntax
* [1035] Improved handling of file iteration errors
* [1038] ``tabix_index()`` no longer leaks file descriptors
* [1040] ``print(aligned_segment)`` now prints the correct TLEN value
(it also now prints RNAME/RNEXT more clearly and prints POS/PNEXT 1-based)
* *setup.py* longer uses ``setup(use_2to3)`` for compatibility with setuptools >= v58.0.0

New facilities:

* [PR 963] Additional VCF classes are exposed to pysam programmers
* [998, PR 1001] Add ``get/set_encoding_error_handler()`` to control UTF-8 conversion
* [PR 1012] Running ``python setup.py sdist`` now automatically runs cythonize
* Running tests with ``pytest`` now automatically runs ``make`` to generate test data

Documentation improvements:

* [726] Clarify get_forward_sequence/get_forward_qualities documentation
* [865] Improved example
* [968] ``get_index_statstics`` parameters
* [986] Clarify ``VariantFile.fetch`` start/stop region parameters are 0-based and half-open.
* [990] Corrected ``PileupColumn.get_query_sequences`` documentation
* [999] Fix documentation for ``AlignmentFile.get_reference_length()``
* [1002] Document the default min_base_quality for ``pileup()``

0.16.0

==============

.. rubric:: 8 June 2020

This release wraps htslib/bcftools version 1.10.2 and samtools version
1.10. The following bugs reported against pysam are fixed due to this:

* [447] Writing out QNAME longer than 251 characters corrupts BAM
* [640, 734, 843] Setting VariantRecord pos or stop raises error
* [738, 919] FastxFile truncates concatenated plain gzip compressed files

Additional bugfixes:

* [840] Pileup doesn't work on python3 when `index_filename` is used
* [886] FastqProxy raises ValueError when instantiated from python
* [904] VariantFile.fetch() throws ValueError on files with no records
* [909] Fix incorrect quoting in VariantFile contig records
* [915, 916] Implement pileup() for unindexed files and/or SAM files

Backwards incompatible changes:

* The `samtools import` command was removed in samtools 1.10, so pysam
no longer exports a `samimport` function. Use `pysam.view()` instead.
Links

@pyup-bot pyup-bot mentioned this pull request Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant