Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
konrad committed Aug 29, 2016
2 parents 5bb4503 + 9bc2ef1 commit 4a1da16
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 15 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
v0.4.2 (2016-08-29)
- Replace ugly pysam view construct (thanks to Thorsten Bischler)
v0.4.1 (2016-08-02)
- Fix another issue with pysam in samtobam.py
- Update dependencies
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ new_release:
@echo "* Change docs/source/conf.py"
@echo "* Change CHANGELOG.txt"
@echo "* Create new docs"
@echo " make html_doc"
@echo "* Test package creation"
@echo "* Test doc creation"
@echo "* make package_to_pypi"
Expand Down
2 changes: 1 addition & 1 deletion bin/reademption
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ __author__ = "Konrad Foerstner <[email protected]>"
__copyright__ = "2011-2016 by Konrad Foerstner <[email protected]>"
__license__ = "ISC license"
__email__ = "[email protected]"
__version__ = "0.4.1"
__version__ = "0.4.2"


def main():
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
# The short X.Y version.
version = '0.4'
# The full version, including alpha/beta/rc tags.
release = '0.4.1'
release = '0.4.2'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
16 changes: 4 additions & 12 deletions reademptionlib/sambamconverter.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,9 @@ def sam_to_bam(self, sam_path, bam_path_prefix):
temp_unsorted_bam_path = self._temp_unsorted_bam_path(
bam_path_prefix)
# Generate unsorted BAM file
#### The following line does not work since pysam 0.9.1.4:
#### pysam.view("-Sb", "-o%s" % temp_unsorted_bam_path, sam_path)
####
#### This is nasty, hopefully only temporaly work-around:
with open(temp_unsorted_bam_path, "wb") as unsorted_bam_fh:
bam_content = pysam.view("-Sb", sam_path)
unsorted_bam_fh.write(bam_content)
pysam.samtools.view(
"-b", "-o{}".format(temp_unsorted_bam_path), sam_path,
catch_stdout=False)
# Generate sorted BAM file
pysam.sort(temp_unsorted_bam_path, "-o", bam_path_prefix + ".bam")
# Generate index for BAM file
Expand All @@ -36,11 +32,7 @@ def sam_to_bam(self, sam_path, bam_path_prefix):
os.remove(sam_path)

def bam_to_sam(self, bam_path, sam_path):
#### Same problem as above!!!
# pysam.view("-ho%s" % sam_path, bam_path)
with open(sam_path, "w") as sam_fh:
sam_content = pysam.view("-h", bam_path,)
sam_fh.write(sam_content)
pysam.view("-ho{}".format(sam_path), bam_path, catch_stdout=False)

def _temp_unsorted_bam_path(self, bam_path_prefix):
return "%s%s.bam" % (bam_path_prefix, self._unsorted_appendix)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name='READemption',
version='0.4.1',
version='0.4.2',
packages=['reademptionlib', 'tests'],
author='Konrad U. Förstner',
author_email='[email protected]',
Expand Down

0 comments on commit 4a1da16

Please sign in to comment.