From 2d7072afbc316cdc9c3dbfaabef6326ee0bdbdb2 Mon Sep 17 00:00:00 2001 From: Udo Gieraths Date: Tue, 2 Feb 2021 11:45:50 +0100 Subject: [PATCH 1/6] fixed naming issue with temporary bam file that resulted in concurency problems --- dark/bowtie2.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dark/bowtie2.py b/dark/bowtie2.py index 130b2c23..50acd188 100644 --- a/dark/bowtie2.py +++ b/dark/bowtie2.py @@ -166,10 +166,11 @@ def removePrimers(self, bedFile): raise ValueError('makeBAM() has not yet been called.') self._report("removing primers specified in %s" % bedFile) + tempTrimmedBam = "%s.trimmed" % self._bamFile self._executor.execute( - "ivar trim -b %s -p result-trimmed -i %s -q 20 -m 30 -s 4 -e" % - (bedFile, self._bamFile)) - self._executor.execute("mv result-trimmed.bam '%s'" % self._bamFile) + "ivar trim -b %s -p %s -i %s -q 20 -m 30 -s 4 -e" % + (bedFile, tempTrimmedBam, self._bamFile)) + self._executor.execute("mv %s '%s'" % (tempTrimmedBam, self._bamFile)) def markDuplicatesPicard(self, picardFile): """ From c67e871de80e4ec7fd7e67d16b28f245285bc28e Mon Sep 17 00:00:00 2001 From: Udo Gieraths Date: Tue, 2 Feb 2021 12:22:10 +0100 Subject: [PATCH 2/6] added quotes around filenames to be inserted into ivar call --- .gitignore | 1 + dark/bowtie2.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index c1867ffd..5cf6406c 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ *.so .tox .DS_Store +.idea _trial_temp __pycache__ build diff --git a/dark/bowtie2.py b/dark/bowtie2.py index 50acd188..38fd595c 100644 --- a/dark/bowtie2.py +++ b/dark/bowtie2.py @@ -168,7 +168,7 @@ def removePrimers(self, bedFile): self._report("removing primers specified in %s" % bedFile) tempTrimmedBam = "%s.trimmed" % self._bamFile self._executor.execute( - "ivar trim -b %s -p %s -i %s -q 20 -m 30 -s 4 -e" % + "ivar trim -b '%s' -p '%s' -i '%s' -q 20 -m 30 -s 4 -e" % (bedFile, tempTrimmedBam, self._bamFile)) self._executor.execute("mv %s '%s'" % (tempTrimmedBam, self._bamFile)) From f3cc64dd307602dd41e5a50bc02778559660bb48 Mon Sep 17 00:00:00 2001 From: Udo Gieraths Date: Tue, 2 Feb 2021 12:23:54 +0100 Subject: [PATCH 3/6] forgot a quote in filename --- dark/bowtie2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dark/bowtie2.py b/dark/bowtie2.py index 38fd595c..58e123d3 100644 --- a/dark/bowtie2.py +++ b/dark/bowtie2.py @@ -170,7 +170,7 @@ def removePrimers(self, bedFile): self._executor.execute( "ivar trim -b '%s' -p '%s' -i '%s' -q 20 -m 30 -s 4 -e" % (bedFile, tempTrimmedBam, self._bamFile)) - self._executor.execute("mv %s '%s'" % (tempTrimmedBam, self._bamFile)) + self._executor.execute("mv '%s' '%s'" % (tempTrimmedBam, self._bamFile)) def markDuplicatesPicard(self, picardFile): """ From 34294fdeca937b086d304784f6b26cd98e6b23e8 Mon Sep 17 00:00:00 2001 From: Udo Gieraths Date: Tue, 2 Feb 2021 14:04:53 +0100 Subject: [PATCH 4/6] increasing the version number and describing the change in changelog.md --- CHANGELOG.md | 4 ++++ dark/__init__.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ed4728b..43157aaa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 3.1.87 January 29, 2021 + +Fixed bug in bowtie2 that was introduced by adding the `--removePrimersFromBedFile` option to `run-bowtie2.py`. + ## 3.1.86 January 31, 2021 Fixed two failing tests due to changed DIAMOND (version 2.0.6) bitscore diff --git a/dark/__init__.py b/dark/__init__.py index d0a1f4f2..409d661c 100644 --- a/dark/__init__.py +++ b/dark/__init__.py @@ -7,4 +7,4 @@ # will not be found by the version() function in ../setup.py # # Remember to update ../CHANGELOG.md describing what's new in each version. -__version__ = '3.1.86' +__version__ = '3.1.87' From 0da019df7f199b8013e9fc11411a26d209eac2a1 Mon Sep 17 00:00:00 2001 From: Udo Gieraths Date: Tue, 2 Feb 2021 17:09:13 +0100 Subject: [PATCH 5/6] i misssed that ivar only takes a prefix not an actual file name, so corrected for this --- CHANGELOG.md | 6 +++++- dark/__init__.py | 2 +- dark/bowtie2.py | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 43157aaa..9186dec1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ -## 3.1.87 January 29, 2021 +## 3.1.88 February 02, 2021 + +Another attempt to fix the bug in bowtie2 that was introduced by adding the `--removePrimersFromBedFile` option to `run-bowtie2.py`. + +## 3.1.87 February 02, 2021 Fixed bug in bowtie2 that was introduced by adding the `--removePrimersFromBedFile` option to `run-bowtie2.py`. diff --git a/dark/__init__.py b/dark/__init__.py index 409d661c..76774d02 100644 --- a/dark/__init__.py +++ b/dark/__init__.py @@ -7,4 +7,4 @@ # will not be found by the version() function in ../setup.py # # Remember to update ../CHANGELOG.md describing what's new in each version. -__version__ = '3.1.87' +__version__ = '3.1.88' diff --git a/dark/bowtie2.py b/dark/bowtie2.py index 58e123d3..b0f0acb7 100644 --- a/dark/bowtie2.py +++ b/dark/bowtie2.py @@ -170,7 +170,8 @@ def removePrimers(self, bedFile): self._executor.execute( "ivar trim -b '%s' -p '%s' -i '%s' -q 20 -m 30 -s 4 -e" % (bedFile, tempTrimmedBam, self._bamFile)) - self._executor.execute("mv '%s' '%s'" % (tempTrimmedBam, self._bamFile)) + self._executor.execute("mv '%s'.bam '%s'" % + (tempTrimmedBam, self._bamFile)) def markDuplicatesPicard(self, picardFile): """ From 6c0a879ed2957d7d2cee4e98d4c4b5bc5c4b2640 Mon Sep 17 00:00:00 2001 From: Udo Gieraths Date: Tue, 2 Feb 2021 17:21:18 +0100 Subject: [PATCH 6/6] adapted name of the prefix --- dark/bowtie2.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dark/bowtie2.py b/dark/bowtie2.py index b0f0acb7..d36e6121 100644 --- a/dark/bowtie2.py +++ b/dark/bowtie2.py @@ -166,12 +166,12 @@ def removePrimers(self, bedFile): raise ValueError('makeBAM() has not yet been called.') self._report("removing primers specified in %s" % bedFile) - tempTrimmedBam = "%s.trimmed" % self._bamFile + tempTrimmedBamPrefix = "%s.trimmed" % self._bamFile self._executor.execute( "ivar trim -b '%s' -p '%s' -i '%s' -q 20 -m 30 -s 4 -e" % - (bedFile, tempTrimmedBam, self._bamFile)) + (bedFile, tempTrimmedBamPrefix, self._bamFile)) self._executor.execute("mv '%s'.bam '%s'" % - (tempTrimmedBam, self._bamFile)) + (tempTrimmedBamPrefix, self._bamFile)) def markDuplicatesPicard(self, picardFile): """