Git Product home page Git Product logo

py2bit's Introduction

deepTools

Documentation Status PyPI Version install with bioconda European Galaxy server test

User-friendly tools for exploring deep-sequencing data

deepTools addresses the challenge of handling the large amounts of data that are now routinely generated from DNA sequencing centers. deepTools contains useful modules to process the mapped reads data for multiple quality checks, creating normalized coverage files in standard bedGraph and bigWig file formats, that allow comparison between different files (for example, treatment and control). Finally, using such normalized and standardized files, deepTools can create many publication-ready visualizations to identify enrichments and for functional annotations of the genome.

For support or questions please post to Biostars. For bug reports and feature requests please open an issue on github.

Citation:

Ramírez F, Ryan DP, Grüning B, Bhardwaj V, Kilpert F, Richter AS, Heyne S, Dündar F, Manke T. deepTools2: a next generation web server for deep-sequencing data analysis. Nucleic Acids Research. 2016 Apr 13:gkw257.

Documentation:

Our documentation contains more details on the individual tool scopes and usages and an introduction to our deepTools Galaxy web server including step-by-step protocols.

Please see also the FAQ, which we update regularly. Our Gallery may give you some more ideas about the scope of deepTools.

For more specific troubleshooting, feedback, and tool suggestions, please post to Biostars.


Installation

deepTools are available for:

  • Command line usage (via pip / conda / github)
  • Integration into Galaxy servers (via toolshed/API/web-browser)

There are many easy ways to install deepTools. More details can be found here.

In Brief:

Install through pypi

$ pip install deeptools

Install via conda

$ conda install -c bioconda deeptools

Install by cloning the repository

$ git clone https://github.com/deeptools/deepTools
$ cd deepTools
$ pip install .

Galaxy Installation

deepTools can be easily integrated into Galaxy. Please see the installation instructions in our documentation for further details.

Note: From version 2.3 onwards, deepTools support python3.


This tool suite is developed by the Bioinformatics Facility at the Max Planck Institute for Immunobiology and Epigenetics, Freiburg.

Documentation | deepTools Galaxy | FAQ

py2bit's People

Contributors

dpryan79 avatar kojix2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

py2bit's Issues

error during install: `python setup.py bdist_wheel did not run sucessfully`

When installing deeptools, it seems to keep failing due to py2bit, so I attempted installing py2bit alone first to see if it was the one causing problems.

when running pip install py2bit, it throws the following error:

