Commit 7a3cc3ff authored by Diane Trout's avatar Diane Trout
Browse files

New upstream version 0.3.11

parent c27585fb
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
Metadata-Version: 1.1
Name: pyBigWig
Version: 0.3.2
Version: 0.3.11
Summary: A package for accessing bigWig files using libBigWig
Home-page: https://github.com/dpryan79/pyBigWig
Author: Devon P. Ryan
Author-email: ryan@ie-freiburg.mpg.de
License: UNKNOWN
Download-URL: https://github.com/dpryan79/pyBigWig/tarball/0.3.2
Download-URL: https://github.com/dpryan79/pyBigWig/tarball/0.3.11
Description-Content-Type: UNKNOWN
Description: UNKNOWN
Keywords: bioinformatics,bigWig,bigBed
Platform: UNKNOWN
+15 −3
Original line number Diff line number Diff line
[![PyPI version](https://badge.fury.io/py/pyBigWig.svg)](https://badge.fury.io/py/pyBigWig) [![Travis-CI status](https://travis-ci.org/dpryan79/pyBigWig.svg?branch=master)](https://travis-ci.org/dpryan79/pyBigWig.svg?branch=master) [![bioconda-badge](https://img.shields.io/badge/install%20with-bioconda-brightgreen.svg)](http://bioconda.github.io) [![DOI](https://zenodo.org/badge/doi/10.5281/zenodo.45238.svg)](http://dx.doi.org/10.5281/zenodo.45238)
[![PyPI version](https://badge.fury.io/py/pyBigWig.svg)](https://badge.fury.io/py/pyBigWig) [![Travis-CI status](https://travis-ci.org/deeptools/pyBigWig.svg?branch=master)](https://travis-ci.org/dpryan79/pyBigWig.svg?branch=master) [![bioconda-badge](https://img.shields.io/badge/install%20with-bioconda-brightgreen.svg)](http://bioconda.github.io) [![DOI](https://zenodo.org/badge/doi/10.5281/zenodo.45238.svg)](http://dx.doi.org/10.5281/zenodo.45238)

# pyBigWig
A python extension, written in C, for quick access to and creation of bigWig files. This extension uses [libBigWig](https://github.com/dpryan79/libBigWig) for local and remote file access.
A python extension, written in C, for quick access to bigBed files and access to and creation of bigWig files. This extension uses [libBigWig](https://github.com/dpryan79/libBigWig) for local and remote file access.

Table of Contents
=================
@@ -21,7 +21,9 @@ Table of Contents
    * [Add a header to a bigWig file](#add-a-header-to-a-bigwig-file)
    * [Adding entries to a bigWig file](#adding-entries-to-a-bigwig-file)
    * [Close a bigWig or bigBed file](#close-a-bigwig-or-bigbed-file)
  * [Numpy](#Numpy)
  * [Numpy](#numpy)
  * [Remote file access](#remote-file-access)
  * [Empty files](#empty-files)
  * [A note on coordinates](#a-note-on-coordinates)
  * [Galaxy](#galaxy)

@@ -296,6 +298,16 @@ Additionally, `values()` can directly output a numpy vector:
    >>> type(bw.values('1', 0, 10, numpy=True))
    <type 'numpy.ndarray'>

# Remote file access

If you do not have curl installed, pyBigWig will be installed without the ability to access remote files. You can determine if you will be able to access remote files with `pyBigWig.remote`. If that returns 1, then you can access remote files. If it returns 0 then you can't.

# Empty files

As of version 0.3.5, pyBigWig is able to read and write bigWig files lacking entries. Please note that such files are generally not compatible with other programs, since there's no definition of how a bigWig file with no entries should look. For such a file, the `intervals()` accessor will return `None`, the `stats()` function will return a list of `None` of the desired length, and `values()` will return `[]` (an empty list). This should generally allow programs utilizing pyBigWig to continue without issue.

For those wishing to mimic the functionality of pyBigWig/libBigWig in this regard, please note that it looks at the number of bases covered (as reported in the file header) to check for "empty" files.

# A note on coordinates

Wiggle, bigWig, and bigBed files use 0-based half-open coordinates, which are also used by this extension. So to access the value for the first base on `chr1`, one would specify the starting position as `0` and the end position as `1`. Similarly, bases 100 to 115 would have a start of `99` and an end of `115`. This is simply for the sake of consistency with the underlying bigWig file and may change in the future.
+1 −1
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ The only functions and structures that end users need to care about are in "bigW
        //Open the local/remote file
        fp = bwOpen(argv[1], NULL, "r");
        if(!fp) {
            fprintf(stderr, "An error occured while opening %s\n", argv[1]);
            fprintf(stderr, "An error occurred while opening %s\n", argv[1]);
            return 1;
        }

+23 −11
Original line number Diff line number Diff line
#include "io.h"
#include "bigWigIO.h"
#include "bwValues.h"
#include <inttypes.h>
#include <zlib.h>
@@ -53,7 +53,18 @@ extern "C" {
/*!
 * The library version number
 */
#define LIBBIGWIG_VERSION 0.3.0
#define LIBBIGWIG_VERSION 0.4.2

/*!
 * If 1, then this library was compiled with remote file support.
 */
#ifdef NOCURL
#define LIBBIGWIG_CURL 0
typedef int CURLcode;
typedef void CURL;
#else
#define LIBBIGWIG_CURL 1
#endif

/*!
 * The magic number of a bigWig file.
@@ -84,15 +95,16 @@ extern "C" {
 * An enum that dictates the type of statistic to fetch for a given interval
 */
enum bwStatsType {
    doesNotExist = -1,
    mean = 0,
    average = 0,
    stdev = 1,
    dev = 1,
    max = 2,
    min = 3,
    cov = 4,
    coverage = 4
    doesNotExist = -1, /*!< This does nothing */
    mean = 0, /*!< The mean value */
    average = 0, /*!< The mean value */
    stdev = 1, /*!< The standard deviation of the values */
    dev = 1, /*!< The standard deviation of the values */
    max = 2, /*!< The maximum value */
    min = 3, /*!< The minimum value */
    cov = 4, /*!< The number of bases covered */
    coverage = 4, /*!<The number of bases covered */ 
    sum = 5 /*!< The sum of per-base values */
};

//Should hide this from end users
+12 −1
Original line number Diff line number Diff line
#ifndef NOCURL
#include <curl/curl.h>
/*! \file io.h
#else
#include <stdio.h>
typedef int CURLcode;
typedef void CURL;
#define CURLE_OK 0
#define CURLE_FAILED_INIT 1
#endif
/*! \file bigWigIO.h
 * These are (typically internal) IO functions, so there's generally no need for you to directly use them!
 */

@@ -23,7 +31,9 @@ enum bigWigFile_type_enum {
 */
typedef struct {
    union {
#ifndef NOCURL
        CURL *curl; /**<The CURL * file pointer for remote files.*/
#endif
        FILE *fp; /**<The FILE * file pointer for local files.**/
    } x; /**<A union holding curl and fp.*/
    void *memBuf; /**<A void * pointing to memory of size bufSize.*/
@@ -32,6 +42,7 @@ typedef struct {
    size_t bufSize; /**<The size of the buffer.*/
    size_t bufLen; /**<The actual size of the buffer used.*/
    enum bigWigFile_type_enum type; /**<The connection type*/
    int isCompressed; /**<1 if the file is compressed, otherwise 0*/
    char *fname; /**<Only needed for remote connections. The original URL/filename requested, since we need to make multiple connections.*/
} URL_t;

Loading