Recent Releases of pysam
pysam - 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
AlignmentFileandVariantFile, and ensured that error codes returned by all HTSlib function invocations result in an exception being raised.
- Cython
Published by jmarshall 9 months ago
pysam - 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.
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.CMATCHetc remain as synonyms forpysam.CIGAR_OPS.CMATCHetc. 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
TabixIteratorerror handling. (#1328, reported by @Fan-iX)Fixed bugs in the caching of
AlignedSegment.query_sequenceandAlignedSegment.query_qualitiesvalues.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_strproperty enables accessing the QUAL field as an ASCII-encoded base quality string. The existingAlignedSegment.query_qualitiesproperty can now take an array or such a string when setting the value. (PR #1324, PR #1341, requested by @nh13)Improved
AlignedSegment.cigarstringperformance. (PR #1295, thanks to @limwz01)Wheels are now built for musllinux in addition to manylinux and macOS. (Requested by @nh13)
- Cython
Published by jmarshall 9 months ago
pysam - 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 samesamplesobject 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 importhas 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()forAlignedSegmentnow displays reference sequence names when they are available and uses#Nonly when necessary. (#1318, requested by @creaturemoon)Implement
repr()forAlignedSegmentso 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)
- Cython
Published by jmarshall about 1 year ago
pysam - 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 distcleanno 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_mappedetc 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)
- Cython
Published by jmarshall almost 2 years ago
pysam - 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.allelestype hint (#1179, reported by @SoapGentoo)
New functionality:
Add optional
HTSFile.seek(..., whence)parameter and clarify which functions uselibc.SEEK_SETvsio.SEEK_SET(#1185, requested by @ylluX)File handling improvements in samtools & bcftools commands (should improve #1193 and #1195, reported by @biermanr and @schorlton)
Improve
FastxFileperformance (PR #1227, thanks to @kloetzl and @valentynbez)Improve the accuracy of type hints for
AlignmentFileiteration (#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_OPTIONSetc 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.
- Cython
Published by jmarshall over 2 years ago
pysam - 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-sizeandsamtools resetcommands - [#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 indexoptions. - [#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.
- Cython
Published by AndreasHeger almost 3 years ago
pysam - 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.
- Cython
Published by AndreasHeger over 3 years ago
pysam - 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 manylinux224
- Cython
Published by AndreasHeger over 3 years ago
pysam - 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 BAMCPAD in getaligned_pairs
[#1063] Run flake8 and fix some linting issues
[#1088] Add AlignedSegment ismapped/mateismapped/isforward/mateisforward 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 interfac
- Cython
Published by AndreasHeger almost 4 years ago
pysam - pysam-v0.18.0
Release 0.18.0
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
- Cython
Published by AndreasHeger over 4 years ago
pysam - pysam-v0.17.0
Release 0.17.0
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 229 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 (thanks to @nh13)
- [#998, PR #1001] Add
get/set_encoding_error_handler()to control UTF-8 conversion - [PR #1012] Running
python setup.py sdistnow automatically runs cythonize (thanks to @marcelm) - Running tests with
pytestnow automatically runsmaketo generate test data
Documentation improvements:
- [#726] Clarify getforwardsequence/getforwardqualities documentation
- [#865] Improved example
- [#968]
get_index_statsticsparameters - [#986] Clarify
VariantFile.fetchstart/stop region parameters are 0-based and half-open. - [#990] Corrected
PileupColumn.get_query_sequencesdocumentation - [#999] Fix documentation for
AlignmentFile.get_reference_length() - [#1002] Document the default minbasequality for
pileup()
Notes and comments:
Apologies for the hiatus in releases. A big thank you to @jmarshall who has been doing a lot of the work of maintaining pysam in the last year. The delay in getting out releases has been entirely down to me. We have now automated the release process using Github actions. With less overhead, we should be able to release more timely again.
The priorities in the near future are to: 1. track htslib releases and release pysam in a timely manner. 2. remove python2 compatibility from pysam. This will simplify quite a bit of code within pysam. 3. review and triage the many open issues and pull requests. Many thanks to the whole community for submissions and apologies in the delay on acting on them.
The medium term priority is to review the pysam API in order to arrive at a 1.0 release with a consistent API.
- Cython
Published by AndreasHeger over 4 years ago
pysam - pysam-v0.16.0.1
Release is identical to v0.16.0.
This release was made to be able re-upload fixed wheels of v0.16.0 to pypi.
- Cython
Published by AndreasHeger over 5 years ago
pysam - pysam-v0.16.0
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_filenameis 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 importcommand was removed in samtools 1.10, so pysam no longer exports asamimportfunction. Usepysam.view()instead.
Many thanks to @jmarshall who has done most of the heavy lifting.
- Cython
Published by AndreasHeger over 5 years ago
pysam - pysam-v0.15.4
Release 0.15.4
Bugfix release. Principal reason for release is to update cython version in order to fix pip install pysam with python 3.8.
- [#879] Fix add_meta function in libcbcf.pyx, so meta-information lines in header added with this function have double-quoting rules in accordance to rules specified in VCF4.2 and VCF4.3 specifications
- [#863] Force arg to bytes to support non-ASCII encoding
- [#875] Bump minimum Cython version
- [#868] Prevent segfault on Python 2.7 AlignedSegment.compare(other=None)
- [#867] Fix wheel building on TravisCI
- [#863] Force arg to bytes to support non-ASCII encoding
- [#799] disambiguate interpretation of bcf_read return code
- [#841] Fix silent truncation of FASTQ with bad q strings
- [#846] Prevent segmentation fault on ID, when handling malformed records
- [#829] Run configure with the correct CC/CFLAGS/LDFLAGS env va
- Cython
Published by AndreasHeger about 6 years ago
pysam - pysam-v0.15.3
Release 0.15.3
Bugfix release.
- [#824] allow reading of UTF-8 encoded text in VCF/BCF files.
- [#780] close all filehandles before opening new ones in pysam_dispatch
- [#773] do not cache VariantRecord.id to avoid memory leak
- [#781] default of multiple_iterators=True is changed to False for CRAM files.
- [#825] fix collections.abc import
- [#825] use bcfhdrformat instead of bcfhdrfmt_text, fix memcpy bug when setting FORMAT fields.
- [#804] Use HTSlib's kstring_t, which reallocates and enlarges its memory as needed, rather than a fixed-size char buffer.
- [#814] Build wheels and upload them to PyPI
- [#755] Allow passing flags and arguments to index methods
- [#763] Strip \0 in header check
- [#761] Test Tabix index contents, not the compression
- Cython
Published by AndreasHeger over 6 years ago
pysam - pysam-0.15.2
Bugfix release.
- [#746] catch pileup itorator out-of-scope segfaults
- [#747] fix faixd fetch with region
- [#748] increase max_pos to (1<<31)-1
- [#645] Add missing macOS stub files in
MANIFEST.in, @SoapZA - [#737] Fix bug in getalignedpairs, @bkohrn
- Cython
Published by AndreasHeger about 7 years ago
pysam - pysam-0.15.1
Release 0.15.1
Bugfix release.
- [#716] raise ValueError if tid is out of range when writing
- [#697] release version using cython 0.28.5 for python 3.7 compatibility
- Cython
Published by AndreasHeger over 7 years ago
pysam - pysam-0.15.0.1
This release is the same as v0.15.0 release on pypi, I was not aware that v0.15.0 had been release on github.
Release notes:
Release 0.15.0.1
This release wraps htslib/samtools/bcftools version 1.9.0.
- [#673] permit dash in chromosome name of region string
- [#656] Support
textwhen opening a SAM file for writing - [#658] return None in getforwardsequence if sequence not in record
- [#683] allow lower case bases in MD tags
- Ensure that = and X CIGAR ops are treated the same as M
- Cython
Published by AndreasHeger over 7 years ago
pysam - pysam-0.14.1
Release 0.14.1
This is predominantly a bugfix release, though bcftools has now also been upgraded to 1.7.0.
- [#621] Add a warning to count_coverage when an alignment has an empty QUAL field
- [#635] Speed-up of AlignedSegment.find_intro()
- treat border case of all bases in pileup column below quality score
- [#634] Fix access to pileup reference_sequence
- Cython
Published by AndreasHeger almost 8 years ago
pysam - pysam-0.14
This release wraps htslib/samtools versions 1.7.0.
- SAM/BAM/CRAM headers are now managed by a separate AlignmentHeader class.
- AlignmentFile.header.as_dict() returns an ordered dictionary.
Use "stop" instead of "end" to ensure consistency to VariantFile. The end designations have been kept for backwards compatibility.
[#611] and [#293] CRAM repeated fetch now works, each iterator reloads index if multiple_iterators=True
[#608] pysam now wraps htslib 1.7 and samtools 1.7.
[#580] referencename and nextreference_name can now be set to "*" (will be converted to None to indicate an unmapped location)
[#302] providing no coordinate to count_coverage will not count from start/end of contig.
[#325] @SQ records will be automatically added to header if they are absent from text section of header.
[#529] add getforwardsequence() and getforwardqualities() methods
[#577] add fromstring() and todict()/fromdict() methods to
AlignedSegment. Rename tostring() to tostring() throughout for consistency[#589] return None from buildalignmentsequence if no MD tag is set
[#528] add PileupColumn.len method
Backwards incompatible changes:
- AlignmentFile.header now returns an AlignmentHeader object. Use AlignmentFile.header.todict() to get the dictionary as previously. Most dictionary accessor methods (keys(), values(), _getitem__, ...) have been implemented to ensure some level of backwards compatibility when only reading.
The rationale for this change is to have consistency between AlignmentFile and VariantFile.
- AlignmentFile and FastaFile now raise IOError instead of OSError
Medium term we plan to have a 1.0 release. The pysam interface has grown over the years and the API is cluttered with deprecated names (Samfile, getrname(), gettid(), ...). To work towards this, the next release (0.15.0) will yield DeprecationWarnings for any parts of the API that are considered obsolete and will not be in 1.0. Once 1.0 has been reached, we will use semantic versioning.
- Cython
Published by AndreasHeger about 8 years ago
pysam - pysam-0.13.0
This release wraps htslib/samtools/bcftools versions 1.6.0 and contains a series of bugfixes.
- [#544] reading header from remote TabixFiles now works.
- [#531] add missing tag types H and A. A python float will now be added as 'f' type instead of 'd' type.
- [#543] use FastaFile instead of Fastafile in pileup.
- [#546] set is_modified flag in setAttribute so updated attributes are output.
- [#537] allow tabix index files to be created in a custom location.
- [#530] add getindexstatistics() method
- Cython
Published by AndreasHeger over 8 years ago
pysam - pysam-0.12.0.1
Bugfix release resolving an issue with a missing config.h file in bcftools.
- Cython
Published by AndreasHeger over 8 years ago
pysam - pysam-0.12.0
This release wraps htslib/samtools/bcftools versions 1.5.0 and contains a series of bugfixes.
- [#473] A new FastxRecord class that can be instantiated from class and modified in-place. Replaces PersistentFastqProxy.
- [#521] In AligmentFile, Simplify file detection logic and allow remote index files
- Removed attempts to guess data and index file names; this is magic left to htslib.
- Removed file existence check prior to opening files with htslib
- Better error checking after opening files that raise the appropriate error (IOError for when errno is set, ValueError otherwise for backward compatibility).
- Report IO errors when loading an index by name.
- Allow remote indices (tested using S3 signed URLs).
- Document filepathindex and make it an alias for indexfilename.
- Added a require_index parameter to AlignmentFile
- [#526] handle unset ref when creating new records
- [#513] fix bcf_translate to skip deleted FORMAT fields to avoid segfaults
- [#516] expose IO errors via IOError exceptions
- [#487] add tabix line_skip, remove 'pileup' preset
- add FastxRecord, replaces PersistentFastqProxy (still present for backwards compatibility)
- [#496] upgrade to htslib/samtools/bcftools versions 1.5
- add start/stop to AlignmentFile.fetch() to be consistent with VariantFile.fetch(). "end" is kept for backwards compatibility.
Upcoming changes:
In the next release we are plannig to separate the header information from AlignmentFile into a separate class AlignmentHeader. This layout is similar to VariantFile/VariantHeader. With this change we will ensure that an AlignedSegment record will be linked to a header so that chromosome names can be automatically translated from the numeric representation. As a consequence, the way new AlignedSegment records are created will need to change as the constructor requires a header::
header = pysam.AlignmentHeader(
reference_names=["chr1", "chr2"],
reference_lengths=[1000, 1000])
read = pysam.AlignedSegment(header)
This will affect all code that instantiates AlignedSegment objects directly. We have not yet merged to allow users to provide feed-back. The pull-request is here: https://github.com/pysam-developers/pysam/pull/518 Please comment on github.
- Cython
Published by AndreasHeger over 8 years ago
pysam - pysam-0.11.2.2
Bugfix release to address two issues:
- Changes in 0.11.2.1 broke the GTF/GFF3 parser. Corrected and more tests have been added.
- [#479] Correct VariantRecord edge cases described in issue
- Cython
Published by AndreasHeger over 8 years ago
pysam - pysam-0.11.2
This release wraps htslib/samtools/bcfools versions 1.4.1 in response to a security fix in these libraries. Additionaly the following issues have been fixed:
- [#452] add GFF3 support for tabix parsers
- [#461] Multiple fixes related to VariantRecordInfo and handling of INFO/END
- [#447] limit query name to 251 characters (only partially addresses issue)
VariantFile and related object fixes
- Restore VariantFile.__dealloc__
- Correct handling of bcfstrmissing in bcfarraytoobject and bcfobjecttoarray
- Added update() and pop() methods to some dict-like proxy objects
- scalar INFO entries could not be set again after being deleted
- VariantRecordInfo.delitem now allows unset flags to be deleted without raising a KeyError
- Multiple other fixes for VariantRecordInfo methods
- INFO/END is now accessible only via VariantRecord.stop and VariantRecord.rlen. Even if present behind the scenes, it is no longer accessible via VariantRecordInfo.
- Add argument to issue a warning instead of an exception if input appears to be truncated
Other features and fixes:
- Make AlignmentFile __dealloc__ and close more stringent
- Add argument AlignmentFile to issue a warning instead of an exception if input appears to be truncated
- Cython
Published by AndreasHeger almost 9 years ago
pysam - pysam-0.11.1
Bugfix release to improve backwards compatibility:
- [#440] add deprecated 'always' option to inferquerylength for backwards compatibility.
- Cython
Published by AndreasHeger almost 9 years ago
pysam - pysam-0.11.0
This release wraps the latest versions of htslib/samtools/bcftools and implements a few bugfixes.
- [#413] Wrap HTSlib/Samtools/BCFtools 1.4
- [#422] Fix missing pysam.sort.usage() message
- [#411] Fix BGZfile initialization bug
- [#412] Add seek support for BGZFile
- [#395] Make BGZfile iterable
- [#433] Correct getQueryEnd
- [#419] Export SAM enums such as pysam.CMATCH
- [#415] Fix access by tid in AlignmentFile.fetch()
- [#405] Writing SAM now outputs a header by default.
- [#332] split inferquerylength(always) into inferquerylength and inferreadlength
- Cython
Published by AndreasHeger almost 9 years ago
pysam - pysam-0.10.0
This release implements further functionality in the VariantFile API and includes several bugfixes: - treat special case -c option in samtools view outputs to stdout even if -o given, fixes #315 - permit reading BAM files with CSI index, closes #370 - raise Error if query name exceeds maximum length, fixes #373 - new method to compute hash value for AlignedSegment - AlignmentFile, VariantFile and TabixFile all inherit from HTSFile - Avoid segfault by detecting out of range referenceid and nextreference in AlignedSegment.tostring - Issue #355: Implement streams using file descriptors for VariantFile - upgrade to htslib 1.3.2 - fix compilation with musl libc - Issue #316, #360: Rename all Cython modules to have lib as a prefix - Issue #332, hardclipped bases in cigar included by pysam.AlignedSegment.inferquerylength() - Added support for Python 3.6 filename encoding protocol - Issue #371, fix incorrect parsing of scalar INFO and FORMAT fields in VariantRecord - Issue #331, fix failure in VariantFile.reset() method - Issue #314, add VariantHeader.newrecord(), VariantFile.newrecord() and VariantRecord.copy() methods to create new VariantRecord objects - Added VariantRecordFilter.add() method to allow setting new VariantRecord filters - Preliminary (potentially unsafe) support for removing and altering header metadata - Many minor fixes and improvements to VariantFile and related objects
Please note that all internal cython extensions now have a lib prefix. Any user cython extensions
using cimport to import pysam definitions will need changes.
- Cython
Published by AndreasHeger about 9 years ago
pysam - pysam-0.9.1.4
This release is (almost) identical to 0.9.1 but aims to improve installation by querying htslib configuration directly.
Many thanks @jmarshall
This release also fixes a bug when parsing tags following CL tags in SAM/BAM headers.
- Cython
Published by AndreasHeger over 9 years ago
pysam - pysam-0.9.1.3
This release is identical but aims to improve installation on systems without cython.
- Cython
Published by AndreasHeger over 9 years ago
pysam - pysam-0.9.1.2
This release is identical to pysam 0.9.1 in functionality, but aims to improve installation without libcurl.
- Cython
Published by AndreasHeger over 9 years ago
pysam - pysam-0.9.1.1
This release is functionally equivalent to 0.9.1, but aims to resolve installation issues on systems without cython.
- Cython
Published by AndreasHeger over 9 years ago
pysam - pysam-0.9.1
This is a bugfix release addressing some installation problems in pysam 0.9.0, in particular: - patch included htslib to work with older libcurl versions, fixes #262. - do not require cython for python 3 install, fixes #260 - FastaFile does not accept filepathindex any more, see #270 - add AlignedSegment.getcigarstats method. - py3 bugfix in VariantFile.subsetsamples, fixes #272 - add missing sysconfig import, fixes #278 - do not redirect stdout, but instead write to a separately created file. This should resolve issues when pysam is used in notebooks or other environments that redirect stdout. - wrap htslib-1.3.1, samtools-1.3.1 and bcftools-1.3.1 - use bgzf throughout instead of gzip - allow specifying a fasta reference for CRAM file when opening for both read and write, fixes #280
- Cython
Published by AndreasHeger over 9 years ago
pysam - pysam-0.9.0
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)
- gettags() 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.isremote in line with AlignmentFile
- AlignmentFile.count() has extra optional argument readcallback
- 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 HTSLIBCONFIGUREOPTIONS.
- getreferencesequence() now returns the reference sequence and not something looking like it. This bug had effects on getalignedpairs(withseq=True), see #225. If you have relied on getalignedpairs(with_seq=True) in pysam-0.8.4, please check your results.
- improved autodetection of file formats in AlignmentFile and VariantFile.
- Cython
Published by AndreasHeger almost 10 years ago
pysam - pysam-0.8.4
This release contains numerous bugfixes and a first implementation of a pythonic interface to VCF/BCF files thanks to Kevin Jacobs.
Potential isses when upgrading from v0.8.3: - binary tags are now returned as python arrays - renamed several methods for pep8 compatibility, old names still retained for backwards compatibility, but should be considered deprecated. - gettid() is now gettid() - getrname() is now getreferencename() - parseRegion() is now parseregion() - faidx now returns strings and not binary strings in py3. - The cython components have been broken up into smaller files with more specific content. This will affect users using the cython interfaces.
A full list of changes is at http://pysam.readthedocs.org/en/stable/release.html
- Cython
Published by AndreasHeger over 10 years ago
pysam - pysam-0.8.3
This is a minor bugfix/feature release tying off a few things in 0.8.2. These are: - samtools command now accept the "catchstdout" option. - getalignedpairs now works for soft-clipped reads. - queryposition is now None when a PileupRead is not aligned to a particular position. - AlignedSegments are now comparable and hashable.
- Cython
Published by AndreasHeger almost 11 years ago
pysam - pysam-0.8.2
- Pysam now wraps htslib 1.2.1 and samtools version 1.2
- Added CRAM file support to pysam
- New alignment info interface.
- opt() and setTag are deprecated, use gettag() and settag() instead.
- added has_tag()
- tags is deprecated, use gettags() and settags() instead.
- FastqFile is now FastxFile to reflect that the latter permits iteration over both fastq- and fasta-formatted files.
- A Cython wrapper for htslib VCF/BCF reader/writer. The wrapper provides a nearly complete Pythonic interface to VCF/BCF metadata with reading and writing capability. However, the interface is still incomplete and preliminary and lacks capability to mutate the resulting data.
- Cython
Published by AndreasHeger about 11 years ago
pysam - pysam-0.8.1
API Refactoring release
For more information, see: http://pysam.readthedocs.org/en/latest/release.html
- Cython
Published by AndreasHeger about 11 years ago