Skip to content

Commit

Permalink
Update bedtools version to 2.27.1
Browse files Browse the repository at this point in the history
  • Loading branch information
afrendeiro committed Sep 10, 2019
1 parent f26e791 commit 1294ed3
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 13 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ services:
- xvfb

before_install:
- wget http://ftp.debian.org/debian/pool/main/b/bedtools/bedtools_2.21.0-1_amd64.deb
- sudo dpkg -i bedtools_2.21.0-1_amd64.deb
- sudo apt-get -y install bedtools=2.27.1+dfsg-4
- sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
- sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/'
- sudo apt-get update
Expand Down
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ RUN apt-get update \
&& rm -rf /var/lib/apt/lists/*

# Install specific bedtools version
RUN wget http://ftp.debian.org/debian/pool/main/b/bedtools/bedtools_2.21.0-1_amd64.deb \
&& dpkg -i bedtools_2.21.0-1_amd64.deb \
&& rm bedtools_2.21.0-1_amd64.deb
RUN apt-get update \
&& apt-get install -t unstable -y --no-install-recommends \
bedtools=2.27.1+dfsg-4 \
&& rm -rf /tmp/downloaded_packages/ /tmp/*.rds \
&& rm -rf /var/lib/apt/lists/*

RUN apt-get update \
&& apt-get install -t unstable -y --no-install-recommends \
Expand Down
9 changes: 3 additions & 6 deletions docs/source/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Install non-Python dependencies:

.. code-block:: bash
conda install -y bedtools==2.20.1
conda install -y bedtools==2.27.1
conda install -y ucsc-twobittofa
conda install -y bioconductor-deseq2
conda install -y bioconductor-cqn
Expand All @@ -62,18 +62,15 @@ And then install the ``ngs-toolkit`` library with pip (available only through Py

``ngs_toolkit`` makes use of some non-Python dependencies.

- `bedtools <https://bedtools.readthedocs.io/en/latest/>`_: version should be at least 2.27.1

The following are highly recommended only for some data or analysis types:

- `bedtools <https://bedtools.readthedocs.io/en/latest/>`_: required for some ATAC/ChIP-seq functions. It is underlying the Python interface library to bedtools (pybedtools) which can be installed without bedtools.
- `R <https://www.r-project.org/>`_ and some bioconductor libraries (optional):

- `cqn <https://bioconductor.org/packages/release/bioc/html/cqn.html>`_ (optional): used for GC-content aware normalization of NGS data.
- `DESeq2 <https://bioconductor.org/packages/release/bioc/html/DESeq2.html>`_ (optional): used for differential testing of genes/regulatory elements.
- `Kent tools <https://github.com/ENCODE-DCC/kentUtils>`_ (optional): the 'twoBitToFa' binary from UCSC's Kent bioinformatics toolkit is used to convert between the 2bit and FASTA formats.

.. note::
``bedtools`` version should be below 2.24.0 (2.20.1 is used for testing)


Testing
=============================
Expand Down
17 changes: 17 additions & 0 deletions ngs_toolkit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,26 @@ def setup_timestamping():
exclude_functions=["from_dataframe"])


def check_bedtools_version():
import pybedtools

# not existing
v = ".".join([str(x) for x in pybedtools.helpers.settings.bedtools_version])
msg = "Bedtools does not seem to be installed or is not in $PATH."
if v == '':
raise Exception(msg)

# too low version
msg = "Bedtools version '{}' is smaller than 2.27.".format(v)
msg = " Please upgrade to newer version."
if not pybedtools.helpers.settings._v_2_27_plus:
raise Exception(msg)


# setup
_LOGGER = setup_logger()
_CONFIG = setup_config()
check_bedtools_version()
setup_graphic_preferences()
setup_timestamping()

Expand Down
4 changes: 2 additions & 2 deletions ngs_toolkit/atacseq.py
Original file line number Diff line number Diff line change
Expand Up @@ -731,14 +731,14 @@ def measure_coverage(
output_dir, s.name + ".{}_coverage.sh".format(peak_set_name)
)
cmd = (
"date\nbedtools coverage -counts -abam {bam} -b {bed} > {out}\ndate"
"date\nbedtools coverage -counts -a {bed} -b {bam} > {out}\ndate"
.format(bam=s.aligned_filtered_bam, bed=sites.fn, out=output_file))

submit_job(
cmd, job_file,
jobname=job_name,
logfile=log_file,
cores=1, mem=8000, time="04:00:00")
cores=1, mem=8000, time="04:00:00", **kwargs)

def collect_coverage(
self,
Expand Down

0 comments on commit 1294ed3

Please sign in to comment.