Loading .travis.yml +42 −20 Original line number Diff line number Diff line Loading @@ -4,6 +4,11 @@ os: language: c stages: - test - name: deploy if: tag IS present env: matrix: - CONDA_PY=2.7 Loading @@ -12,12 +17,26 @@ env: global: - PYSAM_LINKING_TEST=1 - TWINE_USERNAME=grepall - secure: 'OcwwP8/o21+SGW0UVAnnCQwllhGSCq2HJzpI9EhX3kh6J9RTkyx/+drkg45bx1Z5u8zymuAFappEYzlpzqZE886XezkjOYGVa/u+Coqr1oT/BEJHFCkCA4o26yESp7Zy8aNj/juhB7Rfa77pIDXBayqTzbALz/AURMtZapasB18=' - secure: bTbky3Un19NAl62lix8bMLmBv9IGNhFkRXlZH+B253nYub7jwQwPQKum3ct9ea+XHJT5//uM0B8WAF6eyugpNkPQ7+S7SEH5BJuCt30nv6qvGhSO2AffZKeHEDnfW2kqGrivn87TqeomlSBlO742CD/V0wOIUwkTT9tutd+E7FU= _deploy_common: &deploy_common if: tag IS present _cibw_common: &cibw_common addons: {} install: - python3 -m pip install cibuildwheel twine - python3 -m pip install cibuildwheel>=1.1.0 twine script: - set -e - cibuildwheel --output-dir dist - twine check dist/* - twine upload --skip-existing dist/* _cibw_linux: &cibw_linux stage: deploy os: linux language: python python: '3.5' services: - docker <<: *cibw_common matrix: include: Loading @@ -25,11 +44,6 @@ matrix: os: linux language: python python: '3.5' services: - docker env: - CIBW_BEFORE_BUILD="yum install -y zlib-devel bzip2-devel xz-devel && pip install -r requirements.txt" - CIBW_ENVIRONMENT='HTSLIB_CONFIGURE_OPTIONS="--disable-libcurl"' addons: apt: packages: Loading @@ -37,28 +51,36 @@ matrix: - g++ - libcurl4-openssl-dev # for libcurl support in sdist - libssl-dev # for s3 support in sdist <<: *deploy_common install: - python3 -m pip install Cython twine script: - set -e - cibuildwheel --output-dir dist - python3 -m pip install Cython - python3 setup.py build_ext --inplace - python3 setup.py sdist - twine check dist/* - twine upload --skip-existing dist/* - <<: *cibw_linux env: - CIBW_BUILD="*_x86_64" - CIBW_BEFORE_BUILD="yum install -y zlib-devel bzip2-devel xz-devel && python -m pip install -r requirements.txt" - CIBW_ENVIRONMENT='HTSLIB_CONFIGURE_OPTIONS="--disable-libcurl"' - CIBW_REPAIR_WHEEL_COMMAND_LINUX='auditwheel repair -L . -w {dest_dir} {wheel}' - CIBW_TEST_COMMAND='python -c "import pysam"' - <<: *cibw_linux env: - CIBW_BUILD="*_i686" - CIBW_BEFORE_BUILD="yum install -y zlib-devel bzip2-devel xz-devel && python -m pip install -r requirements.txt" - CIBW_ENVIRONMENT='HTSLIB_CONFIGURE_OPTIONS="--disable-libcurl"' - CIBW_REPAIR_WHEEL_COMMAND_LINUX='auditwheel repair -L . -w {dest_dir} {wheel}' - CIBW_TEST_COMMAND='python -c "import pysam"' - stage: deploy os: osx language: generic env: - CIBW_BEFORE_BUILD="pip install -r requirements.txt" - CIBW_BEFORE_BUILD="python -m pip install -r requirements.txt" - CIBW_ENVIRONMENT='HTSLIB_CONFIGURE_OPTIONS="--disable-libcurl"' addons: {} <<: *deploy_common script: - set -e - cibuildwheel --output-dir dist - twine check dist/* - twine upload --skip-existing dist/* - CIBW_TEST_COMMAND='python -c "import pysam"' <<: *cibw_common addons: apt: Loading doc/release.rst +20 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,26 @@ Release notes ============= 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 vars Release 0.15.3 ============== Loading pysam/bcftools.py +1 −1 Original line number Diff line number Diff line from utils import PysamDispatcher from pysam.utils import PysamDispatcher BCFTOOLS_DISPATCH = [ "index", Loading pysam/libcalignedsegment.pyx +89 −88 Original line number Diff line number Diff line Loading @@ -924,7 +924,8 @@ cdef class AlignedSegment: Parameters ---------- header -- :class:`~pysam.AlignmentHeader` object to map numerical header: :class:`~pysam.AlignmentHeader` object to map numerical identifiers to chromosome names. If not given, an empty header is created. ''' Loading Loading @@ -999,6 +1000,10 @@ cdef class AlignedSegment: <,=,> to *other* ''' # avoid segfault when other equals None if other is None: return -1 cdef int retval, x cdef bam1_t *t cdef bam1_t *o Loading Loading @@ -1088,7 +1093,8 @@ cdef class AlignedSegment: Parameters ---------- sam -- :term:`SAM` formatted string sam: :term:`SAM` formatted string """ cdef AlignedSegment dest = cls.__new__(cls) Loading @@ -1110,7 +1116,8 @@ cdef class AlignedSegment: Parameters ---------- htsfile -- (deprecated) AlignmentFile object to map numerical htsfile: (deprecated) AlignmentFile object to map numerical identifiers to chromosome names. This parameter is present for backwards compatibility and ignored. """ Loading @@ -1133,7 +1140,8 @@ cdef class AlignedSegment: Parameters ---------- sam_dict -- dictionary of alignment values, keys corresponding to output from sam_dict: dictionary of alignment values, keys corresponding to output from :meth:`todict()`. """ Loading Loading @@ -2075,15 +2083,11 @@ cdef class AlignedSegment: If no cigar string is present, empty arrays will be returned. Parameters ---------- Returns ------- arrays : two arrays. The first contains the nucleotide counts within each cigar operation, the second contains the number of blocks for each cigar operation. Returns: arrays : two arrays. The first contains the nucleotide counts within each cigar operation, the second contains the number of blocks for each cigar operation. """ Loading Loading @@ -2406,24 +2410,21 @@ cdef class AlignedSegment: specification) as well as additional value type 'd' as implemented in htslib. Parameters ---------- Parameters: tag : data tag. with_value_type : Optional[bool] if set to True, the return value is a tuple of (tag value, type code). (default False) if set to True, the return value is a tuple of (tag value, type code). (default False) Returns ------- Returns: A python object with the value of the `tag`. The type of the object depends on the data type in the data record. Raises ------ Raises: KeyError If `tag` is not present, a KeyError is raised. Loading pysam/libcalignmentfile.pyx +54 −56 Original line number Diff line number Diff line Loading @@ -1705,15 +1705,13 @@ cdef class AlignmentFile(HTSFile): ''' write a single :class:`pysam.AlignedSegment` to disk. Raises ------ Raises: ValueError if the writing failed Returns ------- int : the number of bytes written. If the file is closed, Returns: int : the number of bytes written. If the file is closed, this will be 0. ''' if not self.is_open: Loading Loading @@ -1800,10 +1798,10 @@ cdef class AlignmentFile(HTSFile): """return statistics about mapped/unmapped reads per chromosome as they are stored in the index. Returns ------- list : a list of records for each chromosome. Each record has the attributes 'contig', 'mapped', 'unmapped' and 'total'. Returns: list : a list of records for each chromosome. Each record has the attributes 'contig', 'mapped', 'unmapped' and 'total'. """ self.check_index() Loading Loading
.travis.yml +42 −20 Original line number Diff line number Diff line Loading @@ -4,6 +4,11 @@ os: language: c stages: - test - name: deploy if: tag IS present env: matrix: - CONDA_PY=2.7 Loading @@ -12,12 +17,26 @@ env: global: - PYSAM_LINKING_TEST=1 - TWINE_USERNAME=grepall - secure: 'OcwwP8/o21+SGW0UVAnnCQwllhGSCq2HJzpI9EhX3kh6J9RTkyx/+drkg45bx1Z5u8zymuAFappEYzlpzqZE886XezkjOYGVa/u+Coqr1oT/BEJHFCkCA4o26yESp7Zy8aNj/juhB7Rfa77pIDXBayqTzbALz/AURMtZapasB18=' - secure: bTbky3Un19NAl62lix8bMLmBv9IGNhFkRXlZH+B253nYub7jwQwPQKum3ct9ea+XHJT5//uM0B8WAF6eyugpNkPQ7+S7SEH5BJuCt30nv6qvGhSO2AffZKeHEDnfW2kqGrivn87TqeomlSBlO742CD/V0wOIUwkTT9tutd+E7FU= _deploy_common: &deploy_common if: tag IS present _cibw_common: &cibw_common addons: {} install: - python3 -m pip install cibuildwheel twine - python3 -m pip install cibuildwheel>=1.1.0 twine script: - set -e - cibuildwheel --output-dir dist - twine check dist/* - twine upload --skip-existing dist/* _cibw_linux: &cibw_linux stage: deploy os: linux language: python python: '3.5' services: - docker <<: *cibw_common matrix: include: Loading @@ -25,11 +44,6 @@ matrix: os: linux language: python python: '3.5' services: - docker env: - CIBW_BEFORE_BUILD="yum install -y zlib-devel bzip2-devel xz-devel && pip install -r requirements.txt" - CIBW_ENVIRONMENT='HTSLIB_CONFIGURE_OPTIONS="--disable-libcurl"' addons: apt: packages: Loading @@ -37,28 +51,36 @@ matrix: - g++ - libcurl4-openssl-dev # for libcurl support in sdist - libssl-dev # for s3 support in sdist <<: *deploy_common install: - python3 -m pip install Cython twine script: - set -e - cibuildwheel --output-dir dist - python3 -m pip install Cython - python3 setup.py build_ext --inplace - python3 setup.py sdist - twine check dist/* - twine upload --skip-existing dist/* - <<: *cibw_linux env: - CIBW_BUILD="*_x86_64" - CIBW_BEFORE_BUILD="yum install -y zlib-devel bzip2-devel xz-devel && python -m pip install -r requirements.txt" - CIBW_ENVIRONMENT='HTSLIB_CONFIGURE_OPTIONS="--disable-libcurl"' - CIBW_REPAIR_WHEEL_COMMAND_LINUX='auditwheel repair -L . -w {dest_dir} {wheel}' - CIBW_TEST_COMMAND='python -c "import pysam"' - <<: *cibw_linux env: - CIBW_BUILD="*_i686" - CIBW_BEFORE_BUILD="yum install -y zlib-devel bzip2-devel xz-devel && python -m pip install -r requirements.txt" - CIBW_ENVIRONMENT='HTSLIB_CONFIGURE_OPTIONS="--disable-libcurl"' - CIBW_REPAIR_WHEEL_COMMAND_LINUX='auditwheel repair -L . -w {dest_dir} {wheel}' - CIBW_TEST_COMMAND='python -c "import pysam"' - stage: deploy os: osx language: generic env: - CIBW_BEFORE_BUILD="pip install -r requirements.txt" - CIBW_BEFORE_BUILD="python -m pip install -r requirements.txt" - CIBW_ENVIRONMENT='HTSLIB_CONFIGURE_OPTIONS="--disable-libcurl"' addons: {} <<: *deploy_common script: - set -e - cibuildwheel --output-dir dist - twine check dist/* - twine upload --skip-existing dist/* - CIBW_TEST_COMMAND='python -c "import pysam"' <<: *cibw_common addons: apt: Loading
doc/release.rst +20 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,26 @@ Release notes ============= 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 vars Release 0.15.3 ============== Loading
pysam/bcftools.py +1 −1 Original line number Diff line number Diff line from utils import PysamDispatcher from pysam.utils import PysamDispatcher BCFTOOLS_DISPATCH = [ "index", Loading
pysam/libcalignedsegment.pyx +89 −88 Original line number Diff line number Diff line Loading @@ -924,7 +924,8 @@ cdef class AlignedSegment: Parameters ---------- header -- :class:`~pysam.AlignmentHeader` object to map numerical header: :class:`~pysam.AlignmentHeader` object to map numerical identifiers to chromosome names. If not given, an empty header is created. ''' Loading Loading @@ -999,6 +1000,10 @@ cdef class AlignedSegment: <,=,> to *other* ''' # avoid segfault when other equals None if other is None: return -1 cdef int retval, x cdef bam1_t *t cdef bam1_t *o Loading Loading @@ -1088,7 +1093,8 @@ cdef class AlignedSegment: Parameters ---------- sam -- :term:`SAM` formatted string sam: :term:`SAM` formatted string """ cdef AlignedSegment dest = cls.__new__(cls) Loading @@ -1110,7 +1116,8 @@ cdef class AlignedSegment: Parameters ---------- htsfile -- (deprecated) AlignmentFile object to map numerical htsfile: (deprecated) AlignmentFile object to map numerical identifiers to chromosome names. This parameter is present for backwards compatibility and ignored. """ Loading @@ -1133,7 +1140,8 @@ cdef class AlignedSegment: Parameters ---------- sam_dict -- dictionary of alignment values, keys corresponding to output from sam_dict: dictionary of alignment values, keys corresponding to output from :meth:`todict()`. """ Loading Loading @@ -2075,15 +2083,11 @@ cdef class AlignedSegment: If no cigar string is present, empty arrays will be returned. Parameters ---------- Returns ------- arrays : two arrays. The first contains the nucleotide counts within each cigar operation, the second contains the number of blocks for each cigar operation. Returns: arrays : two arrays. The first contains the nucleotide counts within each cigar operation, the second contains the number of blocks for each cigar operation. """ Loading Loading @@ -2406,24 +2410,21 @@ cdef class AlignedSegment: specification) as well as additional value type 'd' as implemented in htslib. Parameters ---------- Parameters: tag : data tag. with_value_type : Optional[bool] if set to True, the return value is a tuple of (tag value, type code). (default False) if set to True, the return value is a tuple of (tag value, type code). (default False) Returns ------- Returns: A python object with the value of the `tag`. The type of the object depends on the data type in the data record. Raises ------ Raises: KeyError If `tag` is not present, a KeyError is raised. Loading
pysam/libcalignmentfile.pyx +54 −56 Original line number Diff line number Diff line Loading @@ -1705,15 +1705,13 @@ cdef class AlignmentFile(HTSFile): ''' write a single :class:`pysam.AlignedSegment` to disk. Raises ------ Raises: ValueError if the writing failed Returns ------- int : the number of bytes written. If the file is closed, Returns: int : the number of bytes written. If the file is closed, this will be 0. ''' if not self.is_open: Loading Loading @@ -1800,10 +1798,10 @@ cdef class AlignmentFile(HTSFile): """return statistics about mapped/unmapped reads per chromosome as they are stored in the index. Returns ------- list : a list of records for each chromosome. Each record has the attributes 'contig', 'mapped', 'unmapped' and 'total'. Returns: list : a list of records for each chromosome. Each record has the attributes 'contig', 'mapped', 'unmapped' and 'total'. """ self.check_index() Loading