[med-svn] [Git][med-team/python-pybedtools][master] 6 commits: New upstream version 0.9.0
Andreas Tille (@tille)
gitlab at salsa.debian.org
Thu Feb 17 14:27:00 GMT 2022
Andreas Tille pushed to branch master at Debian Med / python-pybedtools
Commits:
a8bd8028 by Andreas Tille at 2022-02-17T15:12:51+01:00
New upstream version 0.9.0
- - - - -
fe64c75c by Andreas Tille at 2022-02-17T15:12:51+01:00
routine-update: New upstream version
- - - - -
53d78c46 by Andreas Tille at 2022-02-17T15:13:15+01:00
Update upstream source from tag 'upstream/0.9.0'
Update to upstream version '0.9.0'
with Debian dir f03221a30af4322aea9b2f5d86759408b0e2da21
- - - - -
fe6d2a73 by Andreas Tille at 2022-02-17T15:21:17+01:00
Update patches
- - - - -
d3594f0a by Andreas Tille at 2022-02-17T15:24:19+01:00
Upload to unstable
- - - - -
1c1546f4 by Andreas Tille at 2022-02-17T15:26:36+01:00
Drop lintian-overrides
- - - - -
28 changed files:
- .github/workflows/main.yml
- − .travis.yml
- LICENSE.txt
- − condatest.sh
- debian/changelog
- debian/patches/add_missing_shebang.patch
- − debian/pybedtools-bin.lintian-overrides
- docs/source/changes.rst
- docs/source/index.rst
- docs/source/main.rst
- pybedtools/__init__.py
- pybedtools/bedtool.py
- pybedtools/cbedtools.pyx
- pybedtools/contrib/long_range_interaction.py
- pybedtools/contrib/venn_maker.py
- pybedtools/helpers.py
- pybedtools/include/bedFile.cpp
- pybedtools/include/bedFile.h
- pybedtools/include/fileType.cpp
- pybedtools/include/fileType.h
- pybedtools/scripts/annotate.py
- pybedtools/scripts/examples/pbt_plotting_example.py
- pybedtools/scripts/intron_exon_reads.py
- pybedtools/test/test_1.py
- pybedtools/test/test_gzip_support.py
- pybedtools/test/test_issues.py
- pybedtools/test/test_iter.py
- setup.py
Changes:
=====================================
.github/workflows/main.yml
=====================================
@@ -5,7 +5,7 @@ jobs:
build-and-test:
strategy:
matrix:
- python-version: [3.6, 3.7, 3.8]
+ python-version: [3.6, 3.7, 3.8, 3.9]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout at v2
@@ -124,7 +124,7 @@ jobs:
- name: push docs to gh-pages branch
# Push docs to gh-pages if this test is running on master branch
- if: ${{ github.ref == 'refs/heads/master' }}
+ if: ${{ (github.ref == 'refs/heads/master') && (matrix.python-version == 3.8) }}
run: |
cd /tmp/docs
git push "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY" gh-pages
=====================================
.travis.yml deleted
=====================================
@@ -1,44 +0,0 @@
-# os:
-# - linux
-# - osx
-
-# make edits to this line to trigger a new travis build.
-# (sometimes it errors out trying to download from PyPI)
-language: python
-
-# see https://github.com/travis-ci/travis-ci/issues/9815 for py3.7 support
-matrix:
- include:
- - python: 3.6
- - python: 3.7
- - python: 3.8
- dist: xenial
- sudo: true
-
-notifications:
- email:
- recipients:
- - ryankdale at gmail.com
- - dalerr at niddk.nih.gov
- on_success: always
- on_failure: always
-
-services:
- - xvfb
-
-# Most of this is from http://conda.pydata.org/docs/travis.html
-install:
- - if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
- wget https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh;
- else
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
- fi
- - bash miniconda.sh -b -p $HOME/miniconda
- - export PATH="$HOME/miniconda/bin:$PATH"
- - hash -r
- - conda config --set always_yes yes --set changeps1 no
- - conda update -q conda
- - conda info -a
-
-script:
- - ./condatest.sh "$TRAVIS_PYTHON_VERSION"
=====================================
LICENSE.txt
=====================================
@@ -1,19 +1,22 @@
-Wrapper for Aaron Quinlan's BEDtools, plus other useful methods for working
-with BED, BAM, GFF, and VCF files
+Wrapper -- and more -- for BEDtools
-Copyright (c) 2010-2015 Ryan Dale
+Copyright (c) 2010-2022 Ryan Dale
All rights reserved.
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
-You should have received a copy of the GNU General Public License along
-with this program; if not, write to the Free Software Foundation, Inc., 51
-Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
=====================================
condatest.sh deleted
=====================================
@@ -1,122 +0,0 @@
-#!/bin/bash
-
-set -e
-
-PY_VERSION=$1
-
-usage="Usage: $0 py_version[2|3]"
-: ${PY_VERSION:?$usage}
-
-
-log () {
- echo
- echo "[`date`] TEST HARNESS: $1"
- echo
-}
-
-
-eval "$(conda shell.bash hook)"
-
-# ----------------------------------------------------------------------------
-# sdist and pip install tests
-# ----------------------------------------------------------------------------
-# Build an environment with just Python and Cython. We do this fresh each time.
-log "building fresh environment with just python and cython"
-with_cy="pbtpy${PY_VERSION}_sdist_cython"
-if conda env list | grep -q $with_cy; then
- conda env remove -y -n $with_cy
-fi
-conda create -n $with_cy -y --channel conda-forge --channel bioconda python=${PY_VERSION} cython
-conda activate $with_cy
-
-# Clone the repo -- so we're only catching things committed to git -- into
-# a temp dir
-log "cloning into temp dir"
-HERE="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-TMP=/tmp/pybedtools-deploy
-rm -rf $TMP
-git clone $HERE $TMP
-cd $TMP
-
-log "cythonizing source files and building source package"
-# Cythonize the .pyx filex to .cpp, and build a source package
-python setup.py clean cythonize sdist
-
-log "installing source package with pip"
-# Install into the environment to verify that everything works (just an import
-# test)
-(cd dist && pip install pybedtools-*.tar.gz && python -c 'import pybedtools; print(pybedtools.__file__)')
-
-
-# ----------------------------------------------------------------------------
-# Unit tests
-# ----------------------------------------------------------------------------
-# Deactivate that env, and build another one with all requirements that we'll
-# use for unit tests.
-conda deactivate
-no_cy="pbtpy${PY_VERSION}_conda_no_cython"
-if ! conda env list | grep -q $no_cy; then
- log "creating environment"
-
- # conflicts with pysam in bioconda for py37 or py38 so remove it from
- # conda requirements; allow to install from pip
- TMPREQS=$(tempfile)
- REQS=requirements.txt
- if [[ "$PY_VERSION" == "3.7" ]]; then
- grep -v pysam requirements.txt > $TMPREQS
- REQS=$TMPREQS
- fi
-
- if [[ "$PY_VERSION" == "3.8" ]]; then
- grep -v pysam requirements.txt > $TMPREQS
- REQS=$TMPREQS
- fi
-
- # genomepy>=0.8 not available for py27
- TMPOPTREQS=$(tempfile)
- grep -v genomepy optional-requirements.txt > $TMPOPTREQS
- if [[ "$PY_VERSION" == "2.7" ]]; then
- OPTREQS=$TMPOPTREQS
- else
- OPTREQS=optional-requirements.txt
- fi
-
- conda create -n $no_cy -y \
- --channel conda-forge \
- --channel bioconda \
- python=${PY_VERSION} \
- --file $REQS \
- --file test-requirements.txt \
- --file $OPTREQS
-else
- echo "Using existing environment '${no_cy}'"
-fi
-source activate $no_cy
-
-log "unpacking source package and install with pip install -e into $no_cy env"
-mkdir -p /tmp/pybedtools-uncompressed
-cd /tmp/pybedtools-uncompressed
-tar -xf $TMP/dist/pybedtools-*.tar.gz
-cd pybedtools-*
-pip install -e .
-
-# The import manipulation in genomepy tests conflicts with the import
-# manipulation in test_helpers and test_issues. So run in its own separate
-# pytests process.
-log "Unit tests"
-pytest -v --doctest-modules
-pytest -v pybedtools/test/genomepy_integration.py
-
-# ----------------------------------------------------------------------------
-# sphinx doctests
-# ----------------------------------------------------------------------------
-# Since the docs aren't included in the MANIFEST and therefore aren't included
-# in the source distribution, we copy them over from the repo we checked out.
-log "copying over docs directory from repo"
-cp -r $TMP/docs .
-
-# numpydoc is not supported in py27, so we can't run doctests.
-if [[ "$PY_VERSION" != "2.7" ]]; then
- log "sphinx doctests"
- (cd docs && make clean doctest)
-fi
=====================================
debian/changelog
=====================================
@@ -1,9 +1,15 @@
-python-pybedtools (0.8.2-2) UNRELEASED; urgency=medium
+python-pybedtools (0.9.0-2) UNRELEASED; urgency=medium
+
+ * Drop lintian-overrides
+
+ -- Andreas Tille <tille at debian.org> Thu, 17 Feb 2022 15:26:18 +0100
+
+python-pybedtools (0.9.0-1) unstable; urgency=medium
* Team upload.
* Enable uscan downloading sensible file name
- -- Andreas Tille <tille at debian.org> Wed, 20 Oct 2021 09:13:04 +0200
+ -- Andreas Tille <tille at debian.org> Thu, 17 Feb 2022 15:21:29 +0100
python-pybedtools (0.8.2-1) unstable; urgency=medium
=====================================
debian/patches/add_missing_shebang.patch
=====================================
@@ -12,9 +12,8 @@ Description: Add missing shebang lines
--- a/pybedtools/scripts/examples/pbt_plotting_example.py
+++ b/pybedtools/scripts/examples/pbt_plotting_example.py
-@@ -1,5 +1,4 @@
+@@ -1,4 +1,4 @@
-#!/usr/bin/env python
--from __future__ import print_function
+#!/usr/bin/python3
import time
import os
=====================================
debian/pybedtools-bin.lintian-overrides deleted
=====================================
@@ -1,10 +0,0 @@
-# Better not messing with the community which expects these executables
-# just the ways these are.
-# see https://lists.debian.org/debian-med/2018/06/msg00043.html
-pybedtools-bin: script-with-language-extension usr/bin/annotate.py
-pybedtools-bin: script-with-language-extension usr/bin/intersection_matrix.py
-pybedtools-bin: script-with-language-extension usr/bin/intron_exon_reads.py
-pybedtools-bin: script-with-language-extension usr/bin/peak_pie.py
-pybedtools-bin: script-with-language-extension usr/bin/venn_gchart.py
-pybedtools-bin: script-with-language-extension usr/bin/venn_mpl.py
-
=====================================
docs/source/changes.rst
=====================================
@@ -3,6 +3,35 @@
Changelog
=========
+Changes in v0.9
+---------------
+
+2022-01-23
+
+The biggest change is that pybedtools is now under the MIT license, following
+the lead of BEDTools itself.
+
+Bugfixes:
+
+* Bugfix: `Interval` objects representing VCF lines now have their `start`
+ attribute correctly zero-based, as indicated in the docs and consistent with
+ other 1-based formats. See `#355 <https://github.com/daler/pybedtools/issues/355>`_.
+* Bugfix: Manually creating `Interval` objects using the `otherfields` argument
+ now correctly converts to C++ strings. See `#348
+ <https://github.com/daler/pybedtools/issues/348>`_.
+* Bugfix: Workaround for `BedTool.intersect` which in some versions of BEDTools
+ requires a specific order of arguments. Fixes `#345
+ <https://github.com/daler/pybedtools/issues/345>`_ and also is a better way
+ of addressing `#81 <https://github.com/daler/pybedtools/issues/81>`_.
+
+Code cleanup:
+
+* Removed some remnants of Python 2.7 support (thanks @DavidCain)
+* Updates to setup.py classifiers to better reflect state of code (thanks @DavidCain)
+* Sorted filenames in setup.py to improve reproducibility of build (thanks @lamby)
+* Tests converted to run on GitHub Actions (see `#339
+ <https://github.com/daler/pybedtools/pull/339>`_).
+
Changes in v0.8.2
-----------------
=====================================
docs/source/index.rst
=====================================
@@ -12,8 +12,9 @@
-`pybedtools` is released under the GPLv2 license; see LICENSE.txt for more
-info.
+As of 2022, `pybedtools` is released under the MIT license; see LICENSE.txt for
+more info.
+
.. note::
=====================================
docs/source/main.rst
=====================================
@@ -26,7 +26,7 @@ environments.
Required
++++++++
-:Python_: version 2.7 or greater (Python 3 is supported). If you're setting up
+:Python_: version 3.6 or greater (Python 3 is supported). If you're setting up
Python for the first time, the `Anaconda Python distribution
<http://continuum.io/downloads>`_ is highly recommended.
=====================================
pybedtools/__init__.py
=====================================
@@ -1,4 +1,3 @@
-from __future__ import print_function
import os
import sys
import subprocess
=====================================
pybedtools/bedtool.py
=====================================
@@ -1,4 +1,3 @@
-from __future__ import print_function, division
import tempfile
from textwrap import dedent
import shutil
@@ -110,6 +109,7 @@ def _wraps(
genome_if=None,
genome_ok_if=None,
does_not_return_bedtool=None,
+ arg_order=None,
):
"""
Do-it-all wrapper, to be used as a decorator.
@@ -176,6 +176,10 @@ def _wraps(
and `kwargs` are passed verbatim from the wrapped method call. Some
examples of methods that use this are jaccard, reldist, fisher, and split
methods.
+
+ *arg_order*, if not None, is a sorted list of arguments. This is used by
+ handle_kwargs() to deal with things like issues 81 and 345, where some
+ BEDTools programs are sensitive to argument order.
"""
# NOTE: We are calling each BEDTools program to get its help and adding
@@ -358,7 +362,9 @@ def _wraps(
# At runtime, this will parse the kwargs, convert streams to
# tempfiles if needed, and return all the goodies
- cmds, tmp, stdin = self.handle_kwargs(prog=prog, **kwargs)
+ cmds, tmp, stdin = self.handle_kwargs(prog=prog,
+ arg_order=arg_order,
+ **kwargs)
# Decide whether the output is BAM format or not.
result_is_bam = False
@@ -1419,13 +1425,16 @@ class BedTool(object):
out_.write(str(i))
return fn
- def handle_kwargs(self, prog, **kwargs):
+ def handle_kwargs(self, prog, arg_order, **kwargs):
"""
Handle most cases of BEDTool program calls, but leave the specifics
up to individual methods.
*prog* is a BEDTools program name, e.g., 'intersectBed'.
+ *arg_order* lists any arguments that are sensitive to order. Everything
+ else will be reverse-sorted.
+
*kwargs* are passed directly from the calling method (like
self.intersect).
@@ -1547,7 +1556,17 @@ class BedTool(object):
# Parse the kwargs into BEDTools-ready args
cmds = [prog]
- # FIXME: the reverse-sort is a temp fix for issue #81.
+ # arg_order mechanism added to fix #345
+ if arg_order is None:
+ arg_order = []
+
+ for arg in arg_order:
+ if arg in kwargs:
+ val = kwargs.pop(arg)
+ cmds.append("-" + arg)
+ cmds.append(val)
+
+ # The reverse-sort is a temp fix for issue #81
for key, value in sorted(list(kwargs.items()), reverse=True):
if isinstance(value, bool):
if value:
@@ -1648,7 +1667,8 @@ class BedTool(object):
if isinstance(self.fn, six.string_types):
i = IntervalIterator(open(self.fn, "r"))
else:
- i = IntervalIterator(self.fn)
+ tmp = self.saveas()
+ i = IntervalIterator(open(tmp.fn, "r"))
def _generator():
while True:
@@ -1850,7 +1870,8 @@ class BedTool(object):
bedtobam = to_bam
@_log_to_history
- @_wraps(prog="intersectBed", implicit="a", other="b", bam="abam", nonbam="bed")
+ @_wraps(prog="intersectBed", implicit="a", other="b", bam="abam",
+ nonbam="bed", arg_order=["a", "abam"])
def intersect(self):
"""
Wraps `bedtools intersect`.
@@ -2460,7 +2481,7 @@ class BedTool(object):
unionbedg = union_bedgraphs
@_log_to_history
- @_wraps(prog="windowMaker", uses_genome=True, genome_none_if=["b"], other="b")
+ @_wraps(prog="windowMaker", uses_genome=True, genome_none_if=["b"], other="b", arg_order=["w"])
def window_maker(self):
"""
Wraps `bedtools makewindows`.
=====================================
pybedtools/cbedtools.pyx
=====================================
@@ -245,6 +245,7 @@ cdef class Interval:
def __init__(self, chrom, start, end, name=".", score=".", strand=".", otherfields=None):
if otherfields is None:
otherfields = []
+ otherfields = [_cppstr(i) for i in otherfields]
self._bed = new BED(
_cppstr(chrom), start, end, _cppstr(name), _cppstr(score),
_cppstr(strand), otherfields)
@@ -256,7 +257,7 @@ cdef class Interval:
#self._bed.score = _cppstr(score)
#self._bed.strand = _cppstr(strand)
fields = [_cppstr(chrom), _cppstr(str(start)), _cppstr(str(end)), _cppstr(name), _cppstr(score), _cppstr(strand)]
- fields.extend([_cppstr(i) for i in otherfields])
+ fields.extend(otherfields)
self._bed.fields = fields
self._attrs = None
@@ -675,8 +676,8 @@ cpdef Interval create_interval_from_list(list fields):
elif isdigit(fields[1]) and not isdigit(fields[3]) and len(fields) >= 8:
pyb._bed = new BED(
_cppstr(fields[0]),
+ int(fields[1]) - 1,
int(fields[1]),
- int(fields[1]) + 1,
_cppstr(fields[2]),
_cppstr(fields[5]),
_cppstr('.'),
=====================================
pybedtools/contrib/long_range_interaction.py
=====================================
@@ -1,4 +1,3 @@
-from __future__ import print_function
import os
import sys
import itertools
=====================================
pybedtools/contrib/venn_maker.py
=====================================
@@ -4,7 +4,6 @@ Interface between pybedtools and the R package VennDiagram.
Rather than depend on the user to have rpy2 installed, this simply writes an
R script that can be edited and tweaked by the user before being run in R.
"""
-from __future__ import print_function
import os
import string
import pybedtools
=====================================
pybedtools/helpers.py
=====================================
@@ -1,4 +1,3 @@
-from __future__ import print_function
import sys
import os
import gzip
@@ -426,6 +425,7 @@ def call_bedtools(
"is filename (%s)",
tmpfn,
)
+ cmds = list(map(str, cmds))
logger.debug("helpers.call_bedtools(): cmds=%s", " ".join(cmds))
outfile = open(tmpfn, "wb")
p = subprocess.Popen(
=====================================
pybedtools/include/bedFile.cpp
=====================================
@@ -7,7 +7,7 @@ Department of Biochemistry and Molecular Genetics
University of Virginia
aaronquinlan at gmail.com
-Licensed under the GNU General Public License 2.0 license.
+Licensed under the MIT license (as of Jan 2022)
******************************************************************************/
#include "bedFile.h"
=====================================
pybedtools/include/bedFile.h
=====================================
@@ -7,7 +7,7 @@
University of Virginia
aaronquinlan at gmail.com
- Licensed under the GNU General Public License 2.0 license.
+ Licensed under the MIT license (as of Jan 2022)
******************************************************************************/
#ifndef BEDFILE_H
#define BEDFILE_H
=====================================
pybedtools/include/fileType.cpp
=====================================
@@ -7,7 +7,7 @@
University of Virginia
aaronquinlan at gmail.com
- Licensed under the GNU General Public License 2.0 license.
+ Licensed under the MIT license (as of Jan 2022)
******************************************************************************/
#include "fileType.h"
=====================================
pybedtools/include/fileType.h
=====================================
@@ -7,7 +7,7 @@
University of Virginia
aaronquinlan at gmail.com
- Licensed under the GNU General Public License 2.0 license.
+ Licensed under the MIT license (as of Jan 2022)
******************************************************************************/
#ifndef FILETYPE_H
#define FILETYPE_H
=====================================
pybedtools/scripts/annotate.py
=====================================
@@ -120,7 +120,7 @@ def add_xstream(a, b, dist, updown, report_distance=False):
def main():
"""
- annotate a file with the neearest features in another.
+ annotate a file with the nearest features in another.
"""
p = argparse.ArgumentParser(description=__doc__, prog=sys.argv[0])
p.add_argument("-a", dest="a", help="file to annotate")
=====================================
pybedtools/scripts/examples/pbt_plotting_example.py
=====================================
@@ -1,5 +1,4 @@
#!/usr/bin/env python
-from __future__ import print_function
import time
import os
import pybedtools
=====================================
pybedtools/scripts/intron_exon_reads.py
=====================================
@@ -7,7 +7,6 @@ multiple CPUs.
Prints a tab-separated file containing class (exon, intron, both) and number of
reads in each class.
"""
-from __future__ import print_function
import pybedtools
import argparse
import os
=====================================
pybedtools/test/test_1.py
=====================================
@@ -1,4 +1,3 @@
-from __future__ import print_function
import pybedtools
import gzip
import os, difflib, sys
=====================================
pybedtools/test/test_gzip_support.py
=====================================
@@ -1,7 +1,3 @@
-from __future__ import absolute_import
-from __future__ import division
-from __future__ import print_function
-from __future__ import unicode_literals
import os
import tempfile
import pybedtools.test.tfuncs as tfuncs
=====================================
pybedtools/test/test_issues.py
=====================================
@@ -1,4 +1,3 @@
-from __future__ import print_function
import pybedtools
import gzip
import os
@@ -469,13 +468,6 @@ def test_issue_196():
def test_issue_178():
- # Compatibility between py2/py3: py27 does not have FileNotFoundError, so
- # set it to IOError (which does exist) for this function.
- try:
- FileNotFoundError
- except NameError:
- FileNotFoundError = IOError
-
try:
fn = pybedtools.example_filename("gdc.othersort.bam")
pybedtools.contrib.bigwig.bam_to_bigwig(fn, genome="dm3", output="tmp.bw")
@@ -560,7 +552,7 @@ def test_issue_217():
assert x.name == "feature1"
- # Previously the directly-created Interval object retuned None for a name.
+ # Previously the directly-created Interval object returned None for a name.
assert y.name == "feature1"
assert z.name == "feature1"
@@ -824,3 +816,44 @@ def test_issue_333():
# Previously would raise EmptyDataError:
a.to_dataframe()
+
+
+def test_issue_343():
+ def shift_bed(f, shift):
+ f.start += shift
+ f.stop += shift
+ return f
+
+ a = pybedtools.example_bedtool('a.bed')
+
+ # The fix was to ensure that BedTool.remove_invalid() is always working
+ # with a file-based BedTool (whcih means calling .saveas() if needed)
+ (
+ a
+ .each(shift_bed, -200)
+ .remove_invalid()
+ .sort()
+ )
+
+
+def test_issue_345():
+ a = pybedtools.example_bedtool('a.bed')
+ b = pybedtools.example_bedtool('b.bed')
+ c = pybedtools.example_bedtool('c.gff')
+
+ z = a.intersect(b=[b.fn,c.fn], C=True, filenames=True)
+
+ # assert " ".join(z._cmds) == f'intersectBed -filenames -b {b.fn} {c.fn} -a {a.fn} -C'
+ assert " ".join(z._cmds) == f'intersectBed -a {a.fn} -filenames -b {b.fn} {c.fn} -C'
+
+def test_issue_348():
+ i = pybedtools.Interval('chr1', 1, 100, 'feature1', '.', '.', otherfields=['f1'])
+
+
+def test_issue_355():
+ vcf = pybedtools.example_bedtool('v.vcf')
+ for line in open(vcf.fn):
+ if not line.startswith('#'):
+ break
+ assert line.split('\t')[1] == '14'
+ assert vcf[0].start == 13
=====================================
pybedtools/test/test_iter.py
=====================================
@@ -1,4 +1,3 @@
-from __future__ import print_function
import difflib
import copy
import itertools
=====================================
setup.py
=====================================
@@ -76,8 +76,8 @@ import distutils.log
MAJ = 0
-MIN = 8
-REV = 2
+MIN = 9
+REV = 0
VERSION = '%d.%d.%d' % (MAJ, MIN, REV)
@@ -246,7 +246,7 @@ extensions = [
depends=glob.glob('pybedtools/include/*h'),
libraries=['stdc++', 'z'],
include_dirs=['pybedtools/include/'],
- sources=['pybedtools/cbedtools' + EXT] + glob.glob('pybedtools/include/*.cpp'),
+ sources=['pybedtools/cbedtools' + EXT] + sorted(glob.glob('pybedtools/include/*.cpp')),
language='c++'),
Extension(
@@ -254,7 +254,7 @@ extensions = [
depends=glob.glob('pybedtools/include/*h'),
libraries=['stdc++', 'z'],
include_dirs=['pybedtools/include/'],
- sources=['pybedtools/featurefuncs' + EXT] + glob.glob('pybedtools/include/*.cpp'),
+ sources=['pybedtools/featurefuncs' + EXT] + sorted(glob.glob('pybedtools/include/*.cpp')),
language='c++'),
]
@@ -298,16 +298,15 @@ if __name__ == "__main__":
setup_requires=[],
install_requires=['six', 'pysam'],
classifiers=[
- 'Development Status :: 4 - Beta',
+ 'Development Status :: 5 - Production/Stable',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: GNU General Public License (GPL)',
'Topic :: Scientific/Engineering :: Bio-Informatics',
'Programming Language :: Python',
- 'Programming Language :: Python :: 2',
- 'Programming Language :: Python :: 2.6',
- 'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
- 'Programming Language :: Python :: 3.3',
+ 'Programming Language :: Python :: 3.6',
+ 'Programming Language :: Python :: 3.7',
+ 'Programming Language :: Python :: 3.8',
'Topic :: Software Development :: Libraries :: Python Modules',
],
cmdclass=cmdclass,
View it on GitLab: https://salsa.debian.org/med-team/python-pybedtools/-/compare/81c8051936e0f7b015cc997a2e4d99a874883126...1c1546f423ab564b3b7d36e338523bc7d0f0725a
--
View it on GitLab: https://salsa.debian.org/med-team/python-pybedtools/-/compare/81c8051936e0f7b015cc997a2e4d99a874883126...1c1546f423ab564b3b7d36e338523bc7d0f0725a
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20220217/adcebd5f/attachment-0001.htm>
More information about the debian-med-commit
mailing list