Releases: pysam-developers/pysam
v0.23.3
This is a bugfix release, still wrapping htslib/samtools/bcftools 1.21.
It has been tested with Python versions 3.8 through 3.13, and wheels are available via PyPI for all of those Python versions. Wheels are built for macOS and Linux (manylinux_2_28
and musllinux_1_2
) on both ARM and x86-64.
The final pysam release that supported Python 3.6 and 3.7 was v0.23.0.
Bugs fixed:
- Worked around Cython 3.1.2 bug whereby a new Cython-internal function incorrectly triggered the pysam build system's duplicate symbol check.
v0.23.2
This is a bugfix release, still wrapping htslib/samtools/bcftools 1.21.
It has been tested with Python versions 3.8 through 3.13, and wheels are available via PyPI for all of those Python versions. Wheels are built for macOS and Linux (manylinux_2_28
and musllinux_1_2
) on both ARM and x86-64.
The final pysam release that supported Python 3.6 and 3.7 was v0.23.0.
Bugs fixed:
-
Pysam 0.23.1 inadvertently broke binary compatibility for Cython projects by changing the size of
AlignedSegment
. That class has been restored to its previous size, so v0.23.2 restores binary compatibility with Cython projects previously compiled against v0.23.0 and earlier. (This bug does not affect pure Python projects using pysam.) -
Improved I/O exception messages in
AlignmentFile
andVariantFile
, and ensured that error codes returned by all HTSlib function invocations result in an exception being raised.
v0.23.1
This is a bugfix release, still wrapping htslib/samtools/bcftools 1.21.
It has been tested with Python versions 3.8 through 3.13, and wheels are available via PyPI for all of those Python versions. Wheels are built for macOS and Linux (manylinux_2_28
and musllinux_1_2
) on both ARM and x86-64.
This release inadvertently broke binary compatibility for Cython projects. This should not affect Python projects using pysam. However Cython projects should update to release 0.23.2.
The final pysam release that supported Python 3.6 and 3.7 was v0.23.0.
Bugs fixed:
-
Worked around Cython 3.1.0 behaviour change so that
pysam.CMATCH
etc remain as synonyms forpysam.CIGAR_OPS.CMATCH
etc. Note that a future release will remove these synonyms to comply with Cython's new convention. (#1339, PR #1340, reported by @Adamtaranto, @andyb3, et al) -
The Python interpreter no longer exits abruptly on x86-64 Linux when
pysam.bcftools.*()
commands terminate with error messages. (#1333, #1335, reported by @3ng7n33r and @Ben-Habermeyer) -
Fixed
AlignedSegment.get_aligned_pairs()
type hint, which now has overloaded hints reflecting the different tuples returned. (PR #1342, thanks to @gshiba) -
Corrected “invalid type for record” exception message. (PR #1334, thanks to @gtamazian)
-
Fixed
TabixIterator
error handling. (#1328, reported by @Fan-iX) -
Fixed bugs in the caching of
AlignedSegment.query_sequence
andAlignedSegment.query_qualities
values. -
Pysam once again builds on CentOS 7, as it now works around limitations in that obsolete platform's obsolete GCC 4.8.x system compiler. (#1327, reported by @mfasold)
New functionality:
-
New
AlignedSegment.query_qualities_str
property enables accessing the QUAL field as an ASCII-encoded base quality string. The existingAlignedSegment.query_qualities
property can now take an array or such a string when setting the value. (PR #1324, PR #1341, requested by @nh13) -
Improved
AlignedSegment.cigarstring
performance. (PR #1295, thanks to @limwz01) -
Wheels are now built for musllinux in addition to manylinux and macOS. (Requested by @nh13)
v0.23.0
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
pysam.samtools.command(save_stdout=filename)
redirection of output to a file. (#677, reported by @haowenz and analysed by @yhoogstrate) -
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 @daisieh and @litaifang)
-
Calling
VariantHeader.new_record()
repeatedly with the samesamples
object now sets GT correctly every time. (#1308, reported by @awgymer) -
Correct the exception produced when
AlignedSegment.set_tags()
is used with an invalid value type. (#1233, PR #1235, reported by @weishwu and @marcus1487) -
Numerous type hinting corrections. (#1298, #1316, PR #1296, PR #1306, PR #1313, PR #1315, thanks to @vepain, @awgymer, @mshunjan, and @msto)
-
The undocumented
pysam.samtools.import_()
alias for invokingsamtools import
has been removed; usepysam.samtools.fqimport()
instead. -
Corrections to several test data files to account for HTSlib 1.20 and later's improved validity checking. (#1291, reported by @SoapGentoo; etc)
New functionality:
-
AlignedSegment.get_aligned_pairs()
now optionally returns the associated CIGAR operator in each position tuple. (#1292, PR #1294, thanks to @LaraFuhrmann and @DrYak) -
New
AlignmentFile.flush()
andVariantFile.flush()
methods for flushing buffered output to streams. (#1299, requested by @blex-max) -
Improved
str()
forAlignedSegment
now displays reference sequence names when they are available and uses#N
only when necessary. (#1318, requested by @creaturemoon) -
Implement
repr()
forAlignedSegment
so that it displays the most useful fields. (PR #1267, thanks to @marcelm) -
Pysam's tests can now be run in parallel. (#1284, reported by @yurivict)
Documentation improvements:
-
More complete documentation of invoking SAMtools and BCFtools subcommands via Pysam. (#1096, #1241, PR #1261, PR #1275, #1323, et al, reported by @sbslee, @robertwhbaldwin, @mbhall88, @indraniel, and @shokrofont)
-
Use the Pysam names for CIGAR operators rather than internal C names. (#1255, reported by @notestaff)
-
Mention
AlignmentFile.fetch("*")
in the FAQ entry on fetching unmapped reads. (#424, reported by @bw2)
v0.22.1
This bug fix release wraps htslib/samtools/bcftools 1.18.
Bugs fixed:
-
Preserve all header field tags defined in the SAM specification (notably
TP
) inAlignmentHeader.from_dict()
andAlignmentHeader.to_dict()
(#1237, PR #1238, thanks to @tfenne and @nh13) -
Adjust HTSlib's Makefile so that
make distclean
no longer tries to rebuild the htscodecs configury (PR #1247, reported by @nsoranzo) -
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-B-SDGS, @BenjaminSargsyan, et al)
-
Add missing
AlignedSegment.is_mapped
etc properties to type stubs (PR #1273, thanks to @msto) -
Fix off-by-one NamedTupleProxy,
asBed
, etc array bounds check (#1279, reported by @dbolser) -
Make pysam's klib headers compatible with C++ (reported by @martin-g)
v0.22.0
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 #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 @nsoranzo, also reported by @aryarm in PR #1194)
-
Miscellaneous dependency improvements (PR #1216, #1217, PR #1218, PR #1219, thanks to @althonos and @ahvigil)
-
Suppress spurious “Could not retrieve index file” message when opening an
AlignmentFile
(#939, #1214, reported by @cytham and @sroener) -
Propagate SAM parsing errors encounted in
AlignedSegment.fromstring()
(#1196, reported by @dvklopfenstein) -
Accept invalid MD:A tagged fields produced by HTSeq instead of crashing in
get_aligned_pairs(with_seq=True)
(#1226, reported by @isaacvock) -
Fix multiarch macOS CI builds by removing brewed liblzma (#1205, reported by @tedil)
-
Fix
VariantRecordSample.alleles
type hint (#1179, reported by @SoapGentoo)
New functionality:
-
Add optional
HTSFile.seek(..., whence)
parameter and clarify which functions uselibc.SEEK_SET
vsio.SEEK_SET
(#1185, requested by @ylluX) -
File handling improvements in samtools & bcftools commands (should improve #1193 and #1195, reported by @biermanr and @schorlton)
-
Improve
FastxFile
performance (PR #1227, thanks to @kloetzl and @valentynbez) -
Improve the accuracy of type hints for
AlignmentFile
iteration (#1184, PR #1189, reported by @PikalaxALT)
Documentation improvements:
-
Clarify that
AlignedSegment.get_aligned_pairs()
results are 0-based (#1180, reported by @semenko) -
Clarify
AlignedSegment.get_reference_positions()
documentation (#836, #838, reported by @weir12 and @NickSto) -
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 @aiqc)
A message from pysam's founder, @AndreasHeger:
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.
pysam-v0.21.0
Release 0.21.0
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
andsamtools 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.
Big thanks to @jmarshall who again has done most of the heavy lifting for this release.
pysam-v0.20.0
Release 0.20.0
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!
This will be the last release with python2.7 support.
pysam-v0.19.1
Release 0.19.1
This release wraps htslib/samtools/bcftools version 1.15.1.
- [#1104] add an add_samples() method to quickly add multiple samples
to VCF.
Wheels are now built using manylinux_2_24
pysam-v0.19.0
Release 0.19.0
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