Skip to content

Commit

Permalink
Fix #64
Browse files Browse the repository at this point in the history
  • Loading branch information
jdidion committed Mar 16, 2018
1 parent 7aed93a commit 3baeb57
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,4 @@ hg3*.fa*
paper/workflow/results
*.ipynb
*.tar
.pytest_cache/
5 changes: 2 additions & 3 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

dev
---
* Added four new tools to the benchmarks:
* Added two new tools to the benchmarks:
* fastp
* Cutadapt
* Sickle
* SeqPrep
* Updated versions of several tools used in the paper. Rebuilt containers and pushed them to Dockerhub.
* Fix #64: InsertAligner not respecting match_adapter_wildcards and match_read_wildcards options.

v1.1.17 (2018.01.13)
--------------------
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ The citation for the original Cutadapt paper is:
* Create Galaxy tool description using [argparse2tool](https://github.com/erasche/argparse2tool#cwl-specific-functionality).
* Improve documentation (#24)
* Port over improvements in latest versions of Cutadapt https://cutadapt.readthedocs.io/en/stable/
* Switch to using entry point instead of Atropos executable.

### 1.3

Expand Down Expand Up @@ -151,6 +152,7 @@ The citation for the original Cutadapt paper is:

### 1.6

* Switch to using Click for CLI.
* Implement a public plugin API.
* Add more logging and convert log messages from old-style to new-style format strings.
* Add option to estimate bisulfite conversion rate from filled-in cytosine methylation status in reads that were MspI-digested.
Expand Down
1 change: 0 additions & 1 deletion atropos/adapters/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,6 @@ def match_to(self, read):
self, read)

# try approximate matching
alignment = None
if not self.indels and self.where in (PREFIX, SUFFIX):
if self.where == PREFIX:
alignment = align.compare_prefixes(
Expand Down
15 changes: 12 additions & 3 deletions atropos/align/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,8 @@ def __init__(
insert_max_rmp=1E-6, adapter_max_rmp=0.001,
min_insert_overlap=1, max_insert_mismatch_frac=0.2,
min_adapter_overlap=1, max_adapter_mismatch_frac=0.2,
adapter_check_cutoff=9, base_probs=None):
adapter_check_cutoff=9, base_probs=None,
adapter_wildcards=True, read_wildcards=False):
self.adapter1 = adapter1
self.adapter1_len = len(adapter1)
self.adapter2 = adapter2
Expand All @@ -260,6 +261,8 @@ def __init__(
self.adapter_check_cutoff = adapter_check_cutoff
self.base_probs = base_probs or dict(
match_prob=0.25, mismatch_prob=0.75)
self.adapter_wildcards = adapter_wildcards
self.read_wildcards = read_wildcards
self.aligner = MultiAligner(
max_insert_mismatch_frac,
START_WITHIN_SEQ1 | STOP_WITHIN_SEQ2,
Expand Down Expand Up @@ -299,8 +302,14 @@ def _match(insert_match, offset, insert_match_size, prob): # pylint disable=unus
# the alignment will fail. We need to use a comparison that is a bit
# more forgiving.

a1_match = compare_prefixes(seq1[insert_match_size:], self.adapter1)
a2_match = compare_prefixes(seq2[insert_match_size:], self.adapter2)
a1_match = compare_prefixes(
seq1[insert_match_size:], self.adapter1,
wildcard_ref=self.adapter_wildcards,
wildcard_query=self.read_wildcards)
a2_match = compare_prefixes(
seq2[insert_match_size:], self.adapter2,
wildcard_ref=self.adapter_wildcards,
wildcard_query=self.read_wildcards)
adapter_len = min(offset, self.adapter1_len, self.adapter2_len)
max_adapter_mismatches = round(
adapter_len * self.max_adapter_mismatch_frac)
Expand Down
4 changes: 3 additions & 1 deletion atropos/commands/trim/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,9 @@ def __call__(self):
max_adapter_mismatch_frac=\
options.insert_match_adapter_error_rate,
match_probability=match_probability,
insert_max_rmp=options.insert_max_rmp)
insert_max_rmp=options.insert_max_rmp,
read_wildcards=options.match_read_wildcards,
adapter_wildcards=options.match_adapter_wildcards)
else:
a1_args = dict(
adapters=adapters1,
Expand Down
3 changes: 2 additions & 1 deletion atropos/commands/trim/modifiers.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,8 @@ def __init__(
self.adapter2 = adapter2
self.aligner = InsertAligner(
adapter1.sequence, adapter2.sequence,
min_insert_overlap=min_insert_overlap, **aligner_args)
min_insert_overlap=min_insert_overlap,
**aligner_args)
self.min_insert_len = min_insert_overlap
self.action = action
self.symmetric = symmetric
Expand Down

0 comments on commit 3baeb57

Please sign in to comment.