Skip to content

Commit

Permalink
Improve tag handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
MikkelSchubert committed Apr 27, 2017
1 parent cc71477 commit 16b54df
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
11 changes: 6 additions & 5 deletions mapdamage/rescale.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,11 +275,12 @@ def rescale_qual_read(bam, read, ref, corr_prob,subs, debug = False,direction="b
read.qual = new_qual
# truncate this to 5 digits
number_of_rescaled_bases = float("%.5f" % number_of_rescaled_bases)
# check if the read has a MR tag
for tag in read.tags:
if tag[0] == "MR":
raise SystemExit("Read: %s already has a MR tag, can't rescale" % (read))
read.tags = read.tags + [("MR:f",number_of_rescaled_bases)]

if read.has_tag("MR"):
raise SystemExit("Read: %s already has a MR tag, can't rescale" % read)

read.set_tag("MR", number_of_rescaled_bases, 'f')

return read


Expand Down
3 changes: 1 addition & 2 deletions mapdamage/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
try:
from mapdamage._version import __version__
except ImportError:
__version__ = "2.0.7"

__version__ = "2.0.8"
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def run(self):
setup(
cmdclass={'install': compileInstall},
name='mapdamage',
version='2.0.7',
version='2.0.8',
author='Aurélien Ginolhac, Mikkel Schubert, Hákon Jónsson',
author_email='MSchubert@snm.ku.dk, jonsson.hakon@gmail.com',
packages=['mapdamage'],
Expand Down

0 comments on commit 16b54df

Please sign in to comment.