Skip to content

Commit

Permalink
Bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
cjw85 committed Mar 1, 2022
1 parent 8affeed commit 25b2ae1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [v0.5.0]
### Changed
- Decouple file opening from read iteration.
- Move Python pileup function to method of ModBam class.

## [v0.4.6]
### Changed
- Reworked compilation to remove argparser from Python module.
Expand Down
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ over reads in a BAM file and report modification sites:

```
from modbampy import ModBam
with ModBam(args.bam, args.chrom, args.start, args.end) as bam:
with ModBam(args.bam) as bam:
for read in bam.reads():
for pos_mod in read.mod_sites():
for pos_mod in read.mod_sites(args.chrom, args.start, args.end):
print(*pos_mod)
```

Expand All @@ -165,13 +165,15 @@ Each line of the above reports the
* modified base,
* modified-base score (scaled to 0-255).

A second function is provided which mimics the couting procedure implemented in
A second method is provided which mimics the couting procedure implemented in
`modbam2bed`:

```
positions, counts = pileup(
bam, chrom, start, end,
low_threshold=0.33, high_threshold=0.66, mod_base="m")
from modbampy import ModBam
with ModBam(args.bam) as bam:
positions, counts = bam.pileup(
args.chrom, args.start, args.end
low_threshold=0.33, high_threshold=0.66, mod_base="m")
```

The result is two [numpy](https://numpy.org/) arrays. The first indicates the reference
Expand Down
5 changes: 2 additions & 3 deletions modbampy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import libmodbampy

# remember to bump version in src/version.h too
__version__ = "0.4.6"
__version__ = "0.5.0"
ffi = libmodbampy.ffi
libbam = libmodbampy.lib

Expand Down Expand Up @@ -40,8 +40,7 @@ def _tidy_args(read_group, tag_name, tag_value):
class ModBam:
"""A minimal class to iterate over a bam."""

def __init__(
self, bam, read_group=None, tag_name=None, tag_value=None):
def __init__(self, bam):
"""Open a BAM file.
:param bam: BAM file to open.
Expand Down
2 changes: 1 addition & 1 deletion src/version.h
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// remember to bump version in modbampy/__init__.py too
const char *argp_program_version = "0.4.6";
const char *argp_program_version = "0.5.0";

0 comments on commit 25b2ae1

Please sign in to comment.