Collecting py2bit
Using cached py2bit-0.3.0.tar.gz (16 kB)
Preparing metadata (setup.py) ... done
Building wheels for collected packages: py2bit
Building wheel for py2bit (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [45 lines of output]
/home/nickylauw/anaconda3/lib/python3.12/site-packages/setuptools/dist.py:452: SetuptoolsDeprecationWarning: Invalid dash-separated options
!!

          ********************************************************************************
          Usage of dash-separated 'description-file' will not be supported in future
          versions. Please use the underscore name 'description_file' instead.
  
          By 2024-Sep-26, you need to update your project and remove deprecated calls
          or your builds will no longer be supported.
  
          See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
          ********************************************************************************
  
  !!
    opt = self.warn_dash_deprecation(opt, section)
  /home/nickylauw/anaconda3/lib/python3.12/site-packages/setuptools/_distutils/dist.py:260: UserWarning: Unknown distribution option: 'classifier'
    warnings.warn(msg)
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-cpython-312
  creating build/lib.linux-x86_64-cpython-312/py2bitTest
  copying py2bitTest/__init__.py -> build/lib.linux-x86_64-cpython-312/py2bitTest
  copying py2bitTest/test.py -> build/lib.linux-x86_64-cpython-312/py2bitTest
  running egg_info
  writing py2bit.egg-info/PKG-INFO
  writing dependency_links to py2bit.egg-info/dependency_links.txt
  writing top-level names to py2bit.egg-info/top_level.txt
  reading manifest file 'py2bit.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  adding license file 'LICENSE.txt'
  writing manifest file 'py2bit.egg-info/SOURCES.txt'
  copying py2bitTest/foo.2bit -> build/lib.linux-x86_64-cpython-312/py2bitTest
  running build_ext
  building 'py2bit' extension
  creating build/temp.linux-x86_64-cpython-312
  creating build/temp.linux-x86_64-cpython-312/lib2bit
  gcc -pthread -B /home/nickylauw/anaconda3/compiler_compat -fno-strict-overflow -DNDEBUG -O2 -Wall -fPIC -O2 -isystem /home/nickylauw/anaconda3/include -fPIC -O2 -isystem /home/nickylauw/anaconda3/include -fPIC -Ilib2bit -I/home/nickylauw/anaconda3/include/python3.12 -I/home/nickylauw/anaconda3/include/python3.12 -c lib2bit/2bit.c -o build/temp.linux-x86_64-cpython-312/lib2bit/2bit.o
  gcc -pthread -B /home/nickylauw/anaconda3/compiler_compat -fno-strict-overflow -DNDEBUG -O2 -Wall -fPIC -O2 -isystem /home/nickylauw/anaconda3/include -fPIC -O2 -isystem /home/nickylauw/anaconda3/include -fPIC -Ilib2bit -I/home/nickylauw/anaconda3/include/python3.12 -I/home/nickylauw/anaconda3/include/python3.12 -c py2bit.c -o build/temp.linux-x86_64-cpython-312/py2bit.o
  py2bit.c: In function ‘py2bitEnter’:
  py2bit.c:35:24: error: initialization of ‘pyTwoBit_t *’ from incompatible pointer type ‘TwoBit *’ [-Wincompatible-pointer-types]
     35 |     pyTwoBit_t *pytb = self->tb;
        |                        ^~~~
  error: command '/sbin/gcc' failed with exit code 1
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for py2bit
Running setup.py clean for py2bit
Failed to build py2bit
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (py2bit)

Installing with pip install git+https://github.com/dpryan79/py2bit returns the same error.

Installing with conda install bioconda::py2bit is stuck for very long with the following message until I interrupt with ctrl + C

Collecting package metadata (current_repodata.json): - WARNING conda.models.version:get_matcher(563): Using .* with relational operator is superfluous and deprecated and will be removed in a future version of conda. Your spec was 1.7.1., but conda is ignoring the . and treating it as 1.7.1
done
Solving environment: - unsuccessful initial attempt using frozen solve. Retrying with flexible solve.

OS: Arch linux
Python version: 3.12.2
pip version: 24.2
conda version: 24.7.1

`py2bitTest/test.py::Test::testBases` fails with an `AssertionError`

[deco]~/src/py2bit ❱ pytest -vvs py2bitTest/test.py
=========================================================== test session starts ============================================================
platform linux -- Python 3.10.9, pytest-7.2.0, pluggy-1.0.0 -- /usr/bin/python3.10
cachedir: .pytest_cache
rootdir: /home/chymera/src/py2bit
plugins: pkgcore-0.12.18, mock-3.10.0, timeout-2.1.0
collected 7 items

py2bitTest/test.py::Test::testOpenClose PASSED
py2bitTest/test.py::Test::testChroms PASSED
py2bitTest/test.py::Test::testInfo PASSED
py2bitTest/test.py::Test::testSequence PASSED
py2bitTest/test.py::Test::testBases FAILED
py2bitTest/test.py::Test::testHardMaskedBlocks PASSED
py2bitTest/test.py::Test::testSoftMaskedBlocks PASSED

================================================================= FAILURES =================================================================
______________________________________________________________ Test.testBases ______________________________________________________________

self = <py2bitTest.test.Test object at 0x7f66a486c6a0>

    def testBases(self):
        tb = py2bit.open(self.fname, True)
        assert(tb.bases("chr1") == {'A': 0.08, 'C': 0.08, 'T': 0.08666666666666667, 'G': 0.08666666666666667})
        assert(tb.bases("chr1", 24, 74) == {'A': 0.12, 'C': 0.12, 'T': 0.12, 'G': 0.12})
        assert(tb.bases("chr1", 24, 74, False) == {'A': 6, 'C': 6, 'T': 6, 'G': 6})
>       assert(tb.bases("chr2", 10, 20) == {'A': 0.2, 'C': 0.2, 'T': 0.3, 'G': 0.3})
E       AssertionError: assert {'A': 0.16666666666666666, 'C': 0.16666666666666666, 'T': 0.25, 'G': 0.25} == {'A': 0.2, 'C': 0.2, 'T': 0.3, 'G': 0.3}
E         Differing items:
E         {'T': 0.25} != {'T': 0.3}
E         {'A': 0.16666666666666666} != {'A': 0.2}
E         {'C': 0.16666666666666666} != {'C': 0.2}
E         {'G': 0.25} != {'G': 0.3}
E         Full diff:
E         - {'A': 0.2, 'C': 0.2, 'G': 0.3, 'T': 0.3}
E         + {'A': 0.16666666666666666, 'C': 0.16666666666666666, 'G': 0.25, 'T': 0.25}

py2bitTest/test.py:45: AssertionError
========================================================= short test summary info ==========================================================
FAILED py2bitTest/test.py::Test::testBases - AssertionError: assert {'A': 0.16666666666666666, 'C': 0.16666666666666666, 'T': 0.25, 'G': 0.25} == {'A': 0.2, 'C': 0.2, 'T': 0.3, 'G'...
======================================================= 1 failed, 6 passed in 0.26s ========================================================
[deco]~/src/py2bit ❱ git rev-parse HEAD
697884f1c0b0bf4d3c9b82c4fa6a4445a2453c6c

Fix documentation

Currently there are some errors in the documentation (e.g., some of the examples are wrong). This should be corrected.

segmentation fault when reading sequence from ucsc hg38.2bit

Thanks for making py2bit available. Just gave it a try on UCSC hg38.2bit file (downloaded here), but got segmentation fault after a few tries:

Python 3.5.2 (default, Jul  5 2016, 12:43:10)
Type "copyright", "credits" or "license" for more information.

IPython 5.1.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: import py2bit

In [2]: tb = py2bit.open('~/Downloads/hg38.2bit')

In [3]: tb.sequence('chrX', 101349952, 101349954)
Out[3]: 'CT'

In [4]: tb.sequence('chrX', 101349952, 101349955)
Out[4]: 'CTT'

In [5]: tb.sequence('chrX', 101349953, 101349955)
[1]    2094 segmentation fault (core dumped)  ipython

The latest py2bit==0.2.0 was installed. Verified the same on Python 2.7.12.

Installation issue (zip_safe)

When installing deepTools with python 3.5, that has py2bit dependency I see the following error.

Searching for py2bit>=0.2.0
Reading https://pypi.python.org/simple/py2bit/
Downloading https://pypi.python.org/packages/f4/98/5fc4799e9b6717a80aa31efd09bb6ce8fbca87fae8985ca202129639ff24/py2bit-0.2.0.tar.gz#md5=c441eea85270dda8f502b389b6235518
Best match: py2bit 0.2.0
Processing py2bit-0.2.0.tar.gz
Writing /tmp/easy_install-0_f14xfi/py2bit-0.2.0/setup.cfg
Running py2bit-0.2.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-0_f14xfi/py2bit-0.2.0/egg-dist-tmp-hkoejrrm
/usr/lib/python3.5/distutils/dist.py:261: UserWarning: Unknown distribution option: 'classifier'
warnings.warn(msg)
zip_safe flag not set; analyzing archive contents...
py2bitTest.pycache.test.cpython-35: module references file
pycache.py2bit.cpython-35: module references file
No eggs found in /tmp/easy_install-0_f14xfi/py2bit-0.2.0/egg-dist-tmp-hkoejrrm (setup script problem?)
error: The 'py2bit>=0.2.0' distribution was not found and is required by deepTools

.sequence does not work well with int64

When I use the .sequence function, and start and/or stop are int64, I get this error:
RuntimeError: You must supply at least a chromosome!
The error disappears if I make sure to typecast to int before I call .sequence.

Profile code

py2bit takes ~3 times as long as lib2bit for the exact same thing. It'd be nice to do a bit of profiling to see if this is just a python limitation or if there's something that can be done about this.

Bases do not sum to one when sequence has no N's

Hi,

I'm running extraction of GC contents from 10bp bins and got curious when the percentages where not in [0.1, 0.2, 0.3, ...]. I get that N bases could cause this, but it seems that it happens even when the sequence only has ACGTs.

An example using HG38 reference:

# 10 bases - All ACGT
tb.sequence("chr1", 792530, 792540)  
>> 'CAACCTTCAG'

# Counts sum to 10
tb.bases("chr1", 792530, 792540, False)
>> {'A': 3, 'C': 4, 'T': 2, 'G': 1} 

# Would expect 3/10=0.3, 4/10=0.4, etc.
tb.bases("chr1", 792530, 792540) 
>> {'A': 0.25, 'C': 0.3333333333333333, 'T': 0.16666666666666666, 'G': 0.08333333333333333}

# Where did the remaining 0.1666 go?
sum(tb.bases("chr1", 792530, 792540).values()) 
>> 0.8333333333333333

What am I missing?

Edit: Is it dividing by 12 instead of 10? And if so, why?

Best,
Ludvig

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.