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

This extension is still under development and the functions may change. Note that compiling with `-O2` or `-O1` seems to result in errors, while `-O0` does not. The cause of this is currently unclear.

# Installation
You can install this extension directly from github with:

    pip install git+git://github.com/dpryan79/pyBigWig.git@libBigWig

# Usage
Basic usage is as follows:

## A note on coordinates

Wiggle and BigWig 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.

## Load the extension

    >>> import pyBigWig

## Open a bigWig file

This will work if your working directory is the pyBigWig source code directory.

    >>> bw = pyBigWig.open("test/test.bw")

Note that if the file doesn't exist you'll see an error message and `None` will be returned.

## Access the list of chromosomes and their lengths<commit_msg>Time to merge, hopefully pip will find the submodule now...<commit_after># pyBigWig
A python extension written in C for quick access to bigWig files. This extension uses [libBigWig](https://github.com/dpryan79/libBigWig) for local and remote file access.

This extension is still under development and the functions may change. Note that compiling with `-O2` or `-O1` seems to result in errors, while `-O0` does not. The cause of this is currently unclear.

# Installation
You can install this extension directly from github with:

    pip install git+git://github.com/dpryan79/pyBigWig.git

# Usage
Basic usage is as follows:

## A note on coordinates

Wiggle and BigWig 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.

## Load the extension

    >>> import pyBigWig

## Open a bigWig file

This will work if your working directory is the pyBigWig source code directory.

    >>> bw = pyBigWig.open("test/test.bw")

Note that if the file doesn't exist you'll see an error message and `None` will be returned.

## Access the list of chromosomes and their lengths
{'fraction_non_alphanumeric': 0.0652958152958153, 'fraction_numerical': 0.015873015873015872, 'mean_word_length': 4.0510018214936245, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2382799', 'n_tokens_mistral': 800, 'n_tokens_neox': 749, 'n_words': 418}